Skip to content

Commit

Permalink
Override <Project>_GENERATE_REPO_VERSION_FILE_DEFAULT=OFF if no git (T…
Browse files Browse the repository at this point in the history
…riBITSPub#299)

On my native Windows build env I don't have git installed.
  • Loading branch information
bartlettroscoe committed Nov 18, 2021
1 parent 246296b commit 1241168
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
4 changes: 4 additions & 0 deletions tribits/ReleaseNotes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ Release Notes for TriBITS

2021/11/18:

(*) MAJOR: The default <Project>_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 <Project>_ENABLE_Fortran is set to OFF on
WIN32 systems. (Getting a Fortran compiler for native Windows is not
typically very easy.)
Expand Down
5 changes: 4 additions & 1 deletion tribits/core/package_arch/TribitsGlobalMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions tribits/doc/guides/TribitsCoreDetailedReference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,12 @@ These options are described below.
set(${PROJECT_NAME}_GENERATE_REPO_VERSION_FILE_DEFAULT ON)

in the `<projectDir>/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:

Expand Down

0 comments on commit 1241168

Please sign in to comment.