Mercurial > hg > orthanc-stl
annotate Resources/Orthanc/Toolchains/LinuxStandardBaseToolchain.cmake @ 74:ad9950628b35 default tip
use relative path to instances for reverse proxying
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 15 Oct 2024 14:46:48 +0200 |
parents | d34f662a3a6c |
children |
rev | line source |
---|---|
0
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1 # Orthanc - A Lightweight, RESTful DICOM Store |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3 # Department, University Hospital of Liege, Belgium |
67 | 4 # Copyright (C) 2017-2023 Osimis S.A., Belgium |
5 # Copyright (C) 2024-2024 Orthanc Team SRL, Belgium | |
24 | 6 # Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium |
0
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
7 # |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
8 # This program is free software: you can redistribute it and/or |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
9 # modify it under the terms of the GNU Lesser General Public License |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
10 # as published by the Free Software Foundation, either version 3 of |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
11 # the License, or (at your option) any later version. |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
12 # |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
13 # This program is distributed in the hope that it will be useful, but |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
14 # WITHOUT ANY WARRANTY; without even the implied warranty of |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
16 # Lesser General Public License for more details. |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
17 # |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
18 # You should have received a copy of the GNU Lesser General Public |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
19 # License along with this program. If not, see |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
20 # <http://www.gnu.org/licenses/>. |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
21 |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
22 |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
23 # |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
24 # Full build, as used on the BuildBot CIS: |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
25 # |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
26 # $ LSB_CC=gcc-4.8 LSB_CXX=g++-4.8 cmake ../OrthancServer/ -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=../OrthancFramework/Resources/Toolchains/LinuxStandardBaseToolchain.cmake -DUSE_LEGACY_JSONCPP=ON -DUSE_LEGACY_LIBICU=ON -DUSE_LEGACY_BOOST=ON -DBOOST_LOCALE_BACKEND=icu -DENABLE_PKCS11=ON -G Ninja |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
27 # |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
28 # Or, more lightweight version (without libp11 and ICU): |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
29 # |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
30 # $ LSB_CC=gcc-4.8 LSB_CXX=g++-4.8 cmake ../OrthancServer/ -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=../OrthancFramework/Resources/Toolchains/LinuxStandardBaseToolchain.cmake -DUSE_LEGACY_JSONCPP=ON -DUSE_LEGACY_BOOST=ON -G Ninja |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
31 # |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
32 |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
33 INCLUDE(CMakeForceCompiler) |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
34 |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
35 SET(LSB_PATH $ENV{LSB_PATH} CACHE STRING "") |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
36 SET(LSB_CC $ENV{LSB_CC} CACHE STRING "") |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
37 SET(LSB_CXX $ENV{LSB_CXX} CACHE STRING "") |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
38 SET(LSB_TARGET_VERSION "4.0" CACHE STRING "") |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
39 |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
40 IF ("${LSB_PATH}" STREQUAL "") |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
41 SET(LSB_PATH "/opt/lsb") |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
42 ENDIF() |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
43 |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
44 IF (EXISTS ${LSB_PATH}/lib64) |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
45 SET(LSB_TARGET_PROCESSOR "x86_64") |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
46 SET(LSB_LIBPATH ${LSB_PATH}/lib64-${LSB_TARGET_VERSION}) |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
47 ELSEIF (EXISTS ${LSB_PATH}/lib) |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
48 SET(LSB_TARGET_PROCESSOR "x86") |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
49 SET(LSB_LIBPATH ${LSB_PATH}/lib-${LSB_TARGET_VERSION}) |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
50 ELSE() |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
51 MESSAGE(FATAL_ERROR "Unable to detect the target processor architecture. Check the LSB_PATH environment variable.") |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
52 ENDIF() |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
53 |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
54 SET(LSB_CPPPATH ${LSB_PATH}/include) |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
55 SET(PKG_CONFIG_PATH ${LSB_LIBPATH}/pkgconfig/) |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
56 |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
57 # the name of the target operating system |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
58 SET(CMAKE_SYSTEM_NAME Linux) |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
59 SET(CMAKE_SYSTEM_VERSION LinuxStandardBase) |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
60 SET(CMAKE_SYSTEM_PROCESSOR ${LSB_TARGET_PROCESSOR}) |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
61 |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
62 # which compilers to use for C and C++ |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
63 SET(CMAKE_C_COMPILER ${LSB_PATH}/bin/lsbcc) |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
64 |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
65 if (${CMAKE_VERSION} VERSION_LESS "3.6.0") |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
66 CMAKE_FORCE_CXX_COMPILER(${LSB_PATH}/bin/lsbc++ GNU) |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
67 else() |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
68 SET(CMAKE_CXX_COMPILER ${LSB_PATH}/bin/lsbc++) |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
69 endif() |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
70 |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
71 # here is the target environment located |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
72 SET(CMAKE_FIND_ROOT_PATH ${LSB_PATH}) |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
73 |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
74 # adjust the default behaviour of the FIND_XXX() commands: |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
75 # search headers and libraries in the target environment, search |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
76 # programs in the host environment |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
77 SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
78 SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY NEVER) |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
79 SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE NEVER) |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
80 |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
81 SET(CMAKE_CROSSCOMPILING OFF) |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
82 |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
83 |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
84 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --lsb-target-version=${LSB_TARGET_VERSION} -I${LSB_PATH}/include" CACHE INTERNAL "" FORCE) |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
85 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --lsb-target-version=${LSB_TARGET_VERSION} -nostdinc++ -I${LSB_PATH}/include -I${LSB_PATH}/include/c++ -I${LSB_PATH}/include/c++/backward" CACHE INTERNAL "" FORCE) |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
86 SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} --lsb-target-version=${LSB_TARGET_VERSION} -L${LSB_LIBPATH} --lsb-besteffort" CACHE INTERNAL "" FORCE) |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
87 SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --lsb-target-version=${LSB_TARGET_VERSION} -L${LSB_LIBPATH} --lsb-besteffort" CACHE INTERNAL "" FORCE) |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
88 |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
89 if (NOT "${LSB_CXX}" STREQUAL "") |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
90 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --lsb-cxx=${LSB_CXX}") |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
91 SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} --lsb-cxx=${LSB_CXX}") |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
92 SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --lsb-cxx=${LSB_CXX}") |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
93 endif() |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
94 |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
95 if (NOT "${LSB_CC}" STREQUAL "") |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
96 SET(CMAKE_C_FLAGS "${CMAKE_CC_FLAGS} --lsb-cc=${LSB_CC}") |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
97 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --lsb-cc=${LSB_CC}") |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
98 SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} --lsb-cc=${LSB_CC}") |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
99 SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --lsb-cc=${LSB_CC}") |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
100 endif() |
4e889a8e8be2
initial commit of the viewer plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
101 |