4 # cmake_minimum_require must be the first command of the file
5 -cmake_minimum_required(VERSION 3.5.0)
6 +cmake_minimum_required(VERSION 3.7.0)
10 @@ -443,7 +443,7 @@ set(PKGCONFIG_INSTALL_DIR
11 CACHE PATH "The directory relative to CMAKE_INSTALL_PREFIX where eigen3.pc is installed"
14 -foreach(var INCLUDE_INSTALL_DIR CMAKEPACKAGE_INSTALL_DIR PKGCONFIG_INSTALL_DIR)
15 +foreach(var CMAKEPACKAGE_INSTALL_DIR PKGCONFIG_INSTALL_DIR)
16 # If an absolute path is specified, make it relative to "{CMAKE_INSTALL_PREFIX}".
17 if(IS_ABSOLUTE "${${var}}")
18 file(RELATIVE_PATH "${var}" "${CMAKE_INSTALL_PREFIX}" "${${var}}")
19 @@ -466,13 +466,6 @@ install(FILES
20 DESTINATION ${INCLUDE_INSTALL_DIR} COMPONENT Devel
23 -if(EIGEN_BUILD_PKGCONFIG)
24 - configure_file(eigen3.pc.in eigen3.pc @ONLY)
25 - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/eigen3.pc
26 - DESTINATION ${PKGCONFIG_INSTALL_DIR}
30 install(DIRECTORY Eigen DESTINATION ${INCLUDE_INSTALL_DIR} COMPONENT Devel)
33 @@ -593,8 +586,15 @@ set ( EIGEN_VERSION_MAJOR ${EIGEN_WORLD_VERSION} )
34 set ( EIGEN_VERSION_MINOR ${EIGEN_MAJOR_VERSION} )
35 set ( EIGEN_VERSION_PATCH ${EIGEN_MINOR_VERSION} )
36 set ( EIGEN_DEFINITIONS "")
37 -set ( EIGEN_INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/${INCLUDE_INSTALL_DIR}" )
38 set ( EIGEN_ROOT_DIR ${CMAKE_INSTALL_PREFIX} )
39 +GNUInstallDirs_get_absolute_install_dir(EIGEN_INCLUDE_DIR INCLUDE_INSTALL_DIR)
41 +if(EIGEN_BUILD_PKGCONFIG)
42 + configure_file(eigen3.pc.in eigen3.pc @ONLY)
43 + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/eigen3.pc
44 + DESTINATION ${PKGCONFIG_INSTALL_DIR}
48 include (CMakePackageConfigHelpers)
52 @@ -6,4 +6,4 @@ Description: A C++ template library for linear algebra: vectors, matrices, and r
54 Version: @EIGEN_VERSION_NUMBER@
56 -Cflags: -I${prefix}/@INCLUDE_INSTALL_DIR@
57 +Cflags: -I@EIGEN_INCLUDE_DIR@