Bugzilla – Attachment 607 Details for
Bug 1072
CMAKE_INSTALL_PREFIX is set but 'make install' is writing to /usr/local
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Forgot Password
Login:
[x]
This bugzilla service is closed. All entries have been migrated to
https://gitlab.com/libeigen/eigen
[patch]
refactoring of .pc file installation
bug_1072_pkgconfig_install.diff (text/plain), 3.84 KB, created by
Gael Guennebaud
on 2015-09-28 12:53:25 UTC
(
hide
)
Description:
refactoring of .pc file installation
Filename:
MIME Type:
Creator:
Gael Guennebaud
Created:
2015-09-28 12:53:25 UTC
Size:
3.84 KB
patch
obsolete
>diff --git a/CMakeLists.txt b/CMakeLists.txt >--- a/CMakeLists.txt >+++ b/CMakeLists.txt >@@ -87,19 +87,19 @@ endif() > > if(EIGEN_STANDARD_LIBRARIES_TO_LINK_TO) > message(STATUS "Standard libraries to link to explicitly: ${EIGEN_STANDARD_LIBRARIES_TO_LINK_TO}") > else() > message(STATUS "Standard libraries to link to explicitly: none") > endif() > > option(EIGEN_BUILD_BTL "Build benchmark suite" OFF) >-if(NOT WIN32) >- option(EIGEN_BUILD_PKGCONFIG "Build pkg-config .pc file for Eigen" ON) >-endif(NOT WIN32) >+ >+find_package(PkgConfig) >+option(EIGEN_INSTALL_PKGCONFIG "Install pkg-config .pc file for Eigen" ${PKG_CONFIG_FOUND}) > > set(CMAKE_INCLUDE_CURRENT_DIR ON) > > option(EIGEN_SPLIT_LARGE_TESTS "Split large tests into smaller executables" ON) > > option(EIGEN_DEFAULT_TO_ROW_MAJOR "Use row-major as default matrix storage order" OFF) > if(EIGEN_DEFAULT_TO_ROW_MAJOR) > add_definitions("-DEIGEN_DEFAULT_TO_ROW_MAJOR") >@@ -371,34 +371,49 @@ macro(ei_add_target_property target prop > set_target_properties(${target} PROPERTIES ${prop} "${previous} ${value}") > endmacro(ei_add_target_property) > > install(FILES > signature_of_eigen3_matrix_library > DESTINATION ${INCLUDE_INSTALL_DIR} COMPONENT Devel > ) > >-if(EIGEN_BUILD_PKGCONFIG) >- SET(path_separator ":") >- STRING(REPLACE ${path_separator} ";" pkg_config_libdir_search "$ENV{PKG_CONFIG_LIBDIR}") >- message(STATUS "searching for 'pkgconfig' directory in PKG_CONFIG_LIBDIR ( $ENV{PKG_CONFIG_LIBDIR} ), ${CMAKE_INSTALL_PREFIX}/share, and ${CMAKE_INSTALL_PREFIX}/lib") >- FIND_PATH(pkg_config_libdir pkgconfig ${pkg_config_libdir_search} ${CMAKE_INSTALL_PREFIX}/share ${CMAKE_INSTALL_PREFIX}/lib ${pkg_config_libdir_search}) >- if(pkg_config_libdir) >- SET(pkg_config_install_dir ${pkg_config_libdir}) >- message(STATUS "found ${pkg_config_libdir}/pkgconfig" ) >- else(pkg_config_libdir) >- SET(pkg_config_install_dir ${CMAKE_INSTALL_PREFIX}/share) >- message(STATUS "pkgconfig not found; installing in ${pkg_config_install_dir}" ) >- endif(pkg_config_libdir) >+if(EIGEN_INSTALL_PKGCONFIG) >+ if(NOT DEFINED EIGEN_INSTALL_PKGCONFIG_DIR) >+ >+ if(PKG_CONFIG_FOUND AND NOT DEFINED CMAKE_INSTALL_PREFIX) >+ # For a default system-wide installation, let's try with the default pc_path >+ execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} pkg-config --variable=pc_path OUTPUT_VARIABLE pc_path1) >+ string(REGEX MATCH "^([^:]*).*" pc_path2 ${pc_path1}) >+ if(CMAKE_MATCH_1) >+ set(eigen_install_pkg_config_dir1 ${CMAKE_MATCH_1}) >+ endif() >+ endif() >+ >+ if(NOT DEFINED eigen_install_pkg_config_dir1) >+ message(STATUS "searching for 'pkgconfig' directory in ${CMAKE_INSTALL_PREFIX}/lib, and ${CMAKE_INSTALL_PREFIX}/share") >+ find_path(eigen_install_pkg_config_dir2 pkgconfig ${CMAKE_INSTALL_PREFIX}/lib ${CMAKE_INSTALL_PREFIX}/share) >+ if(eigen_install_pkg_config_dir2) >+ set(eigen_install_pkg_config_dir1 "${eigen_install_pkg_config_dir2}/pkgconfig") >+ endif() >+ endif() >+ >+ if(eigen_install_pkg_config_dir1) >+ message(STATUS "found ${eigen_install_pkg_config_dir1}") >+ else() >+ set(eigen_install_pkg_config_dir1 ${CMAKE_INSTALL_PREFIX}/lib/pkgconfig) >+ endif() >+ >+ set(EIGEN_INSTALL_PKGCONFIG_DIR ${eigen_install_pkg_config_dir1} CACHE PATH "Installation path for .pc files.") >+ >+ endif(NOT DEFINED EIGEN_INSTALL_PKGCONFIG_DIR) > > configure_file(eigen3.pc.in eigen3.pc) >- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/eigen3.pc >- DESTINATION ${pkg_config_install_dir}/pkgconfig >- ) >-endif(EIGEN_BUILD_PKGCONFIG) >+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/eigen3.pc DESTINATION ${EIGEN_INSTALL_PKGCONFIG_DIR} ) >+endif(EIGEN_INSTALL_PKGCONFIG) > > add_subdirectory(Eigen) > > add_subdirectory(doc EXCLUDE_FROM_ALL) > > include(EigenConfigureTesting) > > # fixme, not sure this line is still needed:
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1072
:
606
| 607 |
608