aboutsummaryrefslogtreecommitdiffhomepage
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2015-12-10 15:47:06 +0100
committerGravatar Gael Guennebaud <g.gael@free.fr>2015-12-10 15:47:06 +0100
commitb0a1d6f2e532afa475077f9d8b79b1cbe87b71ae (patch)
treefc92e51b7dc1e0db502f675e59de6ab42fb2e4a5 /CMakeLists.txt
parentb836acb7992dcec05e5ff59f08b0c73656380c3d (diff)
Improve handling of deprecated EIGEN_INCLUDE_INSTALL_DIR variable
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt23
1 files changed, 14 insertions, 9 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5240f3039..eaee5d5e2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -338,10 +338,20 @@ option(EIGEN_TEST_CXX11 "Enable testing with C++11 and C++11 features (e.g. Tens
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
-set(INCLUDE_INSTALL_DIR
- "${CMAKE_INSTALL_INCLUDEDIR}/eigen3"
- CACHE PATH "The directory relative to CMAKE_PREFIX_PATH where Eigen header files are installed"
- )
+# Backward compatibility support for EIGEN_INCLUDE_INSTALL_DIR
+if(EIGEN_INCLUDE_INSTALL_DIR)
+ message(WARNING "EIGEN_INCLUDE_INSTALL_DIR is deprecated. Use INCLUDE_INSTALL_DIR instead.")
+endif()
+
+if(EIGEN_INCLUDE_INSTALL_DIR AND NOT INCLUDE_INSTALL_DIR)
+ set(INCLUDE_INSTALL_DIR ${EIGEN_INCLUDE_INSTALL_DIR}
+ CACHE PATH "The directory relative to CMAKE_PREFIX_PATH where Eigen header files are installed")
+else()
+ set(INCLUDE_INSTALL_DIR
+ "${CMAKE_INSTALL_INCLUDEDIR}/eigen3"
+ CACHE PATH "The directory relative to CMAKE_PREFIX_PATH where Eigen header files are installed"
+ )
+endif()
set(CMAKEPACKAGE_INSTALL_DIR
"${CMAKE_INSTALL_LIBDIR}/cmake/eigen3"
CACHE PATH "The directory relative to CMAKE_PREFIX_PATH where Eigen3Config.cmake is installed"
@@ -351,11 +361,6 @@ set(PKGCONFIG_INSTALL_DIR
CACHE PATH "The directory relative to CMAKE_PREFIX_PATH where eigen3.pc is installed"
)
-# Backward compatibility support for EIGEN_INCLUDE_INSTALL_DIR
-if(DEFINED EIGEN_INCLUDE_INSTALL_DIR)
- message(WARNING "EIGEN_INCLUDE_INSTALL_DIR is deprecated. Use INCLUDE_INSTALL_DIR instead.")
- set(INCLUDE_INSTALL_DIR ${EIGEN_INCLUDE_INSTALL_DIR} CACHE PATH "" FORCE)
-endif()
# similar to set_target_properties but append the property instead of overwriting it
macro(ei_add_target_property target prop value)