view Applications/Samples/Sdl/CMakeLists.txt @ 1680:03afa09cfcf1

running the tests of the Orthanc Framework in WebAssembly
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 24 Nov 2020 16:39:54 +0100
parents 621e4e11783d
children 9ac2a65d4172
line wrap: on
line source

# Stone of Orthanc
# Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
# Department, University Hospital of Liege, Belgium
# Copyright (C) 2017-2020 Osimis S.A., Belgium
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU Affero General Public License
# as published by the Free Software Foundation, either version 3 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.


cmake_minimum_required(VERSION 2.8.10)
cmake_policy(SET CMP0058 NEW)

project(OrthancStone)

include(${CMAKE_SOURCE_DIR}/../../Platforms/Sdl/OrthancStoneSdlParameters.cmake)

if (ORTHANC_FRAMEWORK_SOURCE STREQUAL "system")
  set(ORTHANC_BOOST_COMPONENTS program_options)

  set(USE_SYSTEM_GOOGLE_TEST ON CACHE BOOL "Use the system version of Google Test")
  set(USE_GOOGLE_TEST_DEBIAN_PACKAGE OFF CACHE BOOL "Use the sources of Google Test shipped with libgtest-dev (Debian only)")
  mark_as_advanced(USE_GOOGLE_TEST_DEBIAN_PACKAGE)
  include(${ORTHANC_STONE_ROOT}/../Resources/Orthanc/CMake/DownloadPackage.cmake)
  include(${ORTHANC_STONE_ROOT}/../Resources/Orthanc/CMake/GoogleTestConfiguration.cmake)

else()
  set(ENABLE_GOOGLE_TEST ON)
  set(ENABLE_LOCALE ON)  # Necessary for text rendering
  set(ENABLE_OPENGL ON)  #  <==
  set(ENABLE_WEB_CLIENT ON)
endif()

set(ENABLE_DCMTK ON)  # <==
set(ENABLE_SDL ON)
SET(ENABLE_PUGIXML ON)   # To test compilation of OsiriX annotations

include(${CMAKE_SOURCE_DIR}/../../Platforms/Sdl/OrthancStoneSdlConfiguration.cmake)
include(${CMAKE_SOURCE_DIR}/Utilities.cmake)

if (NOT ORTHANC_FRAMEWORK_SOURCE STREQUAL "system")
  # This include must be after "OrthancStoneConfiguration.cmake" to
  # have "BOOST_SOURCES_DIR" defined
  include(${CMAKE_SOURCE_DIR}/BoostExtendedConfiguration.cmake)
endif()


DownloadPackage(
  "a24b8136b8f3bb93f166baf97d9328de"
  "http://orthanc.osimis.io/ThirdPartyDownloads/ubuntu-font-family-0.83.zip"
  "${CMAKE_BINARY_DIR}/ubuntu-font-family-0.83")

EmbedResources(
  COLORMAP_HOT ${CMAKE_SOURCE_DIR}/../../Resources/Colormaps/hot.lut
  UBUNTU_FONT  ${CMAKE_BINARY_DIR}/ubuntu-font-family-0.83/Ubuntu-R.ttf
  )

SortFilesInSourceGroups()

add_library(OrthancStone STATIC
  ${ORTHANC_STONE_SOURCES}
  ${AUTOGENERATED_SOURCES}
  ${BOOST_EXTENDED_SOURCES}
  )

message(${AUTOGENERATED_SOURCES})



#############################
project(RtViewerSdl)

add_executable(RtViewerSdl
  RtViewer/RtViewerSdl.cpp
  SdlHelpers.h
  ../Common/RtViewerApp.cpp
  ../Common/RtViewerApp.h
  ../Common/RtViewerView.cpp
  ../Common/RtViewerView.h
  ../Common/SampleHelpers.h
  )

target_link_libraries(RtViewerSdl OrthancStone ${DCMTK_LIBRARIES})

#############################
project(SdlSimpleViewer)

add_executable(SdlSimpleViewer
  SdlHelpers.h
  ../Common/SampleHelpers.h
  SingleFrameViewer/SdlSimpleViewerApplication.h
  SingleFrameViewer/SdlSimpleViewer.cpp
  )

target_link_libraries(SdlSimpleViewer OrthancStone ${DCMTK_LIBRARIES})

#############################
project(UnitTests)

add_executable(UnitTests
  ${GOOGLE_TEST_SOURCES}
  ${CMAKE_SOURCE_DIR}/../../../UnitTestsSources/GenericToolboxTests.cpp
  ${CMAKE_SOURCE_DIR}/../../../UnitTestsSources/ImageToolboxTests.cpp
  ${CMAKE_SOURCE_DIR}/../../../UnitTestsSources/PixelTestPatternsTests.cpp
  ${CMAKE_SOURCE_DIR}/../../../UnitTestsSources/TestMessageBroker.cpp
  ${CMAKE_SOURCE_DIR}/../../../UnitTestsSources/TestStrategy.cpp
  ${CMAKE_SOURCE_DIR}/../../../UnitTestsSources/TestStructureSet.cpp
  ${CMAKE_SOURCE_DIR}/../../../UnitTestsSources/SortedFramesTests.cpp
  ${CMAKE_SOURCE_DIR}/../../../UnitTestsSources/UnitTestsMain.cpp
  )

target_link_libraries(UnitTests OrthancStone)

add_custom_command(
  TARGET UnitTests
  POST_BUILD
  COMMAND ${CMAKE_COMMAND} -E copy
    "${CMAKE_SOURCE_DIR}/../../../UnitTestsSources/72c773ac-5059f2c4-2e6a9120-4fd4bca1-45701661.json" 
    "$<TARGET_FILE_DIR:UnitTests>/72c773ac-5059f2c4-2e6a9120-4fd4bca1-45701661.json"
)

target_link_libraries(UnitTests OrthancStone ${DCMTK_LIBRARIES})