Skip to content

Commit 1be6c37

Browse files
Merge pull request #57 from AlexeyDmitriev/use_relative_path_install
Use absolute install path in separate variables (avoiding empty CPack archieve)
2 parents 0ca9699 + 386c3ba commit 1be6c37

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ set(INSTALL_CMAKE_DIR ${DEF_INSTALL_CMAKE_DIR} CACHE PATH
6666
foreach (p IN ITEMS LIB BIN INCLUDE DATA CMAKE)
6767
set (var "INSTALL_${p}_DIR")
6868
if (NOT IS_ABSOLUTE "${${var}}")
69-
set("${var}" "${CMAKE_INSTALL_PREFIX}/${${var}}")
69+
set("ABSOLUTE_${var}" "${CMAKE_INSTALL_PREFIX}/${${var}}")
70+
else ()
71+
set("ABSOLUTE_${var}" "${${var}}")
7072
endif ()
7173
endforeach (p)
7274

@@ -244,7 +246,7 @@ configure_file(mFASTConfig.cmake.in
244246
@ONLY)
245247

246248
# Create the mFASTConfig.cmake for the install tree
247-
file(RELATIVE_PATH REL_INCLUDE_DIR "${INSTALL_CMAKE_DIR}" "${INSTALL_INCLUDE_DIR}")
249+
file(RELATIVE_PATH REL_INCLUDE_DIR "${ABSOLUTE_INSTALL_CMAKE_DIR}" "${ABSOLUTE_INSTALL_INCLUDE_DIR}")
248250
set(CONF_INCLUDE_DIRS "\${MFAST_CMAKE_DIR}/${REL_INCLUDE_DIR}")
249251
configure_file(mFASTConfig.cmake.in
250252
"${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/mFASTConfig.cmake"

0 commit comments

Comments
 (0)