diff SQLite/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 534759b0cf14
children 0f01eaf17232
line wrap: on
line diff
--- a/SQLite/CMakeLists.txt	Wed Jul 01 17:13:38 2020 +0200
+++ b/SQLite/CMakeLists.txt	Mon Jul 06 12:04:00 2020 +0200
@@ -25,6 +25,12 @@
   SQLITE_PREPARE_INDEX ${CMAKE_SOURCE_DIR}/Plugins/PrepareIndex.sql
   )
 
+add_custom_target(
+  AutogeneratedTarget
+  DEPENDS 
+  ${AUTOGENERATED_SOURCES}
+  )
+
 add_library(OrthancSQLiteIndex SHARED
   ${ORTHANC_DATABASES_ROOT}/Framework/Plugins/PluginInitialization.cpp
   Plugins/IndexPlugin.cpp
@@ -34,6 +40,8 @@
   ${AUTOGENERATED_SOURCES}
   )
 
+add_dependencies(OrthancSQLiteIndex AutogeneratedTarget)
+
 message("Setting the version of the libraries to ${ORTHANC_PLUGIN_VERSION}")
 
 add_definitions(
@@ -66,6 +74,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