mirror of https://github.com/CGAL/cgal
Fix the detection of CGAL_ROOT
On Debian, CMake files are in `/usr/local/lib/x86_64-linux-gnu/cmake/CGAL/` are our previous heuristic fails.
This commit is contained in:
parent
5be38d3af0
commit
08a42cf35b
|
|
@ -928,7 +928,10 @@ if(NOT CGAL_HEADER_ONLY)
|
|||
${CMAKE_BINARY_DIR}/config/CGALConfig.cmake
|
||||
DESTINATION ${CGAL_INSTALL_CMAKE_DIR} )
|
||||
else()
|
||||
configure_file(${CMAKE_CURRENT_LIST_DIR}/lib/cmake/CGAL/CGALConfig-installation-dirs.cmake.in
|
||||
${CMAKE_BINARY_DIR}/config/CGALConfig-installation-dirs.cmake)
|
||||
install(FILES
|
||||
${CMAKE_BINARY_DIR}/config/CGALConfig-installation-dirs.cmake
|
||||
${CMAKE_CURRENT_LIST_DIR}/lib/cmake/CGAL/CGALConfig.cmake
|
||||
DESTINATION ${CGAL_INSTALL_CMAKE_DIR} )
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
set(CGAL_ROOT @CMAKE_INSTALL_PREFIX@)
|
||||
|
|
@ -43,6 +43,8 @@ if(BRANCH_BUILD)
|
|||
endif()
|
||||
endforeach()
|
||||
else()
|
||||
include(${CGAL_CONFIG_DIR}/CGALConfig-installation-dirs.cmake OPTIONAL RESULT_VARIABLE _has_installation_dirs)
|
||||
if(NOT _has_installation_dirs)
|
||||
set(CGAL_ROOT ${CGAL_CONFIG_DIR})
|
||||
get_filename_component(CGAL_ROOT "${CGAL_ROOT}" DIRECTORY)
|
||||
if(NOT EXISTS ${CGAL_ROOT}/include/CGAL/config.h)
|
||||
|
|
@ -51,7 +53,7 @@ else()
|
|||
if(NOT EXISTS ${CGAL_ROOT}/include/CGAL/config.h)
|
||||
get_filename_component(CGAL_ROOT "${CGAL_ROOT}" DIRECTORY)
|
||||
endif()
|
||||
|
||||
endif()
|
||||
# not BRANCH_BUILD: it can be an installed CGAL, or the tarball layout
|
||||
if(EXISTS ${CGAL_CONFIG_DIR}/CGAL_add_test.cmake)
|
||||
# installed CGAL
|
||||
|
|
|
|||
Loading…
Reference in New Issue