[CMake] Generating Source Files

Jeremy Cowgar jeremy at cowgar.com
Wed Apr 8 17:01:12 EDT 2009


Bill Hoffman wrote:
> The file that is produced by the execute_process needs to be the one 
> that is included by cmake.   The idea was:
>
> if( file.cmake does not exist or it is older than eu core files)
>    generate file.cmake
>
> include(file.cmake)

Bill, the problem is this section:

SET( EU_CORE_UPDATE 0 )
FOREACH( file ${EU_CORE_FILES} )
  MESSAGE( "Checking ${file}" )
  IF( "${CMAKE_SOURCE_DIR}/source/${file}" IS_NEWER_THAN 
"${INT_BUILD_DIR}/int.cmake" )
    SET( EU_CORE_UPDATE 1 )
  ENDIF()
ENDFOREACH()


I added in a MESSAGE call. When I run cmake . then I get the message 
output and it does the right thing, if ${file} is newer than the 
int.cmake file, then everything is regenerated. However, now I move into 
my development cycle, I edit some code and then in my build directory type:

C:\Develop\Euphoria\build > wmake

When I issue that command, the MESSAGE( "Checking ..." ) is never 
displayed, and the code is never regenerated. I have to manually call 
cmake . and then things are regenerated as expected.

Jeremy



More information about the CMake mailing list