2010-07-19 09:57:32 +00:00
|
|
|
project(pugixml)
|
|
|
|
|
2011-07-20 04:21:49 +00:00
|
|
|
cmake_minimum_required(VERSION 2.6)
|
2014-07-28 16:08:43 +00:00
|
|
|
|
2014-09-15 02:51:37 +00:00
|
|
|
option(BUILD_SHARED_LIBS "Build shared instead of static library" OFF)
|
2014-07-28 16:08:43 +00:00
|
|
|
set(BUILD_DEFINES "" CACHE STRING "Build defines")
|
2011-07-20 04:21:49 +00:00
|
|
|
|
2014-09-15 02:51:37 +00:00
|
|
|
# Pre-defines standard install locations on *nix systems.
|
|
|
|
include(GNUInstallDirs)
|
|
|
|
mark_as_advanced(CLEAR CMAKE_INSTALL_LIBDIR CMAKE_INSTALL_INCLUDEDIR)
|
2012-07-03 15:04:48 +00:00
|
|
|
|
2012-04-09 06:08:12 +00:00
|
|
|
set(HEADERS ../src/pugixml.hpp ../src/pugiconfig.hpp)
|
|
|
|
set(SOURCES ${HEADERS} ../src/pugixml.cpp)
|
2010-07-19 09:57:32 +00:00
|
|
|
|
2014-07-28 16:08:43 +00:00
|
|
|
if(DEFINED BUILD_DEFINES)
|
|
|
|
add_definitions(${BUILD_DEFINES})
|
|
|
|
endif()
|
|
|
|
|
2011-07-20 04:21:49 +00:00
|
|
|
if(BUILD_SHARED_LIBS)
|
|
|
|
add_library(pugixml SHARED ${SOURCES})
|
|
|
|
else()
|
|
|
|
add_library(pugixml STATIC ${SOURCES})
|
|
|
|
endif()
|
|
|
|
|
2015-03-18 21:19:58 -07:00
|
|
|
set_target_properties(pugixml PROPERTIES VERSION 1.6 SOVERSION 1)
|
2012-03-23 06:09:23 +00:00
|
|
|
|
2014-09-15 02:51:37 +00:00
|
|
|
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})
|
2014-09-03 14:31:48 -06:00
|
|
|
install(EXPORT pugixml-config DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/pugixml)
|