Mercurial > hg > orthanc
comparison OrthancServer/CMakeLists.txt @ 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 |
comparison
equal
deleted
inserted
replaced
5257:0b183bb77c83 | 5259:0d1704d8cc65 |
---|---|
336 # WARNING: There must be NO MORE "add_definitions()", "include()" or | 336 # WARNING: There must be NO MORE "add_definitions()", "include()" or |
337 # "include_directories()" below, otherwise the generated precompiled | 337 # "include_directories()" below, otherwise the generated precompiled |
338 # headers might get broken! | 338 # headers might get broken! |
339 | 339 |
340 if (MSVC) | 340 if (MSVC) |
341 add_definitions(-DORTHANC_USE_PRECOMPILED_HEADERS=1) | |
342 | |
343 set(TMP | 341 set(TMP |
344 ${ORTHANC_CORE_SOURCES_INTERNAL} | 342 ${ORTHANC_CORE_SOURCES_INTERNAL} |
345 ${ORTHANC_DICOM_SOURCES_INTERNAL} | 343 ${ORTHANC_DICOM_SOURCES_INTERNAL} |
346 ) | 344 ) |
347 | 345 |
376 ${ORTHANC_CORE_PCH} | 374 ${ORTHANC_CORE_PCH} |
377 ${ORTHANC_CORE_SOURCES} | 375 ${ORTHANC_CORE_SOURCES} |
378 ${ORTHANC_DICOM_SOURCES} | 376 ${ORTHANC_DICOM_SOURCES} |
379 ${AUTOGENERATED_SOURCES} | 377 ${AUTOGENERATED_SOURCES} |
380 ) | 378 ) |
379 | |
380 if (MSVC) | |
381 set_target_properties( | |
382 CoreLibrary | |
383 PROPERTIES COMPILE_DEFINITIONS "ORTHANC_USE_PRECOMPILED_HEADERS=1" | |
384 ) | |
385 endif() | |
381 | 386 |
382 add_dependencies(CoreLibrary AutogeneratedTarget) | 387 add_dependencies(CoreLibrary AutogeneratedTarget) |
383 | 388 |
384 if (LIBICU_LIBRARIES) | 389 if (LIBICU_LIBRARIES) |
385 target_link_libraries(CoreLibrary ${LIBICU_LIBRARIES}) | 390 target_link_libraries(CoreLibrary ${LIBICU_LIBRARIES}) |
418 STATIC | 423 STATIC |
419 ${ORTHANC_SERVER_PCH} | 424 ${ORTHANC_SERVER_PCH} |
420 ${ORTHANC_SERVER_SOURCES} | 425 ${ORTHANC_SERVER_SOURCES} |
421 ) | 426 ) |
422 | 427 |
428 if (MSVC) | |
429 set_target_properties( | |
430 ServerLibrary | |
431 PROPERTIES COMPILE_DEFINITIONS "ORTHANC_USE_PRECOMPILED_HEADERS=1" | |
432 ) | |
433 endif() | |
434 | |
423 # Ensure autogenerated code is built before building ServerLibrary | 435 # Ensure autogenerated code is built before building ServerLibrary |
424 add_dependencies(ServerLibrary CoreLibrary OrthancDatabaseProtobuf) | 436 add_dependencies(ServerLibrary CoreLibrary OrthancDatabaseProtobuf) |
425 | 437 |
426 add_executable(Orthanc | 438 add_executable(Orthanc |
427 ${CMAKE_SOURCE_DIR}/Sources/main.cpp | 439 ${CMAKE_SOURCE_DIR}/Sources/main.cpp |
455 ${ORTHANC_UNIT_TESTS_PCH} | 467 ${ORTHANC_UNIT_TESTS_PCH} |
456 ${ORTHANC_FRAMEWORK_UNIT_TESTS} | 468 ${ORTHANC_FRAMEWORK_UNIT_TESTS} |
457 ${ORTHANC_SERVER_UNIT_TESTS} | 469 ${ORTHANC_SERVER_UNIT_TESTS} |
458 ${BOOST_EXTENDED_SOURCES} | 470 ${BOOST_EXTENDED_SOURCES} |
459 ) | 471 ) |
472 | |
473 if (MSVC) | |
474 set_target_properties( | |
475 UnitTests | |
476 PROPERTIES COMPILE_DEFINITIONS "ORTHANC_USE_PRECOMPILED_HEADERS=1" | |
477 ) | |
478 endif() | |
460 | 479 |
461 target_link_libraries(UnitTests | 480 target_link_libraries(UnitTests |
462 ServerLibrary | 481 ServerLibrary |
463 CoreLibrary | 482 CoreLibrary |
464 ${DCMTK_LIBRARIES} | 483 ${DCMTK_LIBRARIES} |