From b54cf3cb4531a62592fe8679ce264fe272e1cd36 Mon Sep 17 00:00:00 2001 From: John Butterfield Date: Wed, 20 Jun 2018 18:52:24 -0700 Subject: [PATCH 1/2] Made CMakeLists.txt installation relocatable. The installation interface should really be a relative path. --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a64e68e..f7b41ae 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -60,7 +60,7 @@ set_target_properties(tinyxml2 PROPERTIES if(DEFINED CMAKE_VERSION AND NOT "${CMAKE_VERSION}" VERSION_LESS "2.8.11") target_include_directories(tinyxml2 PUBLIC $ - $) + $) if(MSVC) target_compile_definitions(tinyxml2 PUBLIC -D_CRT_SECURE_NO_WARNINGS) @@ -97,7 +97,7 @@ target_compile_definitions(tinyxml2_static PUBLIC -D_CRT_SECURE_NO_WARNINGS) if(DEFINED CMAKE_VERSION AND NOT "${CMAKE_VERSION}" VERSION_LESS "2.8.11") target_include_directories(tinyxml2_static PUBLIC $ - $) + $) if(MSVC) target_compile_definitions(tinyxml2_static PUBLIC -D_CRT_SECURE_NO_WARNINGS) From d89d6d9551e5343de4f70ac534f61c3057713f92 Mon Sep 17 00:00:00 2001 From: John Butterfield Date: Wed, 20 Jun 2018 18:58:09 -0700 Subject: [PATCH 2/2] 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. --- CMakeLists.txt | 7 ------- 1 file changed, 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f7b41ae..978a24b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -143,13 +143,6 @@ endif() 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) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/tinyxml2.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)