Re: [CMake] Touching files on cache var changes

2011-05-18 Thread Michael Hertling
On 05/17/2011 07:46 PM, David Cole wrote: > On Tue, May 17, 2011 at 1:30 PM, Michael Hertling wrote: > >> On 05/17/2011 05:45 PM, Robert Bielik wrote: >>> Hi all, >>> >>> I'm wondering if there's a way to touch files on cached var changes. >> Let's say I have an option to enable or disable a featu

Re: [CMake] Touching files on cache var changes

2011-05-17 Thread David Cole
On Tue, May 17, 2011 at 1:30 PM, Michael Hertling wrote: > On 05/17/2011 05:45 PM, Robert Bielik wrote: > > Hi all, > > > > I'm wondering if there's a way to touch files on cached var changes. > Let's say I have an option to enable or disable a feature > > in my application, and depending on its s

Re: [CMake] Touching files on cache var changes

2011-05-17 Thread Michael Hertling
On 05/17/2011 05:45 PM, Robert Bielik wrote: > Hi all, > > I'm wondering if there's a way to touch files on cached var changes. Let's > say I have an option to enable or disable a feature > in my application, and depending on its setting a preprocessor macro is > defined (or not defined) in the

Re: [CMake] Touching files on cache var changes

2011-05-17 Thread David Cole
I do this by making a .in file that gets configured that contains the value of the CMake variable. header.h.in: === #define FEATURE_X @FEATURE_X@ CMakeLists.txt: === configure_file(${CMAKE_CURRENT_SOURCE_DIR}/header.h.in ${CMAKE_CURRENT_BINARY_DIR}/header.h @ONLY) include_dire

[CMake] Touching files on cache var changes

2011-05-17 Thread Robert Bielik
Hi all, I'm wondering if there's a way to touch files on cached var changes. Let's say I have an option to enable or disable a feature in my application, and depending on its setting a preprocessor macro is defined (or not defined) in the CMakeLists.txt file: OPTION(FEATURE_X "Check to enable