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

CMake: Simplify install path logic

Select correct suffix to use for pkg-config
This commit is contained in:
Arseny Kapoulkine 2016-09-20 22:16:47 -07:00
parent fd896d2476
commit 2933a03d09

View File

@ -51,27 +51,15 @@ set_target_properties(pugixml PROPERTIES VERSION 1.7 SOVERSION 1)
get_target_property(PUGIXML_VERSION_STRING pugixml VERSION) get_target_property(PUGIXML_VERSION_STRING pugixml VERSION)
if(BUILD_PKGCONFIG) if(BUILD_PKGCONFIG)
# Install shared library into its own directory under LIBDIR # Install library into its own directory under LIBDIR
install(TARGETS pugixml EXPORT pugixml-config set(INSTALL_SUFFIX /pugixml-${PUGIXML_VERSION_STRING})
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/pugixml-${PUGIXML_VERSION_STRING}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/pugixml-${PUGIXML_VERSION_STRING}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
# Install header files into their own directory under INCLUDEDIR
install(FILES ${HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/pugixml-${PUGIXML_VERSION_STRING})
else()
# Install shared library into default LIBDIR directory
install(TARGETS pugixml EXPORT pugixml-config
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
# Install header files into default INCLUDEDIR directory
install(FILES ${HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
endif() endif()
install(TARGETS pugixml EXPORT pugixml-config
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${INSTALL_SUFFIX}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${INSTALL_SUFFIX}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES ${HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}${INSTALL_SUFFIX})
install(EXPORT pugixml-config DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/pugixml) install(EXPORT pugixml-config DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/pugixml)
if(BUILD_PKGCONFIG) if(BUILD_PKGCONFIG)