~ctwm/ctwm/trunk

« back to all changes in this revision

Viewing changes to cmake_files/gen_source_files.cmake

  • Committer: Matthew Fuller
  • Date: 2016-04-04 06:26:38 UTC
  • Revision ID: fullermd@over-yonder.net-20160404062638-rbplil7a0zop0ccc
Generate event_names_table.h rather than event_names.c.

Originally this was so tiny it made more sense to edit on the fly than
to add another file just to hold a table.  But it pretty much
immediately wound up big enough that that's just silly.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 
23
23
# Generate up the event names lookup source
24
24
set(en_list ${CMAKE_CURRENT_SOURCE_DIR}/event_names.list)
25
 
set(en_in   ${CMAKE_CURRENT_SOURCE_DIR}/event_names.c.in)
26
 
set(en_out  ${CMAKE_CURRENT_BINARY_DIR}/event_names.c)
 
25
set(en_out  ${CMAKE_CURRENT_BINARY_DIR}/event_names_table.h)
27
26
set(en_mk   ${CMAKE_CURRENT_SOURCE_DIR}/tools/mk_event_names.sh)
28
27
add_custom_command(OUTPUT ${en_out}
29
 
        DEPENDS ${en_list} ${en_in} ${en_mk}
30
 
        COMMAND ${en_mk} ${en_list} ${en_in} > ${en_out}
 
28
        DEPENDS ${en_list} ${en_mk}
 
29
        COMMAND ${en_mk} ${en_list} > ${en_out}
31
30
)
 
31
# Have to manually add this, or cmake won't notice that it's needed in
 
32
# time to make it.
 
33
set_source_files_properties(event_names.c OBJECT_DEPENDS ${en_out})
32
34
 
33
35
 
34
36
# Setup config header file