Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / libraries / eigen / include-dir.patch
blob9928bbdbed1b118fdc1f2764825a495234194ac4
1 --- a/CMakeLists.txt
2 +++ b/CMakeLists.txt
3 @@ -1,5 +1,5 @@
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)
8 project(Eigen3)
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}
27 - )
28 -endif()
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}
45 + )
46 +endif()
48 include (CMakePackageConfigHelpers)
50 --- a/eigen3.pc.in
51 +++ b/eigen3.pc.in
52 @@ -6,4 +6,4 @@ Description: A C++ template library for linear algebra: vectors, matrices, and r
53 Requires:
54 Version: @EIGEN_VERSION_NUMBER@
55 Libs:
56 -Cflags: -I${prefix}/@INCLUDE_INSTALL_DIR@
57 +Cflags: -I@EIGEN_INCLUDE_DIR@