comparison Resources/Samples/RestApiLinuxDynamic/AutoGeneratedCode.cmake @ 329:f579d50fdf8f

rename
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 08 Jan 2013 14:56:10 +0100
parents Resources/Samples/RestApiStandalone/AutoGeneratedCode.cmake@7233461e2f61
children
comparison
equal deleted inserted replaced
328:25514c48e30e 329:f579d50fdf8f
1 set(AUTOGENERATED_DIR "${CMAKE_CURRENT_BINARY_DIR}/AUTOGENERATED")
2 set(AUTOGENERATED_SOURCES)
3
4 file(MAKE_DIRECTORY ${AUTOGENERATED_DIR})
5 include_directories(${AUTOGENERATED_DIR})
6
7 macro(EmbedResources)
8 # Convert a semicolon separated list to a whitespace separated string
9 set(SCRIPT_ARGUMENTS)
10 set(DEPENDENCIES)
11 set(IS_PATH_NAME false)
12 foreach(arg ${ARGN})
13 if (${IS_PATH_NAME})
14 list(APPEND SCRIPT_ARGUMENTS "${arg}")
15 list(APPEND DEPENDENCIES "${arg}")
16 set(IS_PATH_NAME false)
17 else()
18 list(APPEND SCRIPT_ARGUMENTS "${arg}")
19 set(IS_PATH_NAME true)
20 endif()
21 endforeach()
22
23 set(TARGET_BASE "${AUTOGENERATED_DIR}/EmbeddedResources")
24 add_custom_command(
25 OUTPUT
26 "${TARGET_BASE}.h"
27 "${TARGET_BASE}.cpp"
28 COMMAND
29 python
30 "${ORTHANC_DIR}/Resources/EmbedResources.py"
31 "${AUTOGENERATED_DIR}/EmbeddedResources"
32 ${SCRIPT_ARGUMENTS}
33 DEPENDS
34 "${ORTHANC_DIR}/Resources/EmbedResources.py"
35 ${DEPENDENCIES}
36 )
37
38 list(APPEND AUTOGENERATED_SOURCES
39 "${AUTOGENERATED_DIR}/EmbeddedResources.cpp"
40 )
41 endmacro()