PROTON-2254 Allow absolute -DINCLUDE_INSTALL_DIR= (#329)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3aef3b0..0eb169a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -280,10 +280,11 @@
# by configure_package_config_file(), and available in ProtonConfig.cmake
macro (pn_relative_install_dir NAME VALUE)
if (IS_ABSOLUTE ${VALUE})
- message(FATAL_ERROR "pn_relative_install_dir requires relative directory")
+ message(WARNING "Build was given an absolute path '${VALUE}'. As a result, `make DESTDIR=... install` will not work.")
+ set (${NAME} "${VALUE}")
+ else ()
+ set (${NAME} "\${PACKAGE_PREFIX_DIR}/${VALUE}")
endif ()
-
- set (${NAME} "\${PACKAGE_PREFIX_DIR}/${VALUE}")
endmacro ()
pn_relative_install_dir (INCLUDEDIR ${INCLUDE_INSTALL_DIR})