changeset 5259:0d1704d8cc65

trying to fix precompiled headers
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 12 Apr 2023 13:32:08 +0200
parents 0b183bb77c83
children dd9443ac2dbf
files OrthancServer/CMakeLists.txt
diffstat 1 files changed, 21 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancServer/CMakeLists.txt	Wed Apr 12 11:54:08 2023 +0200
+++ b/OrthancServer/CMakeLists.txt	Wed Apr 12 13:32:08 2023 +0200
@@ -338,8 +338,6 @@
 # headers might get broken!
 
 if (MSVC)
-  add_definitions(-DORTHANC_USE_PRECOMPILED_HEADERS=1)
-
   set(TMP
     ${ORTHANC_CORE_SOURCES_INTERNAL}
     ${ORTHANC_DICOM_SOURCES_INTERNAL}
@@ -379,6 +377,13 @@
   ${AUTOGENERATED_SOURCES}
   )
 
+if (MSVC)
+  set_target_properties(
+    CoreLibrary
+    PROPERTIES COMPILE_DEFINITIONS "ORTHANC_USE_PRECOMPILED_HEADERS=1"
+    )
+endif()
+
 add_dependencies(CoreLibrary AutogeneratedTarget)
 
 if (LIBICU_LIBRARIES)
@@ -420,6 +425,13 @@
   ${ORTHANC_SERVER_SOURCES}
   )
 
+if (MSVC)
+  set_target_properties(
+    ServerLibrary
+    PROPERTIES COMPILE_DEFINITIONS "ORTHANC_USE_PRECOMPILED_HEADERS=1"
+    )
+endif()
+
 # Ensure autogenerated code is built before building ServerLibrary
 add_dependencies(ServerLibrary CoreLibrary OrthancDatabaseProtobuf)
 
@@ -458,6 +470,13 @@
   ${BOOST_EXTENDED_SOURCES}
   )
 
+if (MSVC)
+  set_target_properties(
+    UnitTests
+    PROPERTIES COMPILE_DEFINITIONS "ORTHANC_USE_PRECOMPILED_HEADERS=1"
+    )
+endif()
+
 target_link_libraries(UnitTests
   ServerLibrary
   CoreLibrary