comparison Resources/Orthanc/CMake/Compiler.cmake @ 54:509334672b6b default tip

updated copyright, as Orthanc Team now replaces Osimis
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 30 May 2024 22:48:01 +0200
parents c71a008fc1e3
children
comparison
equal deleted inserted replaced
53:487f87984eac 54:509334672b6b
1 # Orthanc - A Lightweight, RESTful DICOM Store 1 # Orthanc - A Lightweight, RESTful DICOM Store
2 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics 2 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
3 # Department, University Hospital of Liege, Belgium 3 # Department, University Hospital of Liege, Belgium
4 # Copyright (C) 2017-2023 Osimis S.A., Belgium 4 # Copyright (C) 2017-2023 Osimis S.A., Belgium
5 # Copyright (C) 2021-2023 Sebastien Jodogne, ICTEAM UCLouvain, Belgium 5 # Copyright (C) 2024-2024 Orthanc Team SRL, Belgium
6 # Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
6 # 7 #
7 # This program is free software: you can redistribute it and/or 8 # This program is free software: you can redistribute it and/or
8 # modify it under the terms of the GNU Lesser General Public License 9 # modify it under the terms of the GNU Lesser General Public License
9 # as published by the Free Software Foundation, either version 3 of 10 # as published by the Free Software Foundation, either version 3 of
10 # the License, or (at your option) any later version. 11 # the License, or (at your option) any later version.
41 if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase") 42 if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase")
42 # Cache the environment variables "LSB_CC" and "LSB_CXX" for further 43 # Cache the environment variables "LSB_CC" and "LSB_CXX" for further
43 # use by "ExternalProject" in CMake 44 # use by "ExternalProject" in CMake
44 SET(CMAKE_LSB_CC $ENV{LSB_CC} CACHE STRING "") 45 SET(CMAKE_LSB_CC $ENV{LSB_CC} CACHE STRING "")
45 SET(CMAKE_LSB_CXX $ENV{LSB_CXX} CACHE STRING "") 46 SET(CMAKE_LSB_CXX $ENV{LSB_CXX} CACHE STRING "")
47
48 # This is necessary to build "Orthanc mainline - Framework LSB
49 # Release" on "buildbot-worker-debian11"
50 set(LSB_PTHREAD_NONSHARED "${LSB_PATH}/lib64-${LSB_TARGET_VERSION}/libpthread_nonshared.a")
51 if (EXISTS ${LSB_PTHREAD_NONSHARED})
52 set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${LSB_PTHREAD_NONSHARED}")
53 endif()
46 endif() 54 endif()
47 55
48 56
49 if (CMAKE_COMPILER_IS_GNUCXX) 57 if (CMAKE_COMPILER_IS_GNUCXX)
50 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wno-long-long") 58 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wno-long-long")
122 if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR 130 if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR
123 ${CMAKE_SYSTEM_NAME} STREQUAL "kFreeBSD" OR 131 ${CMAKE_SYSTEM_NAME} STREQUAL "kFreeBSD" OR
124 ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD" OR 132 ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD" OR
125 ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD") 133 ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD")
126 134
127 if (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD" AND 135 if (# NOT ${CMAKE_SYSTEM_VERSION} STREQUAL "LinuxStandardBase" AND
136 NOT ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD" AND
128 NOT ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD") 137 NOT ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
129 # The "--no-undefined" linker flag makes the shared libraries 138 # The "--no-undefined" linker flag makes the shared libraries
130 # (plugins ModalityWorklists and ServeFolders) fail to compile on 139 # (plugins ModalityWorklists and ServeFolders) fail to compile on
131 # OpenBSD, and make the PostgreSQL plugin complain about missing 140 # OpenBSD, and make the PostgreSQL plugin complain about missing
132 # "environ" global variable in FreeBSD 141 # "environ" global variable in FreeBSD.
142 #
143 # TODO - Furthermore, on Linux Standard Base running on Debian 12,
144 # the "-Wl,--no-undefined" seems to break the compilation (added
145 # after Orthanc 1.12.2). This is disabled for now.
133 set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-undefined") 146 set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-undefined")
134 set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined") 147 set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined")
135 endif() 148 endif()
136 149
137 # Remove the "-rdynamic" option 150 # Remove the "-rdynamic" option