Mercurial > hg > orthanc-webviewer
changeset 50:2578545f8d87
sync
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 30 Jul 2015 15:16:34 +0200 |
parents | c06f1c00ce56 |
children | 7b4b8b82112e |
files | Orthanc/Resources/CMake/AutoGeneratedCode.cmake Orthanc/Resources/WindowsResources.py Resources/BuildInstructions.txt |
diffstat | 3 files changed, 23 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/Orthanc/Resources/CMake/AutoGeneratedCode.cmake Thu Jul 30 14:50:49 2015 +0200 +++ b/Orthanc/Resources/CMake/AutoGeneratedCode.cmake Thu Jul 30 15:16:34 2015 +0200 @@ -6,17 +6,28 @@ macro(EmbedResources) # Convert a semicolon separated list to a whitespace separated string + set(SCRIPT_OPTIONS) set(SCRIPT_ARGUMENTS) set(DEPENDENCIES) set(IS_PATH_NAME false) + + # Loop over the arguments of the function foreach(arg ${ARGN}) - if (${IS_PATH_NAME}) - list(APPEND SCRIPT_ARGUMENTS "${arg}") - list(APPEND DEPENDENCIES "${arg}") - set(IS_PATH_NAME false) + # Extract the first character of the argument + string(SUBSTRING "${arg}" 0 1 FIRST_CHAR) + if (${FIRST_CHAR} STREQUAL "-") + # If the argument starts with a dash "-", this is an option to + # EmbedResources.py + list(APPEND SCRIPT_OPTIONS ${arg}) else() - list(APPEND SCRIPT_ARGUMENTS "${arg}") - set(IS_PATH_NAME true) + if (${IS_PATH_NAME}) + list(APPEND SCRIPT_ARGUMENTS "${arg}") + list(APPEND DEPENDENCIES "${arg}") + set(IS_PATH_NAME false) + else() + list(APPEND SCRIPT_ARGUMENTS "${arg}") + set(IS_PATH_NAME true) + endif() endif() endforeach() @@ -28,6 +39,7 @@ COMMAND ${PYTHON_EXECUTABLE} "${ORTHANC_ROOT}/Resources/EmbedResources.py" + ${SCRIPT_OPTIONS} "${AUTOGENERATED_DIR}/EmbeddedResources" ${SCRIPT_ARGUMENTS} DEPENDS
--- a/Orthanc/Resources/WindowsResources.py Thu Jul 30 14:50:49 2015 +0200 +++ b/Orthanc/Resources/WindowsResources.py Thu Jul 30 15:16:34 2015 +0200 @@ -53,10 +53,13 @@ RELEASE = 'Release %s' % VERSION v = VERSION.split('.') -if len(v) != 3: +if len(v) != 2 and len(v) != 3: sys.stderr.write('Bad version number: %s\n' % VERSION) sys.exit(-1) +if len(v) == 2: + v.append('0') + extension = os.path.splitext(FILENAME)[1] if extension.lower() == '.dll': BLOCK = '040904E4'
--- a/Resources/BuildInstructions.txt Thu Jul 30 14:50:49 2015 +0200 +++ b/Resources/BuildInstructions.txt Thu Jul 30 15:16:34 2015 +0200 @@ -25,5 +25,5 @@ # mkdir Build # cd Build -# cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=../Orthanc/Resources/MinGWToolchain.cmake +# cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=`pwd`/../Orthanc/Resources/MinGWToolchain.cmake # make