Mercurial > hg > orthanc-stone
annotate Resources/Orthanc/LinuxStandardBaseToolchain.cmake @ 1368:33da5d02885f broker
SdlSimpleViewer rename
author | Benjamin Golinvaux <bgo@osimis.io> |
---|---|
date | Sat, 18 Apr 2020 14:45:22 +0200 |
parents | 9a0a95c0b578 |
children | 86f89ab3563e |
rev | line source |
---|---|
569 | 1 # LSB_CC=gcc-4.8 LSB_CXX=g++-4.8 cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=../Resources/LinuxStandardBaseToolchain.cmake -DUSE_LEGACY_JSONCPP=ON -DUSE_LEGACY_LIBICU=ON -DBOOST_LOCALE_BACKEND=icu |
212
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3 INCLUDE(CMakeForceCompiler) |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5 SET(LSB_PATH $ENV{LSB_PATH}) |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
6 SET(LSB_CC $ENV{LSB_CC}) |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
7 SET(LSB_CXX $ENV{LSB_CXX}) |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
8 SET(LSB_TARGET_VERSION "4.0") |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
9 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
10 IF ("${LSB_PATH}" STREQUAL "") |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
11 SET(LSB_PATH "/opt/lsb") |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
12 ENDIF() |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
13 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
14 IF (EXISTS ${LSB_PATH}/lib64) |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
15 SET(LSB_TARGET_PROCESSOR "x86_64") |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
16 SET(LSB_LIBPATH ${LSB_PATH}/lib64-${LSB_TARGET_VERSION}) |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
17 ELSEIF (EXISTS ${LSB_PATH}/lib) |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
18 SET(LSB_TARGET_PROCESSOR "x86") |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
19 SET(LSB_LIBPATH ${LSB_PATH}/lib-${LSB_TARGET_VERSION}) |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
20 ELSE() |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
21 MESSAGE(FATAL_ERROR "Unable to detect the target processor architecture. Check the LSB_PATH environment variable.") |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
22 ENDIF() |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
23 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
24 SET(LSB_CPPPATH ${LSB_PATH}/include) |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
25 SET(PKG_CONFIG_PATH ${LSB_LIBPATH}/pkgconfig/) |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
26 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
27 # the name of the target operating system |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
28 SET(CMAKE_SYSTEM_NAME Linux) |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
29 SET(CMAKE_SYSTEM_VERSION LinuxStandardBase) |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
30 SET(CMAKE_SYSTEM_PROCESSOR ${LSB_TARGET_PROCESSOR}) |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
31 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
32 # which compilers to use for C and C++ |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
33 SET(CMAKE_C_COMPILER ${LSB_PATH}/bin/lsbcc) |
1268 | 34 |
35 if (${CMAKE_VERSION} VERSION_LESS "3.6.0") | |
36 CMAKE_FORCE_CXX_COMPILER(${LSB_PATH}/bin/lsbc++ GNU) | |
37 else() | |
38 SET(CMAKE_CXX_COMPILER ${LSB_PATH}/bin/lsbc++) | |
39 endif() | |
212
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
40 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
41 # here is the target environment located |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
42 SET(CMAKE_FIND_ROOT_PATH ${LSB_PATH}) |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
43 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
44 # adjust the default behaviour of the FIND_XXX() commands: |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
45 # search headers and libraries in the target environment, search |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
46 # programs in the host environment |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
47 SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
48 SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY NEVER) |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
49 SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE NEVER) |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
50 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
51 SET(CMAKE_CROSSCOMPILING OFF) |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
52 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
53 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
54 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --lsb-target-version=${LSB_TARGET_VERSION} -I${LSB_PATH}/include" CACHE INTERNAL "" FORCE) |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
55 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) |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
56 SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} --lsb-target-version=${LSB_TARGET_VERSION} -L${LSB_LIBPATH} --lsb-besteffort" CACHE INTERNAL "" FORCE) |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
57 SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --lsb-target-version=${LSB_TARGET_VERSION} -L${LSB_LIBPATH} --lsb-besteffort" CACHE INTERNAL "" FORCE) |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
58 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
59 if (NOT "${LSB_CXX}" STREQUAL "") |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
60 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --lsb-cxx=${LSB_CXX}") |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
61 SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} --lsb-cxx=${LSB_CXX}") |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
62 SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --lsb-cxx=${LSB_CXX}") |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
63 endif() |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
64 |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
65 if (NOT "${LSB_CC}" STREQUAL "") |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
66 SET(CMAKE_C_FLAGS "${CMAKE_CC_FLAGS} --lsb-cc=${LSB_CC}") |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
67 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --lsb-cc=${LSB_CC}") |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
68 SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} --lsb-cc=${LSB_CC}") |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
69 SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --lsb-cc=${LSB_CC}") |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
70 endif() |
5412adf19980
resort to OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
71 |