-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
3259: cmake: generate version.hpp at compile time to avoid rebuilds r=fweik a=junghans Make version.hpp a proper target. This prevents CMake from rebuilding all source files when a minor change is introduced anywhere in the docs, tests, or CMakeLists.txt files. Significantly reduce the number of source files including version.hpp to limit the number of objects to rebuild when the commit or branch changes. 3263: Clean up rotation flags r=jngrad a=fweik Description of changes: - Single source of truth for the rotation flags - Turned them into enum - Appropriate type - Made `ParticleProperties::rotation` exist idependent of features Co-authored-by: Christoph Junghans <[email protected]> Co-authored-by: Kai Szuttor <[email protected]> Co-authored-by: Christoph Junghans <[email protected]> Co-authored-by: Jean-Noël Grad <[email protected]> Co-authored-by: Florian Weik <[email protected]>
- Loading branch information
Showing
12 changed files
with
82 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,35 @@ | ||
find_package(Git) | ||
|
||
if(GIT_FOUND) | ||
execute_process( | ||
COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD | ||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} | ||
OUTPUT_VARIABLE GIT_BRANCH | ||
OUTPUT_STRIP_TRAILING_WHITESPACE | ||
) | ||
if(GIT_EXECUTABLE) | ||
# Get the name of the working branch | ||
execute_process( | ||
COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD | ||
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} | ||
OUTPUT_VARIABLE GIT_BRANCH | ||
OUTPUT_STRIP_TRAILING_WHITESPACE | ||
) | ||
|
||
# Get the latest abbreviated commit hash of the working branch | ||
execute_process( | ||
COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD | ||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} | ||
OUTPUT_VARIABLE GIT_COMMIT_HASH | ||
OUTPUT_STRIP_TRAILING_WHITESPACE | ||
# Get the latest abbreviated commit hash of the working branch | ||
execute_process( | ||
COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD | ||
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} | ||
OUTPUT_VARIABLE GIT_COMMIT_HASH | ||
OUTPUT_STRIP_TRAILING_WHITESPACE | ||
) | ||
|
||
execute_process( | ||
COMMAND "${GIT_EXECUTABLE}" diff-index --quiet HEAD -- | ||
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" | ||
RESULT_VARIABLE res | ||
OUTPUT_VARIABLE out | ||
OUTPUT_STRIP_TRAILING_WHITESPACE | ||
# Get branch status | ||
execute_process( | ||
COMMAND ${GIT_EXECUTABLE} diff-index --quiet HEAD -- | ||
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} | ||
RESULT_VARIABLE GIT_DIFF_INDEX_RESULT | ||
OUTPUT_VARIABLE GIT_DIFF_INDEX_OUTPUT | ||
OUTPUT_STRIP_TRAILING_WHITESPACE | ||
) | ||
if(GIT_DIFF_INDEX_RESULT EQUAL 0) | ||
set(GIT_STATE "CLEAN") | ||
else() | ||
set(GIT_STATE "DIRTY") | ||
endif() | ||
|
||
endif(GIT_EXECUTABLE) | ||
|
||
if(res EQUAL 0) | ||
set(GIT_STATE "CLEAN") | ||
else() | ||
set(GIT_STATE "DIRTY") | ||
endif() | ||
endif() | ||
configure_file(${PROJECT_SOURCE_DIR}/src/config/version.hpp.in version.hpp.tmp) | ||
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different version.hpp.tmp version.hpp) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters