Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git_info in own subdirectory, documentation #218

Open
miroi opened this issue Nov 23, 2017 · 9 comments
Open

git_info in own subdirectory, documentation #218

miroi opened this issue Nov 23, 2017 · 9 comments

Comments

@miroi
Copy link
Contributor

miroi commented Nov 23, 2017

Hi Rado,

git_info module is sitting in own subdirectory, according to autocmake test,

- git_info:
  - source: ../../../modules/git_info/git_info.cmake

and this is not mentioned in documentation:
https://autocmake.readthedocs.io/en/latest/module-reference.html#git-info-cmake

@miroi
Copy link
Contributor Author

miroi commented Nov 23, 2017

Well, somehow I can not restore git_info.h generation in mathlibs_tester ....

@miroi
Copy link
Contributor Author

miroi commented Nov 23, 2017

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)

@miroi
Copy link
Contributor Author

miroi commented Nov 23, 2017

@miroi
Copy link
Contributor Author

miroi commented Nov 23, 2017

strange ... although include(autocmake_git_info) is included, it behaves as it does not exist ...

@miroi
Copy link
Contributor Author

miroi commented Nov 23, 2017

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.

@miroi miroi closed this as completed Nov 23, 2017
@bast
Copy link
Member

bast commented Nov 24, 2017

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.

@miroi
Copy link
Contributor Author

miroi commented Nov 24, 2017

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.

@bast
Copy link
Member

bast commented Nov 24, 2017

OK reopening.

@bast bast reopened this Nov 24, 2017
@miroi
Copy link
Contributor Author

miroi commented Nov 24, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants