MantisBT - CMake
View Issue Details
0003604CMakeCMakepublic2006-08-11 16:302016-06-10 14:30
Alex Neundorf 
Bill Hoffman 
normalfeaturealways
closedmoved 
 
 
0003604: make it possible to use cmake code in add_custom_command() and add_custom_target()
Hi,

for several things it would be easier if it would be possible to execute cmake code at build time without having to write a second cmake file and execute this using add_custom_command/target and cmake -P.

This could look like:

add_custom_target(man
CODE "
foreach(file a.txt b.txt c.txt)
  exec_program(makeman ${file} ${file}.man
endforeach(file)
")

Or
add_custom_command(OUTPUT blah.h
CODE "
FILE(WRITE blah.h "This file was generated")
")

I guess this could be implemented by generating cmake files from the given code and execute them using cmake -P at build time.
Alex
No tags attached.
Issue History
2016-06-10 14:27Kitware RobotNote Added: 0041317
2016-06-10 14:27Kitware RobotStatusassigned => resolved
2016-06-10 14:27Kitware RobotResolutionopen => moved
2016-06-10 14:30Kitware RobotStatusresolved => closed

Notes
(0041317)
Kitware Robot   
2016-06-10 14:27   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.