diff --git a/Installation/lib/cmake/CGAL/CGALConfig.cmake b/Installation/lib/cmake/CGAL/CGALConfig.cmake index 486f1ff6746..ad0de1806ca 100644 --- a/Installation/lib/cmake/CGAL/CGALConfig.cmake +++ b/Installation/lib/cmake/CGAL/CGALConfig.cmake @@ -26,7 +26,11 @@ endfunction() cgal_detect_branch_build(BRANCH_BUILD) if(BRANCH_BUILD) - set(CGAL_ROOT ${CGAL_CONFIG_DIR}/../../../..) + set(CGAL_ROOT ${CGAL_CONFIG_DIR}) + get_filename_component(CGAL_ROOT "${CGAL_ROOT}" DIRECTORY) + get_filename_component(CGAL_ROOT "${CGAL_ROOT}" DIRECTORY) + get_filename_component(CGAL_ROOT "${CGAL_ROOT}" DIRECTORY) + get_filename_component(CGAL_ROOT "${CGAL_ROOT}" DIRECTORY) set(CGAL_INSTALLATION_PACKAGE_DIR ${CGAL_ROOT}/Installation) set(CGAL_GRAPHICSVIEW_PACKAGE_DIR ${CGAL_ROOT}/GraphicsView) set(CGAL_MODULES_DIR ${CGAL_ROOT}/Installation/cmake/modules) @@ -43,7 +47,10 @@ if(BRANCH_BUILD) endif() endforeach() else() - set(CGAL_ROOT ${CGAL_CONFIG_DIR}/../../..) + set(CGAL_ROOT ${CGAL_CONFIG_DIR}) + get_filename_component(CGAL_ROOT "${CGAL_ROOT}" DIRECTORY) + get_filename_component(CGAL_ROOT "${CGAL_ROOT}" DIRECTORY) + get_filename_component(CGAL_ROOT "${CGAL_ROOT}" DIRECTORY) # not BRANCH_BUILD: it can be an installed CGAL, or the tarball layout if(EXISTS ${CGAL_CONFIG_DIR}/CGAL_add_test.cmake)