Skip to content

Commit

Permalink
fix: generated version.h should follow project naming
Browse files Browse the repository at this point in the history
It is preferred that this file is generated with always the same name
(`version.h`) but placed in a directory that follows the project meta
info. It is now placed in a directory under include named with the
project ID in lower case. See the `CMakeLists.txt` for how the project
ID is derived from its name.
  • Loading branch information
abdes committed Sep 19, 2022
1 parent 3c5c162 commit 329bcdf
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ set(META_CMAKE_INIT_SHA "${GIT_REV}")

string(MAKE_C_IDENTIFIER ${META_PROJECT_NAME} META_PROJECT_ID)
string(TOUPPER ${META_PROJECT_ID} META_PROJECT_ID)
string(TOLOWER ${META_PROJECT_ID} META_PROJECT_ID_LOWER)

# Determine if this is built as a subproject or if it is the master project.
if(NOT DEFINED ${META_PROJECT_ID}_IS_MASTER_PROJECT)
Expand Down Expand Up @@ -123,8 +124,9 @@ include(cmake/FasterBuild.cmake)
# ------------------------------------------------------------------------------

# Generate version-header
configure_file(templates/version.h.in
${CMAKE_CURRENT_BINARY_DIR}/include/asap/asap-version.h)
configure_file(
templates/version.h.in
${CMAKE_CURRENT_BINARY_DIR}/include/${META_PROJECT_ID_LOWER}/version.h)

# Generate a clangd configuration file that points to the compilation database
# in the cmake build directory. We need to do this as the build directory is
Expand Down

0 comments on commit 329bcdf

Please sign in to comment.