diff --git a/Installation/cmake/modules/CGAL_SCM.cmake b/Installation/cmake/modules/CGAL_SCM.cmake index e7a8bdeaa52..2ef29af82f6 100644 --- a/Installation/cmake/modules/CGAL_SCM.cmake +++ b/Installation/cmake/modules/CGAL_SCM.cmake @@ -2,27 +2,30 @@ if( NOT CGAL_SCM_FILE_INCLUDED ) set(CGAL_SCM_FILE_INCLUDED 1 ) +#message ("-----CSD: ${CMAKE_SOURCE_DIR}") + set(GIT_PARENT_DIR "${CMAKE_SOURCE_DIR}") set(GIT_DIR "${GIT_PARENT_DIR}/.git") while(NOT EXISTS "${GIT_DIR}") # .git dir not found, search parent directories set(GIT_PREVIOUS_PARENT "${GIT_PARENT_DIR}") get_filename_component(GIT_PARENT_DIR ${GIT_PARENT_DIR} PATH) - if(GIT_PARENT_DIR STREQUAL GIT_PREVIOUS_PARENT) + #message ("-----GPD1: ${GIT_PARENT_DIR}") + #message ("-----PPD1: ${GIT_PREVIOUS_PARENT}") + if( "${GIT_PARENT_DIR}" STREQUAL "${GIT_PREVIOUS_PARENT}" ) # We have reached the root directory, we are not in git - set(${_refspecvar} "GITDIR-NOTFOUND" PARENT_SCOPE) - set(${_hashvar} "GITDIR-NOTFOUND" PARENT_SCOPE) + set(_refspecvar "GITDIR-NOTFOUND") + set(_hashvar "GITDIR-NOTFOUND") + set ( CGAL_SCM_NAME "" ) + break() else() - set(GIT_DIR "${GIT_PARENT_DIR}/.git") + set( GIT_DIR "${GIT_PARENT_DIR}/.git" ) + set( CGAL_SCM_NAME "git" ) endif() - endwhile() +endwhile() -if ( NOT "${_refspecvar}" STREQUAL "GITDIR-NOTFOUND" ) - set ( CGAL_SCM_NAME "git" ) -endif() -#message ("GPD: ${GIT_PARENT_DIR}") - -if ( ${CGAL_SCM_NAME} STREQUAL "git" ) +if ( "${CGAL_SCM_NAME}" STREQUAL "git" ) + #message ("====GPD: ${GIT_PARENT_DIR}") find_program(GIT_EXECUTABLE git DOC "git command line client") EXECUTE_PROCESS(COMMAND ${GIT_EXECUTABLE} --git-dir=${GIT_PARENT_DIR}/.git symbolic-ref HEAD diff --git a/Installation/cmake/modules/UseCGAL.cmake b/Installation/cmake/modules/UseCGAL.cmake index ea83979f2a1..cdddaef0937 100644 --- a/Installation/cmake/modules/UseCGAL.cmake +++ b/Installation/cmake/modules/UseCGAL.cmake @@ -20,13 +20,15 @@ if(NOT USE_CGAL_FILE_INCLUDED) include(CGAL_TweakFindBoost) set(CGAL_INSTALLED_SCM_BRANCH_NAME ${CGAL_SCM_BRANCH_NAME}) + set(CGAL_SCM_BRANCH_NAME "") if( NOT "${CGAL_INSTALLED_SCM_BRANCH_NAME}" STREQUAL "" ) include(CGAL_SCM) - message ( STATUS "Code taken from Git branch: ${CGAL_SCM_BRANCH_NAME}") - if ( NOT "${CGAL_SCM_BRANCH_NAME}" STREQUAL "" AND - NOT "${CGAL_SCM_BRANCH_NAME}" STREQUAL "${CGAL_INSTALLED_SCM_BRANCH_NAME}") - message (AUTHOR_WARNING "Branch '${CGAL_SCM_BRANCH_NAME}' does not match branch '${CGAL_INSTALLED_SCM_BRANCH_NAME}' from which CGAL has been installed. Please consider to rebuild CGAL from this branch.") + if ( NOT "${CGAL_SCM_BRANCH_NAME}" STREQUAL "" ) + message ( STATUS "Code taken from Git branch: ${CGAL_SCM_BRANCH_NAME}") + if ( NOT "${CGAL_SCM_BRANCH_NAME}" STREQUAL "${CGAL_INSTALLED_SCM_BRANCH_NAME}") + message (AUTHOR_WARNING "Branch '${CGAL_SCM_BRANCH_NAME}' does not match branch '${CGAL_INSTALLED_SCM_BRANCH_NAME}' from which CGAL has been installed. Please consider to rebuild CGAL from this branch.") + endif() endif() endif()