User:Argonel/mocGenerated

Revision as of 00:14, 21 April 2013 by Argonel (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
include_directories(${CMAKE_CURRENT_BINARY_DIR})
 
set (converter_SCRIPT /path/to/script)
set (generated inputfile)
 
add_custom_command(
    OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${generated}.cpp ${CMAKE_CURRENT_BINARY_DIR}/${generated}.h
    COMMAND python ${converter_SCRIPT} ${converter_SCRIPT_ARGS}
    DEPENDS ${converter_SCRIPT}
)
 
set (generated_SRCS ${CMAKE_CURRENT_BINARY_DIR}/${generated}.cpp ${CMAKE_CURRENT_BINARY_DIR}/${generated}.h ${CMAKE_CURRENT_BINARY_DIR}/moc_${generated}.cpp)
set (app_SRCS ${other_SRCS} ${generated_SRCS})
 
QT4_GENERATE_MOC(${CMAKE_CURRENT_BINARY_DIR}/${generated}.h ${CMAKE_CURRENT_BINARY_DIR}/moc_${generated}.cpp)
 
kde4_add_executable(appname ${app_SRCS})

The dependency on ${converter_SCRIPT} let me edit the script and have make regenerate the output.


This page was last modified on 21 April 2013, at 00:14. This page has been accessed 133 times. Content is available under Creative Commons License SA 3.0 as well as the GNU Free Documentation License 1.2.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V.Legal