annotate UnitTestsSources/CMakeLists.txt @ 1679:5b8b88e5bfd6

successfully running unit tests in WebAssembly
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 24 Nov 2020 12:59:10 +0100
parents 621e4e11783d
children 9ac2a65d4172
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1589
8c5f9864545f adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1587
diff changeset
1 # Stone of Orthanc
8c5f9864545f adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1587
diff changeset
2 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
8c5f9864545f adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1587
diff changeset
3 # Department, University Hospital of Liege, Belgium
8c5f9864545f adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1587
diff changeset
4 # Copyright (C) 2017-2020 Osimis S.A., Belgium
8c5f9864545f adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1587
diff changeset
5 #
8c5f9864545f adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1587
diff changeset
6 # This program is free software: you can redistribute it and/or
8c5f9864545f adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1587
diff changeset
7 # modify it under the terms of the GNU Affero General Public License
8c5f9864545f adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1587
diff changeset
8 # as published by the Free Software Foundation, either version 3 of
8c5f9864545f adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1587
diff changeset
9 # the License, or (at your option) any later version.
8c5f9864545f adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1587
diff changeset
10 #
8c5f9864545f adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1587
diff changeset
11 # This program is distributed in the hope that it will be useful, but
8c5f9864545f adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1587
diff changeset
12 # WITHOUT ANY WARRANTY; without even the implied warranty of
8c5f9864545f adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1587
diff changeset
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
8c5f9864545f adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1587
diff changeset
14 # Affero General Public License for more details.
8c5f9864545f adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1587
diff changeset
15 #
8c5f9864545f adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1587
diff changeset
16 # You should have received a copy of the GNU Affero General Public License
8c5f9864545f adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1587
diff changeset
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
8c5f9864545f adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1587
diff changeset
18
8c5f9864545f adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1587
diff changeset
19
1541
ae17c8c8838f standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 cmake_minimum_required(VERSION 2.8.10)
ae17c8c8838f standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21
ae17c8c8838f standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 project(UnitTests)
ae17c8c8838f standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23
1587
a1405ab3a91c reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1584
diff changeset
24 include(${CMAKE_SOURCE_DIR}/../OrthancStone/Resources/CMake/OrthancStoneParameters.cmake)
1541
ae17c8c8838f standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25
ae17c8c8838f standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 if (ORTHANC_FRAMEWORK_SOURCE STREQUAL "system")
ae17c8c8838f standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 set(ORTHANC_BOOST_COMPONENTS program_options)
ae17c8c8838f standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28
ae17c8c8838f standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 set(USE_SYSTEM_GOOGLE_TEST ON CACHE BOOL "Use the system version of Google Test")
ae17c8c8838f standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 set(USE_GOOGLE_TEST_DEBIAN_PACKAGE OFF CACHE BOOL "Use the sources of Google Test shipped with libgtest-dev (Debian only)")
ae17c8c8838f standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 mark_as_advanced(USE_GOOGLE_TEST_DEBIAN_PACKAGE)
1595
621e4e11783d doxygen target, more consistent ORTHANC_STONE_ROOT
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1589
diff changeset
32 include(${ORTHANC_STONE_ROOT}/../Resources/Orthanc/CMake/DownloadPackage.cmake)
621e4e11783d doxygen target, more consistent ORTHANC_STONE_ROOT
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1589
diff changeset
33 include(${ORTHANC_STONE_ROOT}/../Resources/Orthanc/CMake/GoogleTestConfiguration.cmake)
1541
ae17c8c8838f standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34
ae17c8c8838f standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 else()
ae17c8c8838f standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 set(ENABLE_GOOGLE_TEST ON)
ae17c8c8838f standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 endif()
ae17c8c8838f standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38
ae17c8c8838f standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 set(ENABLE_OPENGL OFF)
1584
bd180f97c734 parsing osirix annotations
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
40 set(ENABLE_PUGIXML ON)
1541
ae17c8c8838f standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41
1595
621e4e11783d doxygen target, more consistent ORTHANC_STONE_ROOT
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1589
diff changeset
42 include(${ORTHANC_STONE_ROOT}/../Resources/CMake/OrthancStoneConfiguration.cmake)
1679
5b8b88e5bfd6 successfully running unit tests in WebAssembly
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1595
diff changeset
43 include(${CMAKE_CURRENT_SOURCE_DIR}/UnitTestsSources.cmake)
1541
ae17c8c8838f standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44
1679
5b8b88e5bfd6 successfully running unit tests in WebAssembly
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1595
diff changeset
45 add_executable(UnitTests ${UNIT_TESTS_SOURCES})
1595
621e4e11783d doxygen target, more consistent ORTHANC_STONE_ROOT
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1589
diff changeset
46
621e4e11783d doxygen target, more consistent ORTHANC_STONE_ROOT
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1589
diff changeset
47
621e4e11783d doxygen target, more consistent ORTHANC_STONE_ROOT
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1589
diff changeset
48 #####################################################################
621e4e11783d doxygen target, more consistent ORTHANC_STONE_ROOT
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1589
diff changeset
49 ## Generate the documentation if Doxygen is present
621e4e11783d doxygen target, more consistent ORTHANC_STONE_ROOT
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1589
diff changeset
50 #####################################################################
621e4e11783d doxygen target, more consistent ORTHANC_STONE_ROOT
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1589
diff changeset
51
621e4e11783d doxygen target, more consistent ORTHANC_STONE_ROOT
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1589
diff changeset
52 find_package(Doxygen)
621e4e11783d doxygen target, more consistent ORTHANC_STONE_ROOT
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1589
diff changeset
53 if (DOXYGEN_FOUND)
621e4e11783d doxygen target, more consistent ORTHANC_STONE_ROOT
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1589
diff changeset
54 configure_file(
621e4e11783d doxygen target, more consistent ORTHANC_STONE_ROOT
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1589
diff changeset
55 ${ORTHANC_STONE_ROOT}/../Resources/OrthancStone.doxygen
621e4e11783d doxygen target, more consistent ORTHANC_STONE_ROOT
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1589
diff changeset
56 ${CMAKE_CURRENT_BINARY_DIR}/OrthancStone.doxygen
621e4e11783d doxygen target, more consistent ORTHANC_STONE_ROOT
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1589
diff changeset
57 @ONLY)
621e4e11783d doxygen target, more consistent ORTHANC_STONE_ROOT
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1589
diff changeset
58
621e4e11783d doxygen target, more consistent ORTHANC_STONE_ROOT
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1589
diff changeset
59 add_custom_target(doc
621e4e11783d doxygen target, more consistent ORTHANC_STONE_ROOT
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1589
diff changeset
60 ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/OrthancStone.doxygen
621e4e11783d doxygen target, more consistent ORTHANC_STONE_ROOT
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1589
diff changeset
61 COMMENT "Generating documentation with Doxygen" VERBATIM
621e4e11783d doxygen target, more consistent ORTHANC_STONE_ROOT
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1589
diff changeset
62 )
621e4e11783d doxygen target, more consistent ORTHANC_STONE_ROOT
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1589
diff changeset
63 else()
621e4e11783d doxygen target, more consistent ORTHANC_STONE_ROOT
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1589
diff changeset
64 message("Doxygen not found. The documentation will not be built.")
621e4e11783d doxygen target, more consistent ORTHANC_STONE_ROOT
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1589
diff changeset
65 endif()