qi_generate_src(out [SRC <src> ...]
[COMMAND <command> ...]
COMMENT
)
Arguments: |
|
---|
Generate a source file
Example of use:
set(_input ${CMAKE_CURRENT_SOURCE_DIR}/input.data)
set(_output ${CMAKE_CURRENT_BINARY_DIR}/generated.c)
qi_generate_src(${_output} SRC ${_input} COMMAND my_script ${_input} -o ${_output})
qi_create_bin(my_bin ${_output} main.c)
Note that the base dir of the output will automatically be created, so you do not have to worry about it in your script.
Also note that you should consider adding an explicit dependency to the command that generates the sources, using the DEPENDS argument:
For instance, when using a Python script:
qi_generate_src(...
COMMAND ${PYTHON2_EXECUTABLE} myscript.py ...
DEPENDS myscript.py
)
Or when using a target:
find_package(FOO REQUIRED)
qi_generate_src(...
COMMAND ${FOO_EXECUTABLE} myscript.py ...
DEPENDS ${FOO_EXECUTABLE}
)
qi_generate_header(out [SRC <src> ...]
[COMMAND <command> ...]
COMMENT
)
Arguments: |
|
---|
Generate a header
Example of use:
set(_input ${CMAKE_CURRENT_SOURCE_DIR}/input.data)
set(_generated_h ${CMAKE_CURRENT_BINARY_DIR}/generated.h)
qi_generate_header(${_generated_h} SRC ${_input}
COMMAND my_script ${_input} -o ${_generated_h})
qi_create_bin(foo ${_generated_h} main.c)
qi_install_header(${_generated_h})
qi_generate_trampoline(out in [List <list> ...]
[PYTHON]
)
Arguments: |
|
---|
Generate a trampoline script in stage binary dir that bounces to an other script in source dir
To be used if your script needs to run from src dir, and access some built libraries or other components.