0
0
mirror of https://github.com/zeux/pugixml.git synced 2024-12-27 13:33:17 +08:00

Added cmake option to disable install rules

This commit is contained in:
Ilya Lavrenov 2023-10-12 02:05:35 +04:00
parent ef856bf975
commit 3cfe51b72d

View File

@ -42,6 +42,7 @@ cmake_dependent_option(PUGIXML_BUILD_SHARED_AND_STATIC_LIBS
# Expose options from the pugiconfig.hpp # Expose options from the pugiconfig.hpp
option(PUGIXML_WCHAR_MODE "Enable wchar_t mode" OFF) option(PUGIXML_WCHAR_MODE "Enable wchar_t mode" OFF)
option(PUGIXML_COMPACT "Enable compact mode" OFF) option(PUGIXML_COMPACT "Enable compact mode" OFF)
option(PUGIXML_INSTALL "Enable installation rules" ON)
# Advanced options from pugiconfig.hpp # Advanced options from pugiconfig.hpp
option(PUGIXML_NO_XPATH "Disable XPath" OFF) option(PUGIXML_NO_XPATH "Disable XPath" OFF)
@ -193,6 +194,11 @@ endif()
configure_file(scripts/pugixml.pc.in pugixml.pc @ONLY) configure_file(scripts/pugixml.pc.in pugixml.pc @ONLY)
export(TARGETS ${install-targets}
NAMESPACE pugixml::
FILE pugixml-targets.cmake)
if(PUGIXML_INSTALL)
if (NOT DEFINED PUGIXML_RUNTIME_COMPONENT) if (NOT DEFINED PUGIXML_RUNTIME_COMPONENT)
set(PUGIXML_RUNTIME_COMPONENT Runtime) set(PUGIXML_RUNTIME_COMPONENT Runtime)
endif() endif()
@ -220,9 +226,6 @@ install(EXPORT pugixml-targets
NAMESPACE pugixml:: NAMESPACE pugixml::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/pugixml COMPONENT ${PUGIXML_DEVELOPMENT_COMPONENT}) DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/pugixml COMPONENT ${PUGIXML_DEVELOPMENT_COMPONENT})
export(EXPORT pugixml-targets
NAMESPACE pugixml::)
install(FILES install(FILES
"${PROJECT_BINARY_DIR}/pugixml-config-version.cmake" "${PROJECT_BINARY_DIR}/pugixml-config-version.cmake"
"${PROJECT_BINARY_DIR}/pugixml-config.cmake" "${PROJECT_BINARY_DIR}/pugixml-config.cmake"
@ -237,6 +240,7 @@ install(
"${PROJECT_SOURCE_DIR}/src/pugixml.hpp" "${PROJECT_SOURCE_DIR}/src/pugixml.hpp"
DESTINATION DESTINATION
${CMAKE_INSTALL_INCLUDEDIR}${versioned-dir} COMPONENT ${PUGIXML_DEVELOPMENT_COMPONENT}) ${CMAKE_INSTALL_INCLUDEDIR}${versioned-dir} COMPONENT ${PUGIXML_DEVELOPMENT_COMPONENT})
endif()
if (PUGIXML_BUILD_TESTS) if (PUGIXML_BUILD_TESTS)
include(CTest) include(CTest)