From 5681911965ef3f8c8dd46d9b942045bbd7e1e23c Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer Date: Thu, 14 Dec 2017 09:57:54 +0100 Subject: [PATCH] CMake: Use GNUInstallDirs module to set proper defaults for install directories --- expat/CMakeLists.txt | 18 ++++++++++-------- expat/Changes | 2 ++ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/expat/CMakeLists.txt b/expat/CMakeLists.txt index d4a943a7..b2694e30 100644 --- a/expat/CMakeLists.txt +++ b/expat/CMakeLists.txt @@ -3,13 +3,15 @@ project(expat) -cmake_minimum_required(VERSION 2.6) +cmake_minimum_required(VERSION 2.8.10) set(PACKAGE_BUGREPORT "expat-bugs@libexpat.org") set(PACKAGE_NAME "expat") set(PACKAGE_VERSION "2.2.5") set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") set(PACKAGE_TARNAME "${PACKAGE_NAME}") +include(GNUInstallDirs) + if(WINCE) set(BUILD_tools_default OFF) else() @@ -137,9 +139,9 @@ macro(expat_install) endif() endmacro() -expat_install(TARGETS expat RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib) +expat_install(TARGETS expat RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) set(prefix ${CMAKE_INSTALL_PREFIX}) set(exec_prefix "\${prefix}") @@ -147,8 +149,8 @@ set(libdir "\${exec_prefix}/lib") set(includedir "\${prefix}/include") configure_file(expat.pc.in ${CMAKE_CURRENT_BINARY_DIR}/expat.pc @ONLY) -expat_install(FILES lib/expat.h lib/expat_external.h DESTINATION include) -expat_install(FILES ${CMAKE_CURRENT_BINARY_DIR}/expat.pc DESTINATION lib/pkgconfig) +expat_install(FILES lib/expat.h lib/expat_external.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) +expat_install(FILES ${CMAKE_CURRENT_BINARY_DIR}/expat.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) if(BUILD_tools) set(xmlwf_SRCS @@ -161,10 +163,10 @@ if(BUILD_tools) add_executable(xmlwf ${xmlwf_SRCS}) set_property(TARGET xmlwf PROPERTY RUNTIME_OUTPUT_DIRECTORY xmlwf) target_link_libraries(xmlwf expat) - expat_install(TARGETS xmlwf DESTINATION bin) + expat_install(TARGETS xmlwf DESTINATION ${CMAKE_INSTALL_BINDIR}) if(BUILD_doc) add_custom_command(TARGET expat PRE_BUILD COMMAND "${DOCBOOK_TO_MAN}" "${PROJECT_SOURCE_DIR}/doc/xmlwf.xml" && mv "XMLWF.1" "${PROJECT_SOURCE_DIR}/doc/xmlwf.1") - expat_install(FILES "${PROJECT_SOURCE_DIR}/doc/xmlwf.1" DESTINATION share/man/man1) + expat_install(FILES "${PROJECT_SOURCE_DIR}/doc/xmlwf.1" DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) endif() endif() diff --git a/expat/Changes b/expat/Changes index 45a3e9f2..aab734c9 100644 --- a/expat/Changes +++ b/expat/Changes @@ -14,6 +14,8 @@ Release 2.2.? ??????????????????? #174 CMake: Introduce option WARNINGS_AS_ERRORS, defaults to OFF #175 CMake: Prefer check_symbol_exists over check_function_exists #176 CMake: Create the same pkg-config file as with GNU Autotools + #178 #179 CMake: Use GNUInstallDirs module to set proper defaults for + install directories #131 #173 Address compiler warnings Special thanks to: