From 09b4dc82b4e7a2fc36cf40c2391b0909a40729bc Mon Sep 17 00:00:00 2001 From: Evgeniy Fominov Date: Mon, 1 May 2017 18:31:36 +0300 Subject: [PATCH] Multiarch installation fix (#567) * fix multiarch install * fix include dir * cleaned up stuff and removed things we don't need anymore --- dlib/CMakeLists.txt | 1 - dlib/cmake_utils/dlibConfig.cmake.in | 18 ++++++------------ 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/dlib/CMakeLists.txt b/dlib/CMakeLists.txt index 0941faf6b..44e9c559f 100644 --- a/dlib/CMakeLists.txt +++ b/dlib/CMakeLists.txt @@ -749,7 +749,6 @@ if (NOT TARGET dlib) NAMESPACE dlib:: DESTINATION ${ConfigPackageLocation}) - set(CONF_INSTALL_PATH "\${dlib_CMAKE_DIR}/../../../") configure_file(cmake_utils/dlibConfig.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/config/dlibConfig.cmake" @ONLY) include(CMakePackageConfigHelpers) diff --git a/dlib/cmake_utils/dlibConfig.cmake.in b/dlib/cmake_utils/dlibConfig.cmake.in index cd722a5a8..378ee2a61 100644 --- a/dlib/cmake_utils/dlibConfig.cmake.in +++ b/dlib/cmake_utils/dlibConfig.cmake.in @@ -19,24 +19,18 @@ # =================================================================================== -# Compute paths -get_filename_component(dlib_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) -if(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} VERSION_LESS 2.8) - get_filename_component(dlib_INSTALL_PATH "@CONF_INSTALL_PATH@" ABSOLUTE) -else() - get_filename_component(dlib_INSTALL_PATH "@CONF_INSTALL_PATH@" REALPATH) -endif() - -set(dlib_INCLUDE_DIRS "${dlib_INSTALL_PATH}/include" "@dlib_needed_includes@") # Our library dependencies (contains definitions for IMPORTED targets) if(NOT TARGET dlib-shared AND NOT dlib_BINARY_DIR) - include("${dlib_CMAKE_DIR}/dlib.cmake") + # Compute paths + get_filename_component(dlib_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) + include("${dlib_CMAKE_DIR}/dlib.cmake") endif() -find_library(dlib_LIBRARIES dlib HINTS ${dlib_INSTALL_PATH}/lib) +find_library(dlib_LIBRARIES dlib HINTS "@CMAKE_INSTALL_FULL_LIBDIR@") set(dlib_LIBRARIES ${dlib_LIBRARIES} "@dlib_needed_libraries@") set(dlib_LIBS ${dlib_LIBRARIES} "@dlib_needed_libraries@") +set(dlib_INCLUDE_DIRS "@CMAKE_INSTALL_FULL_INCLUDEDIR@" "@dlib_needed_includes@") -include(${dlib_INSTALL_PATH}/include/dlib/cmake_utils/use_cpp_11.cmake) +include(@CMAKE_INSTALL_FULL_INCLUDEDIR@/dlib/cmake_utils/use_cpp_11.cmake)