[CMake] cmake side effects: possible bug

Steve Johns steve.johns at verizon.net
Sun Aug 27 12:00:28 EDT 2006


Michael Bell wrote:
>> ADD_CUSTOM_TARGET(makeExecutable ALL)
>> FOREACH(file ${SCRIPTS})
>>    CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${file}
>>        ${EXECUTABLE_OUTPUT_PATH}/../${file}
>>        @ONLY)
>>    ADD_CUSTOM_COMMAND(
>>        TARGET makeExecutable
>>        POST_BUILD
>>        COMMAND chmod
>>        ARGS +x ${EXECUTABLE_OUTPUT_PATH}/../${file}
>>        )
>> ENDFOREACH(file)

Like MB, I would have assumed that the code above in CMakelists.txt in a 
subdir would operate on (only) that subdir when 'make' was invoked in that 
subdir.

Brad King wrote in reply:
> CMake now always runs globally, which makes most things MUCH easier to
> implement.  There is no longer a "local generate" capability.
>
> You can use CONFIGURE_FILE and EXECUTE_PROCESS to do this all at CMake 
> time.

Would it be possible to elaborate on the CMake processing sequence so that 
the reason why the given code doesn't produce the assumed effect can be 
clear?

IOW, I guess I'm not clear on what the summary statement "CMake now always 
runs globally" really means, and I'd like to replace my flawed assumptions 
with good facts!

This is a point of understanding for me, not a current production issue, so 
if the explanation awaits a "calm moment"  (does such exist? :^), that's 
cool by me.  (It might even make a good addition to the online docs 
somewhere ...)






More information about the CMake mailing list