Improve command line parsing, adapt to Eyescale/CMake#533#115
Merged
rdumusc merged 1 commit intoBlueBrain:masterfrom Jan 26, 2017
Merged
Improve command line parsing, adapt to Eyescale/CMake#533#115rdumusc merged 1 commit intoBlueBrain:masterfrom
rdumusc merged 1 commit intoBlueBrain:masterfrom
Conversation
Author
|
retest this please |
dnachbaur
approved these changes
Jan 25, 2017
|
|
||
| set(_tide_in ${CMAKE_CURRENT_SOURCE_DIR}/tide) | ||
| set(_tide_out ${PROJECT_BINARY_DIR}/bin/tide) | ||
| add_custom_command( |
Contributor
There was a problem hiding this comment.
why not configure_file(@only)? This way it should run only if _tide_in has changed
Author
There was a problem hiding this comment.
Good question, I had to investigate more to understand:
- configure_file(COPYONLY) is executed during CMake configure step, which means that CMake has to be re-run if the file has changed.
- also, if one does "rm bin/tide", then "ninja tide" doesn't know how to recreate the missing dependency (ninja: error: 'bin/tide', needed by 'apps/CMakeFiles/tide', missing and no known rule to make it).
- with the custom_command aproach the file is correctly recreated if it is missing, and it is also copied only if it has changed (I checked the exact modification dates).
However, my code was missing "DEPENDS ${_tide_in}" in add_custom_command(), so it did not copy the file again if _tide_in was changed. Now everything works as expected.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.