Re: [CMake] Putting the git commit hash in a cmake variable

2018-10-10 Thread Isaiah Norton
Similar question with some suggestions in response: https://cmake.org/pipermail/cmake/2018-July/067887.html Best, Isaiah On Wed, Oct 10, 2018 at 5:05 PM Matt Schulte wrote: > Hi all, > > I'd like to set a CMake variable to the current git commit short hash. > This variable will be used as part

[CMake] Putting the git commit hash in a cmake variable

2018-10-10 Thread Matt Schulte
Hi all, I'd like to set a CMake variable to the current git commit short hash. This variable will be used as part of the version string for my project (ex: "1.0.1+git.${SHORT_HASH}"). I can get at this short hash by using execute_process and setting the resulting output to a variable. ```cmake ex

Re: [CMake] Building arguments to target_comple_definitions()

2018-10-10 Thread Rob Boehne
Chuck, I think I didn’t explain the situation well enough. Here is a sample pseudo-Cmake input fiile: add_library( FooBar SHARED ) add_library( CHUNK1 OBJECT) add_library( CHUNK2 OBJECT) set( COMMON SOME_DEFINE_1 SOME_DEFINE_2 SOME_DEFINE_3 ) if( condition ) list(APPEND COMMON “C