summaryrefslogtreecommitdiff
path: root/scripts/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/CMakeLists.txt')
-rw-r--r--scripts/CMakeLists.txt17
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)