annotate 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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
322
7233461e2f61 new sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 set(AUTOGENERATED_DIR "${CMAKE_CURRENT_BINARY_DIR}/AUTOGENERATED")
7233461e2f61 new sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 set(AUTOGENERATED_SOURCES)
7233461e2f61 new sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3
7233461e2f61 new sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 file(MAKE_DIRECTORY ${AUTOGENERATED_DIR})
7233461e2f61 new sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5 include_directories(${AUTOGENERATED_DIR})
7233461e2f61 new sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6
7233461e2f61 new sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 macro(EmbedResources)
7233461e2f61 new sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 # Convert a semicolon separated list to a whitespace separated string
7233461e2f61 new sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 set(SCRIPT_ARGUMENTS)
7233461e2f61 new sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 set(DEPENDENCIES)
7233461e2f61 new sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 set(IS_PATH_NAME false)
7233461e2f61 new sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 foreach(arg ${ARGN})
7233461e2f61 new sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 if (${IS_PATH_NAME})
7233461e2f61 new sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 list(APPEND SCRIPT_ARGUMENTS "${arg}")
7233461e2f61 new sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 list(APPEND DEPENDENCIES "${arg}")
7233461e2f61 new sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 set(IS_PATH_NAME false)
7233461e2f61 new sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 else()
7233461e2f61 new sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 list(APPEND SCRIPT_ARGUMENTS "${arg}")
7233461e2f61 new sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 set(IS_PATH_NAME true)
7233461e2f61 new sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 endif()
7233461e2f61 new sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 endforeach()
7233461e2f61 new sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22
7233461e2f61 new sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 set(TARGET_BASE "${AUTOGENERATED_DIR}/EmbeddedResources")
7233461e2f61 new sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 add_custom_command(
7233461e2f61 new sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 OUTPUT
7233461e2f61 new sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 "${TARGET_BASE}.h"
7233461e2f61 new sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 "${TARGET_BASE}.cpp"
7233461e2f61 new sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 COMMAND
7233461e2f61 new sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 python
7233461e2f61 new sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 "${ORTHANC_DIR}/Resources/EmbedResources.py"
7233461e2f61 new sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 "${AUTOGENERATED_DIR}/EmbeddedResources"
7233461e2f61 new sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 ${SCRIPT_ARGUMENTS}
7233461e2f61 new sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 DEPENDS
7233461e2f61 new sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 "${ORTHANC_DIR}/Resources/EmbedResources.py"
7233461e2f61 new sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 ${DEPENDENCIES}
7233461e2f61 new sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 )
7233461e2f61 new sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37
7233461e2f61 new sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 list(APPEND AUTOGENERATED_SOURCES
7233461e2f61 new sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 "${AUTOGENERATED_DIR}/EmbeddedResources.cpp"
7233461e2f61 new sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 )
7233461e2f61 new sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 endmacro()