Updated CMakeLists.txt for relocatable installs

Forcing CMAKE_INSTALL_LIBDIR and CMAKE_INSTALL_INCLUDEDIR to be absolute is unnecessary and results in absolute paths in the installation. This prevents relocatable prefix installations.
This commit is contained in:
John Butterfield
2018-06-20 18:58:09 -07:00
committed by GitHub
parent b54cf3cb45
commit d89d6d9551

View File

@@ -143,13 +143,6 @@ endif()
install(FILES tinyxml2.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) install(FILES tinyxml2.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
foreach(p LIB INCLUDE)
set(var CMAKE_INSTALL_${p}DIR)
if(NOT IS_ABSOLUTE "${${var}}")
set(${var} "${CMAKE_INSTALL_PREFIX}/${${var}}")
endif()
endforeach()
configure_file(tinyxml2.pc.in tinyxml2.pc @ONLY) configure_file(tinyxml2.pc.in tinyxml2.pc @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/tinyxml2.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/tinyxml2.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)