]> granicus.if.org Git - libexpat/commitdiff
CMake: Use GNUInstallDirs module to set proper defaults for install directories
authorRolf Eike Beer <eb@emlix.com>
Thu, 14 Dec 2017 08:57:54 +0000 (09:57 +0100)
committerSebastian Pipping <sebastian@pipping.org>
Thu, 14 Dec 2017 19:35:04 +0000 (20:35 +0100)
expat/CMakeLists.txt
expat/Changes

index d4a943a736c5bf03a70ad9c212393eb4d65b51fe..b2694e303f8023723f469dac7ae65a0b16d41971 100644 (file)
@@ -3,13 +3,15 @@
 \r
 project(expat)\r
 \r
-cmake_minimum_required(VERSION 2.6)\r
+cmake_minimum_required(VERSION 2.8.10)\r
 set(PACKAGE_BUGREPORT "expat-bugs@libexpat.org")\r
 set(PACKAGE_NAME "expat")\r
 set(PACKAGE_VERSION "2.2.5")\r
 set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")\r
 set(PACKAGE_TARNAME "${PACKAGE_NAME}")\r
 \r
+include(GNUInstallDirs)\r
+\r
 if(WINCE)\r
     set(BUILD_tools_default OFF)\r
 else()\r
@@ -137,9 +139,9 @@ macro(expat_install)
     endif()\r
 endmacro()\r
 \r
-expat_install(TARGETS expat RUNTIME DESTINATION bin\r
-                      LIBRARY DESTINATION lib\r
-                      ARCHIVE DESTINATION lib)\r
+expat_install(TARGETS expat RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}\r
+                      LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}\r
+                      ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})\r
 \r
 set(prefix ${CMAKE_INSTALL_PREFIX})\r
 set(exec_prefix "\${prefix}")\r
@@ -147,8 +149,8 @@ set(libdir "\${exec_prefix}/lib")
 set(includedir "\${prefix}/include")\r
 configure_file(expat.pc.in ${CMAKE_CURRENT_BINARY_DIR}/expat.pc @ONLY)\r
 \r
-expat_install(FILES lib/expat.h lib/expat_external.h DESTINATION include)\r
-expat_install(FILES ${CMAKE_CURRENT_BINARY_DIR}/expat.pc DESTINATION lib/pkgconfig)\r
+expat_install(FILES lib/expat.h lib/expat_external.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})\r
+expat_install(FILES ${CMAKE_CURRENT_BINARY_DIR}/expat.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)\r
 \r
 if(BUILD_tools)\r
     set(xmlwf_SRCS\r
@@ -161,10 +163,10 @@ if(BUILD_tools)
     add_executable(xmlwf ${xmlwf_SRCS})\r
     set_property(TARGET xmlwf PROPERTY RUNTIME_OUTPUT_DIRECTORY xmlwf)\r
     target_link_libraries(xmlwf expat)\r
-    expat_install(TARGETS xmlwf DESTINATION bin)\r
+    expat_install(TARGETS xmlwf DESTINATION ${CMAKE_INSTALL_BINDIR})\r
     if(BUILD_doc)\r
         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")\r
-        expat_install(FILES "${PROJECT_SOURCE_DIR}/doc/xmlwf.1" DESTINATION share/man/man1)\r
+        expat_install(FILES "${PROJECT_SOURCE_DIR}/doc/xmlwf.1" DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)\r
     endif()\r
 endif()\r
 \r
index 45a3e9f25d908f78f56971804f0825848fe79ae9..aab734c9493b7ecce543b591bf036942185e208c 100644 (file)
@@ -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: