diff MySQL/CMakeLists.txt @ 155:23cf7def8e44

use of OrthancPluginsExports.cmake, avoid race conditions with EmbedResources.py
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 06 Jul 2020 12:04:00 +0200
parents 063aa53b5917
children 0f01eaf17232
line wrap: on
line diff
--- a/MySQL/CMakeLists.txt	Wed Jul 01 17:13:38 2020 +0200
+++ b/MySQL/CMakeLists.txt	Mon Jul 06 12:04:00 2020 +0200
@@ -61,6 +61,12 @@
   MYSQL_CREATE_INSTANCE        ${CMAKE_SOURCE_DIR}/Plugins/CreateInstance.sql
   )
 
+add_custom_target(
+  AutogeneratedTarget
+  DEPENDS 
+  ${AUTOGENERATED_SOURCES}
+  )
+
 add_library(OrthancMySQLIndex SHARED
   ${INDEX_RESOURCES}
   ${ORTHANC_DATABASES_ROOT}/Framework/Plugins/PluginInitialization.cpp
@@ -71,6 +77,8 @@
   ${AUTOGENERATED_SOURCES}
   )
 
+add_dependencies(OrthancMySQLIndex AutogeneratedTarget)
+
 add_library(OrthancMySQLStorage SHARED
   ${ORTHANC_DATABASES_ROOT}/Framework/Plugins/PluginInitialization.cpp
   ${STORAGE_RESOURCES}
@@ -81,6 +89,8 @@
   ${AUTOGENERATED_SOURCES}
   )
 
+add_dependencies(OrthancMySQLStorage AutogeneratedTarget)
+
 message("Setting the version of the libraries to ${ORTHANC_PLUGIN_VERSION}")
 
 add_definitions(
@@ -116,6 +126,8 @@
   ${AUTOGENERATED_SOURCES}
   )
 
+add_dependencies(UnitTests AutogeneratedTarget)
+
 target_link_libraries(UnitTests ${GOOGLE_TEST_LIBRARIES})
 set_target_properties(UnitTests PROPERTIES
   COMPILE_FLAGS -DORTHANC_ENABLE_LOGGING_PLUGIN=0