comparison CMakeLists.txt @ 2037:661c75c7ff8f

reorganization in the cmake
author sjodogne
date Tue, 21 Jun 2016 13:52:22 +0200
parents 99e70e9b05ad
children 235319b3ddf0
comparison
equal deleted inserted replaced
2036:99e70e9b05ad 2037:661c75c7ff8f
387 endif() 387 endif()
388 388
389 389
390 390
391 ##################################################################### 391 #####################################################################
392 ## Build the core of Orthanc 392 ## Configuration of the C/C++ macros
393 ##################################################################### 393 #####################################################################
394 394
395 # Setup precompiled headers for Microsoft Visual Studio 395 # Setup precompiled headers for Microsoft Visual Studio
396 if (MSVC) 396 if (MSVC)
397 add_definitions(-DORTHANC_USE_PRECOMPILED_HEADERS=1) 397 add_definitions(-DORTHANC_USE_PRECOMPILED_HEADERS=1)
404 404
405 ADD_VISUAL_STUDIO_PRECOMPILED_HEADERS( 405 ADD_VISUAL_STUDIO_PRECOMPILED_HEADERS(
406 "PrecompiledHeadersUnitTests.h" "UnitTestsSources/PrecompiledHeadersUnitTests.cpp" ORTHANC_UNIT_TESTS_SOURCES) 406 "PrecompiledHeadersUnitTests.h" "UnitTestsSources/PrecompiledHeadersUnitTests.cpp" ORTHANC_UNIT_TESTS_SOURCES)
407 endif() 407 endif()
408 408
409 if (UNIT_TESTS_WITH_HTTP_CONNEXIONS)
410 add_definitions(-DUNIT_TESTS_WITH_HTTP_CONNEXIONS=1)
411 else()
412 add_definitions(-DUNIT_TESTS_WITH_HTTP_CONNEXIONS=0)
413 endif()
409 414
410 add_definitions( 415 add_definitions(
411 -DORTHANC_VERSION="${ORTHANC_VERSION}" 416 -DORTHANC_VERSION="${ORTHANC_VERSION}"
412 -DORTHANC_DATABASE_VERSION=${ORTHANC_DATABASE_VERSION} 417 -DORTHANC_DATABASE_VERSION=${ORTHANC_DATABASE_VERSION}
413 -DORTHANC_ENABLE_LOGGING=1 418 -DORTHANC_ENABLE_LOGGING=1
414 -DORTHANC_MAXIMUM_TAG_LENGTH=256 419 -DORTHANC_MAXIMUM_TAG_LENGTH=256
415 ) 420 -DORTHANC_BUILD_UNIT_TESTS=1
421
422 # Macros for the plugins
423 -DMODALITY_WORKLISTS_VERSION="${ORTHANC_VERSION}"
424 -DSERVE_FOLDERS_VERSION="${ORTHANC_VERSION}"
425 )
426
427
428
429 #####################################################################
430 ## Build the core of Orthanc
431 #####################################################################
416 432
417 list(LENGTH OPENSSL_SOURCES OPENSSL_SOURCES_LENGTH) 433 list(LENGTH OPENSSL_SOURCES OPENSSL_SOURCES_LENGTH)
418 if (${OPENSSL_SOURCES_LENGTH} GREATER 0) 434 if (${OPENSSL_SOURCES_LENGTH} GREATER 0)
419 add_library(OpenSSL STATIC ${OPENSSL_SOURCES}) 435 add_library(OpenSSL STATIC ${OPENSSL_SOURCES})
420 endif() 436 endif()
478 494
479 ##################################################################### 495 #####################################################################
480 ## Build the unit tests 496 ## Build the unit tests
481 ##################################################################### 497 #####################################################################
482 498
483 if (UNIT_TESTS_WITH_HTTP_CONNEXIONS)
484 add_definitions(-DUNIT_TESTS_WITH_HTTP_CONNEXIONS=1)
485 else()
486 add_definitions(-DUNIT_TESTS_WITH_HTTP_CONNEXIONS=0)
487 endif()
488
489 add_definitions(
490 -DORTHANC_BUILD_UNIT_TESTS=1
491 )
492
493 include(${CMAKE_SOURCE_DIR}/Resources/CMake/GoogleTestConfiguration.cmake) 499 include(${CMAKE_SOURCE_DIR}/Resources/CMake/GoogleTestConfiguration.cmake)
494 add_executable(UnitTests 500 add_executable(UnitTests
495 ${GTEST_SOURCES} 501 ${GTEST_SOURCES}
496 ${ORTHANC_UNIT_TESTS_SOURCES} 502 ${ORTHANC_UNIT_TESTS_SOURCES}
497 ) 503 )
522 endif() 528 endif()
523 529
524 list(APPEND SERVE_FOLDERS_RESOURCES ${AUTOGENERATED_DIR}/ServeFolders.rc) 530 list(APPEND SERVE_FOLDERS_RESOURCES ${AUTOGENERATED_DIR}/ServeFolders.rc)
525 endif() 531 endif()
526 532
527 add_definitions(-DSERVE_FOLDERS_VERSION="${ORTHANC_VERSION}")
528
529 include_directories(${CMAKE_SOURCE_DIR}/Plugins/Include) 533 include_directories(${CMAKE_SOURCE_DIR}/Plugins/Include)
530 534
531 add_library(ServeFolders SHARED 535 add_library(ServeFolders SHARED
532 ${BOOST_SOURCES} 536 ${BOOST_SOURCES}
533 ${JSONCPP_SOURCES} 537 ${JSONCPP_SOURCES}
569 endif() 573 endif()
570 574
571 list(APPEND MODALITY_WORKLISTS_RESOURCES ${AUTOGENERATED_DIR}/ModalityWorklists.rc) 575 list(APPEND MODALITY_WORKLISTS_RESOURCES ${AUTOGENERATED_DIR}/ModalityWorklists.rc)
572 endif() 576 endif()
573 577
574 add_definitions(-DMODALITY_WORKLISTS_VERSION="${ORTHANC_VERSION}")
575
576 include_directories(${CMAKE_SOURCE_DIR}/Plugins/Include) 578 include_directories(${CMAKE_SOURCE_DIR}/Plugins/Include)
577 579
578 add_library(ModalityWorklists SHARED 580 add_library(ModalityWorklists SHARED
579 ${BOOST_SOURCES} 581 ${BOOST_SOURCES}
580 ${JSONCPP_SOURCES} 582 ${JSONCPP_SOURCES}