Mercurial > hg > orthanc
annotate Resources/CMake/BoostConfiguration.cmake @ 519:1b2cdc855bd3
Parameter for PACS manufacturer, support for ClearCanvas
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 20 Aug 2013 13:39:42 +0200 |
parents | 5f6d75cd4b46 |
children | 210c96710592 |
rev | line source |
---|---|
8 | 1 if (${STATIC_BUILD}) |
2 SET(BOOST_STATIC 1) | |
3 else() | |
107
3b45473c0a73
replace boost::locale with iconv for debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
81
diff
changeset
|
4 include(FindBoost) |
3b45473c0a73
replace boost::locale with iconv for debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
81
diff
changeset
|
5 |
3b45473c0a73
replace boost::locale with iconv for debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
81
diff
changeset
|
6 SET(BOOST_STATIC 0) |
109 | 7 #set(Boost_DEBUG 1) |
107
3b45473c0a73
replace boost::locale with iconv for debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
81
diff
changeset
|
8 #set(Boost_USE_STATIC_LIBS ON) |
3b45473c0a73
replace boost::locale with iconv for debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
81
diff
changeset
|
9 |
8 | 10 find_package(Boost |
183 | 11 COMPONENTS filesystem thread system date_time) |
107
3b45473c0a73
replace boost::locale with iconv for debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
81
diff
changeset
|
12 |
3b45473c0a73
replace boost::locale with iconv for debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
81
diff
changeset
|
13 if (NOT Boost_FOUND) |
3b45473c0a73
replace boost::locale with iconv for debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
81
diff
changeset
|
14 message(FATAL_ERROR "Unable to locate Boost on this system") |
3b45473c0a73
replace boost::locale with iconv for debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
81
diff
changeset
|
15 endif() |
8 | 16 |
111
0fc3b69c0357
preparing for release
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
110
diff
changeset
|
17 # Boost releases 1.44 through 1.47 supply both V2 and V3 filesystem |
0fc3b69c0357
preparing for release
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
110
diff
changeset
|
18 # http://www.boost.org/doc/libs/1_46_1/libs/filesystem/v3/doc/index.htm |
0fc3b69c0357
preparing for release
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
110
diff
changeset
|
19 if (${Boost_VERSION} LESS 104400) |
0fc3b69c0357
preparing for release
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
110
diff
changeset
|
20 add_definitions( |
0fc3b69c0357
preparing for release
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
110
diff
changeset
|
21 -DBOOST_HAS_FILESYSTEM_V3=0 |
0fc3b69c0357
preparing for release
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
110
diff
changeset
|
22 ) |
0fc3b69c0357
preparing for release
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
110
diff
changeset
|
23 else() |
0fc3b69c0357
preparing for release
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
110
diff
changeset
|
24 add_definitions( |
0fc3b69c0357
preparing for release
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
110
diff
changeset
|
25 -DBOOST_HAS_FILESYSTEM_V3=1 |
0fc3b69c0357
preparing for release
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
110
diff
changeset
|
26 -DBOOST_FILESYSTEM_VERSION=3 |
0fc3b69c0357
preparing for release
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
110
diff
changeset
|
27 ) |
0fc3b69c0357
preparing for release
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
110
diff
changeset
|
28 endif() |
0fc3b69c0357
preparing for release
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
110
diff
changeset
|
29 |
107
3b45473c0a73
replace boost::locale with iconv for debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
81
diff
changeset
|
30 #if (${Boost_VERSION} LESS 104800) |
3b45473c0a73
replace boost::locale with iconv for debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
81
diff
changeset
|
31 # boost::locale is only available from 1.48.00 |
3b45473c0a73
replace boost::locale with iconv for debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
81
diff
changeset
|
32 #message("Too old version of Boost (${Boost_LIB_VERSION}): Building the static version") |
3b45473c0a73
replace boost::locale with iconv for debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
81
diff
changeset
|
33 # SET(BOOST_STATIC 1) |
3b45473c0a73
replace boost::locale with iconv for debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
81
diff
changeset
|
34 #endif() |
8 | 35 |
107
3b45473c0a73
replace boost::locale with iconv for debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
81
diff
changeset
|
36 include_directories(${Boost_INCLUDE_DIRS}) |
3b45473c0a73
replace boost::locale with iconv for debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
81
diff
changeset
|
37 link_libraries(${Boost_LIBRARIES}) |
8 | 38 endif() |
39 | |
40 | |
41 if (BOOST_STATIC) | |
42 SET(BOOST_NAME boost_1_49_0) | |
43 SET(BOOST_SOURCES_DIR ${CMAKE_BINARY_DIR}/${BOOST_NAME}) | |
411
5f6d75cd4b46
md5 of third party downlaods
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
382
diff
changeset
|
44 DownloadPackage( |
5f6d75cd4b46
md5 of third party downlaods
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
382
diff
changeset
|
45 "e0defc8c818e4f1c5bbb29d0292b76ca" |
5f6d75cd4b46
md5 of third party downlaods
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
382
diff
changeset
|
46 "http://www.montefiore.ulg.ac.be/~jodogne/Orthanc/ThirdPartyDownloads/${BOOST_NAME}.tar.gz" |
5f6d75cd4b46
md5 of third party downlaods
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
382
diff
changeset
|
47 "${BOOST_SOURCES_DIR}" "${BOOST_PRELOADED}" |
5f6d75cd4b46
md5 of third party downlaods
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
382
diff
changeset
|
48 # Only uncompress the Boost modules we need |
5f6d75cd4b46
md5 of third party downlaods
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
382
diff
changeset
|
49 "${BOOST_NAME}/boost ${BOOST_NAME}/libs/thread/src ${BOOST_NAME}/libs/system/src ${BOOST_NAME}/libs/filesystem/v3/src ${BOOST_NAME}/libs/locale/src ${BOOST_NAME}/libs/date_time/src" |
5f6d75cd4b46
md5 of third party downlaods
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
382
diff
changeset
|
50 ) |
8 | 51 |
18 | 52 set(BOOST_SOURCES) |
8 | 53 if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") |
18 | 54 list(APPEND BOOST_SOURCES |
8 | 55 ${BOOST_SOURCES_DIR}/libs/thread/src/pthread/once.cpp |
56 ${BOOST_SOURCES_DIR}/libs/thread/src/pthread/thread.cpp | |
57 ) | |
58 add_definitions( | |
59 -DBOOST_LOCALE_WITH_ICONV=1 | |
60 ) | |
193
a1b9d1e1497b
failed attempt to compile with linux standard base
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
183
diff
changeset
|
61 |
a1b9d1e1497b
failed attempt to compile with linux standard base
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
183
diff
changeset
|
62 if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase") |
a1b9d1e1497b
failed attempt to compile with linux standard base
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
183
diff
changeset
|
63 add_definitions(-DBOOST_HAS_SCHED_YIELD=1) |
a1b9d1e1497b
failed attempt to compile with linux standard base
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
183
diff
changeset
|
64 endif() |
a1b9d1e1497b
failed attempt to compile with linux standard base
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
183
diff
changeset
|
65 |
8 | 66 elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") |
18 | 67 list(APPEND BOOST_SOURCES |
8 | 68 ${BOOST_SOURCES_DIR}/libs/thread/src/win32/tss_dll.cpp |
69 ${BOOST_SOURCES_DIR}/libs/thread/src/win32/thread.cpp | |
70 ${BOOST_SOURCES_DIR}/libs/thread/src/win32/tss_pe.cpp | |
71 ${BOOST_SOURCES_DIR}/libs/filesystem/v3/src/windows_file_codecvt.cpp | |
72 ) | |
73 add_definitions( | |
74 -DBOOST_LOCALE_WITH_WCONV=1 | |
75 ) | |
76 else() | |
77 message(FATAL_ERROR "Support your platform here") | |
78 endif() | |
79 | |
18 | 80 list(APPEND BOOST_SOURCES |
81 | 81 ${BOOST_SOURCES_DIR}/libs/date_time/src/gregorian/greg_month.cpp |
82 ${BOOST_SOURCES_DIR}/libs/filesystem/v3/src/codecvt_error_category.cpp | |
83 ${BOOST_SOURCES_DIR}/libs/filesystem/v3/src/operations.cpp | |
8 | 84 ${BOOST_SOURCES_DIR}/libs/filesystem/v3/src/path.cpp |
85 ${BOOST_SOURCES_DIR}/libs/filesystem/v3/src/path_traits.cpp | |
86 ${BOOST_SOURCES_DIR}/libs/locale/src/encoding/codepage.cpp | |
81 | 87 ${BOOST_SOURCES_DIR}/libs/system/src/error_code.cpp |
8 | 88 ) |
89 | |
18 | 90 list(APPEND THIRD_PARTY_SOURCES ${BOOST_SOURCES}) |
91 | |
8 | 92 add_definitions( |
93 # Static build of Boost | |
94 -DBOOST_ALL_NO_LIB | |
95 -DBOOST_ALL_NOLIB | |
96 -DBOOST_DATE_TIME_NO_LIB | |
97 -DBOOST_THREAD_BUILD_LIB | |
98 -DBOOST_PROGRAM_OPTIONS_NO_LIB | |
99 -DBOOST_REGEX_NO_LIB | |
100 -DBOOST_SYSTEM_NO_LIB | |
101 -DBOOST_LOCALE_NO_LIB | |
107
3b45473c0a73
replace boost::locale with iconv for debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
81
diff
changeset
|
102 -DBOOST_HAS_LOCALE=1 |
110
fd7b0a3e6260
support of boost 1.42 for debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
109
diff
changeset
|
103 -DBOOST_HAS_FILESYSTEM_V3=1 |
8 | 104 ) |
105 | |
18 | 106 if (${CMAKE_COMPILER_IS_GNUCXX}) |
107 add_definitions(-isystem ${BOOST_SOURCES_DIR}) | |
108 endif() | |
109 | |
8 | 110 include_directories( |
111 ${BOOST_SOURCES_DIR} | |
112 ) | |
113 | |
114 source_group(ThirdParty\\Boost REGULAR_EXPRESSION ${BOOST_SOURCES_DIR}/.*) | |
107
3b45473c0a73
replace boost::locale with iconv for debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
81
diff
changeset
|
115 else() |
3b45473c0a73
replace boost::locale with iconv for debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
81
diff
changeset
|
116 add_definitions( |
3b45473c0a73
replace boost::locale with iconv for debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
81
diff
changeset
|
117 -DBOOST_HAS_LOCALE=0 |
3b45473c0a73
replace boost::locale with iconv for debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
81
diff
changeset
|
118 ) |
8 | 119 endif() |