Browse Source

cmake: fix installation directories and also install pkgconfig file (#224)

pull/233/head
Markus F.X.J. Oberhumer 3 years ago
committed by GitHub
parent
commit
27e8a16049
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 25
      CMakeLists.txt
  2. 10
      libutf8proc.pc.cmakein

25
CMakeLists.txt

@ -1,10 +1,13 @@
cmake_minimum_required (VERSION 2.8.12)
cmake_minimum_required (VERSION 3.0.0)
include (utils.cmake)
disallow_intree_builds()
project (utf8proc C)
if (POLICY CMP0048)
cmake_policy (SET CMP0048 NEW)
endif ()
project (utf8proc VERSION 2.6.1 LANGUAGES C)
# This is the ABI version number, which may differ from the
# API version number (defined in utf8proc.h).
@ -52,16 +55,14 @@ set_target_properties (utf8proc PROPERTIES
if (UTF8PROC_INSTALL)
include(GNUInstallDirs)
mark_as_advanced(CLEAR CMAKE_INSTALL_LIBDIR CMAKE_INSTALL_INCLUDEDIR)
install(FILES utf8proc.h DESTINATION "${CMAKE_INSTALL_FULL_INCLUDEDIR}")
install(TARGETS utf8proc
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${INSTALL_SUFFIX}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${INSTALL_SUFFIX})
install(
FILES
"${PROJECT_SOURCE_DIR}/utf8proc.h"
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}${INSTALL_SUFFIX})
ARCHIVE DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}"
LIBRARY DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}"
RUNTIME DESTINATION "${CMAKE_INSTALL_FULL_BINDIR}"
)
configure_file(libutf8proc.pc.cmakein libutf8proc.pc @ONLY)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libutf8proc.pc" DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}/pkgconfig")
endif()
if(UTF8PROC_ENABLE_TESTING)
@ -101,7 +102,7 @@ if(UTF8PROC_ENABLE_TESTING)
target_link_libraries(normtest utf8proc)
add_test(utf8proc.testgraphemetest graphemetest data/GraphemeBreakTest.txt)
add_test(utf8proc.testnormtest normtest data/NormalizationTest.txt)
if(LIB_FUZZING_ENGINE)
add_executable(fuzzer utf8proc.h test/fuzzer.c)
target_link_libraries(fuzzer ${LIB_FUZZING_ENGINE} utf8proc)

10
libutf8proc.pc.cmakein

@ -0,0 +1,10 @@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=@CMAKE_INSTALL_FULL_BINDIR@
libdir=@CMAKE_INSTALL_FULL_LIBDIR@
includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
Name: libutf8proc
Description: UTF8 processing
Version: @PROJECT_VERSION@
Libs: -L${libdir} -lutf8proc
Cflags: -I${includedir} -DUTF8PROC_EXPORTS
Loading…
Cancel
Save