diff CMakeLists.txt @ 17:3848f5b1d993

integration 1.0->mainline
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 01 Apr 2020 10:43:36 +0200
parents c4c3590e2024 777b677cc9fc
children 67f48fc2fd69
line wrap: on
line diff
--- a/CMakeLists.txt	Wed Apr 01 10:22:23 2020 +0200
+++ b/CMakeLists.txt	Wed Apr 01 10:43:36 2020 +0200
@@ -14,6 +14,7 @@
 include(CheckIncludeFileCXX)
 include(CheckIncludeFiles)
 include(CheckLibraryExists)
+include(FindPythonInterp)
 
 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
   set(PYTHON_INCLUDE_DIRS ${PYTHON_WINDOWS_ROOT}/include)
@@ -39,6 +40,25 @@
 include(${ORTHANC_ROOT}/Resources/CMake/BoostConfiguration.cmake)
 include(${ORTHANC_ROOT}/Resources/CMake/JsonCppConfiguration.cmake)
 
+
+if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
+  execute_process(
+    COMMAND 
+    ${PYTHON_EXECUTABLE} ${ORTHANC_ROOT}/Resources/WindowsResources.py
+    ${PLUGIN_VERSION} "Python plugin" OrthancPython.dll
+    "Plugin to create Orthanc plugins using Python"
+    ERROR_VARIABLE Failure
+    OUTPUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/Version.rc
+    )
+
+  if (Failure)
+    message(FATAL_ERROR "Error while computing the version information: ${Failure}")
+  endif()
+
+  set(WINDOWS_RESOURCES ${CMAKE_CURRENT_BINARY_DIR}/Version.rc)
+endif()
+
+
 include_directories(
   ${ORTHANC_ROOT}/Sdk-1.5.7
   )
@@ -56,6 +76,7 @@
   ${BOOST_SOURCES}
   ${JSONCPP_SOURCES}
   ${ORTHANC_ROOT}/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp
+  ${WINDOWS_RESOURCES}
   Sources/Autogenerated/sdk.cpp
   Sources/OnChangeCallback.cpp
   Sources/OnStoredInstanceCallback.cpp