Mercurial > hg > orthanc
annotate Resources/CMake/AutoGeneratedCode.cmake @ 870:f4f5ab513157 jpeg
fix static builds
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 11 Jun 2014 09:13:22 +0200 |
parents | 4d7469f72a0b |
children | a87d3288bd39 |
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 | |
29 python | |
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() |