Mercurial > hg > orthanc
annotate Resources/CMake/AutoGeneratedCode.cmake @ 1367:fe6e5a9f1ea2 query-retrieve
SharedArchive
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 22 May 2015 17:40:10 +0200 |
parents | a87d3288bd39 |
children | efc448de0899 |
rev | line source |
---|---|
0 | 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}) | |
291
4d7469f72a0b
embedding of dicom dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
14 list(APPEND SCRIPT_ARGUMENTS "${arg}") |
4d7469f72a0b
embedding of dicom dictionaries
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
15 list(APPEND DEPENDENCIES "${arg}") |
0 | 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 | |
1339
a87d3288bd39
autodetect python binary
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
291
diff
changeset
|
29 ${PYTHON_EXECUTABLE} |
0 | 30 "${CMAKE_CURRENT_SOURCE_DIR}/Resources/EmbedResources.py" |
31 "${AUTOGENERATED_DIR}/EmbeddedResources" | |
32 ${SCRIPT_ARGUMENTS} | |
33 DEPENDS | |
34 "${CMAKE_CURRENT_SOURCE_DIR}/Resources/EmbedResources.py" | |
35 ${DEPENDENCIES} | |
36 ) | |
37 | |
38 list(APPEND AUTOGENERATED_SOURCES | |
39 "${AUTOGENERATED_DIR}/EmbeddedResources.cpp" | |
40 ) | |
41 endmacro() |