Open miroi opened 6 years ago
Well, somehow I can not restore git_info.h generation in mathlibs_tester ....
such composed CMakeFiles... does not have target git_info ...
# project name
project(myproject Fortran C CXX)
# do not rebuild if rules (compiler flags) change
set(CMAKE_SKIP_RULE_DEPENDENCY TRUE)
# if CMAKE_BUILD_TYPE undefined, we set it to Release
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release")
endif()
# directories which hold included cmake modules
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake/custom)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake/downloaded)
# included cmake modules
include(autocmake_fc)
include(autocmake_cc)
include(autocmake_cxx)
include(autocmake_GNU.C)
include(autocmake_GNU.CXX)
include(autocmake_GNU.Fortran)
include(autocmake_Intel.C)
include(autocmake_Intel.CXX)
include(autocmake_Intel.Fortran)
include(autocmake_PGI.C)
include(autocmake_PGI.CXX)
include(autocmake_PGI.Fortran)
include(autocmake_XL.C)
include(autocmake_XL.CXX)
include(autocmake_XL.Fortran)
include(autocmake_definitions)
include(autocmake_python_interpreter)
include(autocmake_math_libs)
include(autocmake_code_coverage)
include(autocmake_profile)
include(autocmake_int64)
include(autocmake_safeguards)
include(autocmake_default_build_paths)
include(autocmake_git_info)
include(autocmake_version)
include(autocmake_src)
include(static_linking)
include(main_custom)
strange ... although include(autocmake_git_info) is included, it behaves as it does not exist ...
Found the problem, one has to include generate_git_info_header(${PROJECT_BINARY_DIR} git_info.h).
Also documentation is fine, so closing this ticket.
Good :-) Thanks for reporting. It can also mean that doc is not as clear as it could be. In this case please point me to the place which was confusingly or too sparsely formulated and we can see whether we can improve this.
Hi, please extend https://autocmake.readthedocs.io/en/latest/module-reference.html#git-info-cmake to mention the generate_git_info_header(${PROJECT_BINARY_DIR} git_info.h) macro. This has to be in user's custom cmake in order to generate the desired git_info.h file.
OK reopening.
Well, to generalize this issue: if there are other cmake files defining some important macros, this has to be mentioned in the documentation. Otherwise use forgets to use the macro, like me.
Hi Rado,
git_info module is sitting in own subdirectory, according to autocmake test,
and this is not mentioned in documentation: https://autocmake.readthedocs.io/en/latest/module-reference.html#git-info-cmake