Stop using absolute paths

This commit is contained in:
Isaac Hier 2018-03-11 10:51:43 -04:00
parent bb71db204f
commit 2c98c30a02

View File

@ -607,12 +607,9 @@ set(VERSION ${JANSSON_DISPLAY_VERSION})
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/jansson.pc.in
${CMAKE_CURRENT_BINARY_DIR}/jansson.pc @ONLY)
# Make sure the paths are absolute.
# Make sure the paths are relative.
foreach(p LIB BIN INCLUDE CMAKE)
set(var JANSSON_INSTALL_${p}_DIR)
if(NOT IS_ABSOLUTE "${${var}}")
set(${var} "${CMAKE_INSTALL_PREFIX}/${${var}}")
endif()
endforeach()
# Generate the config file for the build-tree.
@ -626,7 +623,6 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/janssonConfig.cmake.in
# Generate the config file for the installation tree.
include(CMakePackageConfigHelpers)
write_basic_package_version_file(
@ -669,7 +665,7 @@ if (JANSSON_INSTALL)
# Install exports for the install-tree.
install(EXPORT janssonTargets
NAMESPACE jansson
NAMESPACE jansson::
DESTINATION "${JANSSON_INSTALL_CMAKE_DIR}")
endif()