Mercurial > hg > orthanc
view Resources/CMake/AutoGeneratedCode.cmake @ 263:3b3525dee661 Orthanc-0.3.1
fix build
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Sun, 09 Dec 2012 15:01:00 +0100 |
parents | 3959d33612cc |
children | 4d7469f72a0b |
line wrap: on
line source
set(AUTOGENERATED_DIR "${CMAKE_CURRENT_BINARY_DIR}/AUTOGENERATED") set(AUTOGENERATED_SOURCES) file(MAKE_DIRECTORY ${AUTOGENERATED_DIR}) include_directories(${AUTOGENERATED_DIR}) macro(EmbedResources) # Convert a semicolon separated list to a whitespace separated string set(SCRIPT_ARGUMENTS) set(DEPENDENCIES) set(IS_PATH_NAME false) foreach(arg ${ARGN}) if (${IS_PATH_NAME}) list(APPEND SCRIPT_ARGUMENTS "${CMAKE_CURRENT_SOURCE_DIR}/${arg}") list(APPEND DEPENDENCIES "${CMAKE_CURRENT_SOURCE_DIR}/${arg}") set(IS_PATH_NAME false) else() list(APPEND SCRIPT_ARGUMENTS "${arg}") set(IS_PATH_NAME true) endif() endforeach() set(TARGET_BASE "${AUTOGENERATED_DIR}/EmbeddedResources") add_custom_command( OUTPUT "${TARGET_BASE}.h" "${TARGET_BASE}.cpp" COMMAND python "${CMAKE_CURRENT_SOURCE_DIR}/Resources/EmbedResources.py" "${AUTOGENERATED_DIR}/EmbeddedResources" ${SCRIPT_ARGUMENTS} DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/Resources/EmbedResources.py" ${DEPENDENCIES} ) list(APPEND AUTOGENERATED_SOURCES "${AUTOGENERATED_DIR}/EmbeddedResources.cpp" ) endmacro()