diff --git a/tribits/ReleaseNotes.txt b/tribits/ReleaseNotes.txt index 683899d4f..86e4ad4f1 100644 --- a/tribits/ReleaseNotes.txt +++ b/tribits/ReleaseNotes.txt @@ -4,6 +4,10 @@ Release Notes for TriBITS 2021/11/18: +(*) MAJOR: The default _GENERATE_REPO_VERSION_FILE_DEFAULT will be + overridden to OFF if the 'git' executable cannot be found at configure + time. See updated TriBITS Developer's Guilde documenation. + (*) MAJOR: The default value for _ENABLE_Fortran is set to OFF on WIN32 systems. (Getting a Fortran compiler for native Windows is not typically very easy.) diff --git a/tribits/core/package_arch/TribitsGlobalMacros.cmake b/tribits/core/package_arch/TribitsGlobalMacros.cmake index 34e0bdfef..5ae79c5fc 100644 --- a/tribits/core/package_arch/TribitsGlobalMacros.cmake +++ b/tribits/core/package_arch/TribitsGlobalMacros.cmake @@ -653,7 +653,9 @@ macro(tribits_define_global_options_and_define_extra_repos) ) tribits_get_invalid_categories(${PROJECT_NAME}_TEST_CATEGORIES) - if ("${${PROJECT_NAME}_GENERATE_REPO_VERSION_FILE_DEFAULT}" STREQUAL "" ) + if (NOT GIT_EXECUTABLE) + set(${PROJECT_NAME}_GENERATE_REPO_VERSION_FILE_DEFAULT OFF) + elseif ("${${PROJECT_NAME}_GENERATE_REPO_VERSION_FILE_DEFAULT}" STREQUAL "" ) set(${PROJECT_NAME}_GENERATE_REPO_VERSION_FILE_DEFAULT OFF) endif() advanced_set( @@ -1391,6 +1393,7 @@ function(tribits_generate_repo_version_output_and_file_and_install) # A) Create the ${PROJECT_NAME}RepoVersion.txt file if requested # + print_var(${PROJECT_NAME}_GENERATE_REPO_VERSION_FILE) if (${PROJECT_NAME}_GENERATE_REPO_VERSION_FILE) # A) Make sure that there is a .git dir in the project before generating diff --git a/tribits/doc/guides/TribitsCoreDetailedReference.rst b/tribits/doc/guides/TribitsCoreDetailedReference.rst index 45feeb1e9..38d58b419 100644 --- a/tribits/doc/guides/TribitsCoreDetailedReference.rst +++ b/tribits/doc/guides/TribitsCoreDetailedReference.rst @@ -483,6 +483,12 @@ These options are described below. set(${PROJECT_NAME}_GENERATE_REPO_VERSION_FILE_DEFAULT ON) in the `/ProjectName.cmake`_ file. + + Note that if a ``git`` exectauble cannot be found at configure time, then + the default ``${PROJECT_NAME}_GENERATE_REPO_VERSION_FILE_DEFAULT`` will be + overridden to ``OFF``. But if the user sets + ``${PROJECT_NAME}_GENERATE_REPO_VERSION_FILE=ON`` in the cache and ``git`` + can't be found, then an configure-time error will occur. .. _${PROJECT_NAME}_INSTALL_LIBRARIES_AND_HEADERS: