diff options
author | Arseny Kapoulkine <arseny.kapoulkine@gmail.com> | 2014-09-15 02:51:37 +0000 |
---|---|---|
committer | Arseny Kapoulkine <arseny.kapoulkine@gmail.com> | 2014-09-15 02:51:37 +0000 |
commit | da54ffd8a3c965e913620b0907ed6f4e4e552ce0 (patch) | |
tree | ad48dc779d1d2f5c746e93e8682816384acd7ee7 /scripts/CMakeLists.txt | |
parent | 6e1c9ec7d1c52afe25a7f51c66cd5d5cad75ddc8 (diff) |
CMake tweaks:
- Include GNUInstallDirs which sets up standard install locations including
lib64 for mulilib systems.
- Make BUILD_SHARED_LIBS an option instead of a variable which is better for
use in either the cmake-gui or ccmake gui interfaces.
- Setup a destination for WIN32 runtime DLL's which is also helpful for MinGW
installs.
git-svn-id: https://pugixml.googlecode.com/svn/trunk@1012 99668b35-9821-0410-8761-19e4c4f06640
Diffstat (limited to 'scripts/CMakeLists.txt')
-rw-r--r-- | scripts/CMakeLists.txt | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index ba0f67c..bd33220 100644 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -2,12 +2,12 @@ project(pugixml) cmake_minimum_required(VERSION 2.6) -set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared instead of static library") +option(BUILD_SHARED_LIBS "Build shared instead of static library" OFF) set(BUILD_DEFINES "" CACHE STRING "Build defines") -if(NOT DEFINED CMAKE_INSTALL_LIBDIR) - SET(CMAKE_INSTALL_LIBDIR lib CACHE PATH "Output directory for libraries") -endif() +# Pre-defines standard install locations on *nix systems. +include(GNUInstallDirs) +mark_as_advanced(CLEAR CMAKE_INSTALL_LIBDIR CMAKE_INSTALL_INCLUDEDIR) set(HEADERS ../src/pugixml.hpp ../src/pugiconfig.hpp) set(SOURCES ${HEADERS} ../src/pugixml.cpp) @@ -24,6 +24,11 @@ endif() set_target_properties(pugixml PROPERTIES VERSION 1.4 SOVERSION 1) -install(TARGETS pugixml EXPORT pugixml-config LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) -install(FILES ${HEADERS} DESTINATION include) +install(TARGETS pugixml EXPORT pugixml-config + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +) + +install(FILES ${HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) install(EXPORT pugixml-config DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/pugixml) |