Mercurial > hg > orthanc
annotate Resources/CMake/BoostConfiguration.cmake @ 1845:8ae1a18b9afb
readme
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 30 Nov 2015 14:04:05 +0100 |
parents | 2921384cc352 |
children | 687ff92d173b |
rev | line source |
---|---|
735 | 1 if (STATIC_BUILD OR NOT USE_SYSTEM_BOOST) |
2 set(BOOST_STATIC 1) | |
3 else() | |
4 include(FindBoost) | |
5 | |
6 set(BOOST_STATIC 0) | |
7 #set(Boost_DEBUG 1) | |
8 #set(Boost_USE_STATIC_LIBS ON) | |
9 | |
10 find_package(Boost | |
915
703bef350e89
Orthanc now relies entirely on boost::locale
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
890
diff
changeset
|
11 COMPONENTS filesystem thread system date_time regex locale) |
735 | 12 |
13 if (NOT Boost_FOUND) | |
14 message(FATAL_ERROR "Unable to locate Boost on this system") | |
15 endif() | |
16 | |
17 # Boost releases 1.44 through 1.47 supply both V2 and V3 filesystem | |
18 # http://www.boost.org/doc/libs/1_46_1/libs/filesystem/v3/doc/index.htm | |
19 if (${Boost_VERSION} LESS 104400) | |
20 add_definitions( | |
21 -DBOOST_HAS_FILESYSTEM_V3=0 | |
22 ) | |
23 else() | |
24 add_definitions( | |
25 -DBOOST_HAS_FILESYSTEM_V3=1 | |
26 -DBOOST_FILESYSTEM_VERSION=3 | |
27 ) | |
28 endif() | |
29 | |
30 #if (${Boost_VERSION} LESS 104800) | |
31 # boost::locale is only available from 1.48.00 | |
32 #message("Too old version of Boost (${Boost_LIB_VERSION}): Building the static version") | |
33 # set(BOOST_STATIC 1) | |
34 #endif() | |
35 | |
36 include_directories(${Boost_INCLUDE_DIRS}) | |
37 link_libraries(${Boost_LIBRARIES}) | |
38 endif() | |
39 | |
40 | |
41 if (BOOST_STATIC) | |
1830
2921384cc352
Upgrade to Boost 1.59.0 for static builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1537
diff
changeset
|
42 # Parameters for Boost 1.59.0 |
2921384cc352
Upgrade to Boost 1.59.0 for static builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1537
diff
changeset
|
43 set(BOOST_NAME boost_1_59_0) |
2921384cc352
Upgrade to Boost 1.59.0 for static builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1537
diff
changeset
|
44 set(BOOST_BCP_SUFFIX bcpdigest-0.9.5) |
2921384cc352
Upgrade to Boost 1.59.0 for static builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1537
diff
changeset
|
45 set(BOOST_MD5 "08abb7cdbea0b380f9ab0d5cce476f12") |
1537
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1473
diff
changeset
|
46 set(BOOST_URL "http://www.montefiore.ulg.ac.be/~jodogne/Orthanc/ThirdPartyDownloads/${BOOST_NAME}_${BOOST_BCP_SUFFIX}.tar.gz") |
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1473
diff
changeset
|
47 set(BOOST_FILESYSTEM_SOURCES_DIR "${BOOST_NAME}/libs/filesystem/src") |
735 | 48 set(BOOST_SOURCES_DIR ${CMAKE_BINARY_DIR}/${BOOST_NAME}) |
1537
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1473
diff
changeset
|
49 |
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1473
diff
changeset
|
50 DownloadPackage(${BOOST_MD5} ${BOOST_URL} "${BOOST_SOURCES_DIR}") |
735 | 51 |
52 set(BOOST_SOURCES) | |
927 | 53 |
890 | 54 if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR |
930 | 55 ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" OR |
1337 | 56 ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD" OR |
890 | 57 ${CMAKE_SYSTEM_NAME} STREQUAL "kFreeBSD") |
735 | 58 list(APPEND BOOST_SOURCES |
59 ${BOOST_SOURCES_DIR}/libs/thread/src/pthread/once.cpp | |
60 ${BOOST_SOURCES_DIR}/libs/thread/src/pthread/thread.cpp | |
61 ) | |
62 add_definitions( | |
63 -DBOOST_LOCALE_WITH_ICONV=1 | |
64 ) | |
65 | |
66 if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase") | |
67 add_definitions(-DBOOST_HAS_SCHED_YIELD=1) | |
68 endif() | |
69 | |
70 elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") | |
71 list(APPEND BOOST_SOURCES | |
72 ${BOOST_SOURCES_DIR}/libs/thread/src/win32/tss_dll.cpp | |
73 ${BOOST_SOURCES_DIR}/libs/thread/src/win32/thread.cpp | |
74 ${BOOST_SOURCES_DIR}/libs/thread/src/win32/tss_pe.cpp | |
75 ${BOOST_FILESYSTEM_SOURCES_DIR}/windows_file_codecvt.cpp | |
76 ) | |
1094
1b905ad6c913
Replace wconv by iconv under Windows
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
930
diff
changeset
|
77 |
1b905ad6c913
Replace wconv by iconv under Windows
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
930
diff
changeset
|
78 # Starting with release 0.8.2, Orthanc statically links against |
1b905ad6c913
Replace wconv by iconv under Windows
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
930
diff
changeset
|
79 # libiconv, even on Windows. Indeed, the "WCONV" library of |
1b905ad6c913
Replace wconv by iconv under Windows
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
930
diff
changeset
|
80 # Windows XP seems not to support properly several codepages |
1b905ad6c913
Replace wconv by iconv under Windows
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
930
diff
changeset
|
81 # (notably "Latin3", "Hebrew", and "Arabic"). |
1b905ad6c913
Replace wconv by iconv under Windows
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
930
diff
changeset
|
82 |
1323
5a92665dee23
Sample plugin: Serve folders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1097
diff
changeset
|
83 if (USE_BOOST_ICONV) |
5a92665dee23
Sample plugin: Serve folders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1097
diff
changeset
|
84 include(${ORTHANC_ROOT}/Resources/CMake/LibIconvConfiguration.cmake) |
5a92665dee23
Sample plugin: Serve folders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1097
diff
changeset
|
85 else() |
5a92665dee23
Sample plugin: Serve folders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1097
diff
changeset
|
86 add_definitions(-DBOOST_LOCALE_WITH_WCONV=1) |
5a92665dee23
Sample plugin: Serve folders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1097
diff
changeset
|
87 endif() |
927 | 88 |
735 | 89 else() |
90 message(FATAL_ERROR "Support your platform here") | |
91 endif() | |
92 | |
927 | 93 if (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") |
94 list(APPEND BOOST_SOURCES | |
95 ${BOOST_SOURCES_DIR}/libs/filesystem/src/utf8_codecvt_facet.cpp | |
96 ) | |
97 endif() | |
98 | |
735 | 99 aux_source_directory(${BOOST_SOURCES_DIR}/libs/regex/src BOOST_REGEX_SOURCES) |
100 | |
101 list(APPEND BOOST_SOURCES | |
102 ${BOOST_REGEX_SOURCES} | |
103 ${BOOST_SOURCES_DIR}/libs/date_time/src/gregorian/greg_month.cpp | |
104 ${BOOST_FILESYSTEM_SOURCES_DIR}/codecvt_error_category.cpp | |
105 ${BOOST_FILESYSTEM_SOURCES_DIR}/operations.cpp | |
106 ${BOOST_FILESYSTEM_SOURCES_DIR}/path.cpp | |
107 ${BOOST_FILESYSTEM_SOURCES_DIR}/path_traits.cpp | |
108 ${BOOST_SOURCES_DIR}/libs/locale/src/encoding/codepage.cpp | |
109 ${BOOST_SOURCES_DIR}/libs/system/src/error_code.cpp | |
110 ) | |
111 | |
112 add_definitions( | |
113 # Static build of Boost | |
114 -DBOOST_ALL_NO_LIB | |
115 -DBOOST_ALL_NOLIB | |
116 -DBOOST_DATE_TIME_NO_LIB | |
117 -DBOOST_THREAD_BUILD_LIB | |
118 -DBOOST_PROGRAM_OPTIONS_NO_LIB | |
119 -DBOOST_REGEX_NO_LIB | |
120 -DBOOST_SYSTEM_NO_LIB | |
121 -DBOOST_LOCALE_NO_LIB | |
122 -DBOOST_HAS_LOCALE=1 | |
123 -DBOOST_HAS_FILESYSTEM_V3=1 | |
124 ) | |
125 | |
1415 | 126 if (CMAKE_COMPILER_IS_GNUCXX) |
735 | 127 add_definitions(-isystem ${BOOST_SOURCES_DIR}) |
128 endif() | |
129 | |
130 include_directories( | |
131 ${BOOST_SOURCES_DIR} | |
132 ) | |
133 | |
134 source_group(ThirdParty\\Boost REGULAR_EXPRESSION ${BOOST_SOURCES_DIR}/.*) | |
135 else() | |
136 add_definitions( | |
915
703bef350e89
Orthanc now relies entirely on boost::locale
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
890
diff
changeset
|
137 -DBOOST_HAS_LOCALE=1 |
735 | 138 ) |
139 endif() | |
1397 | 140 |
141 | |
142 add_definitions( | |
143 -DBOOST_HAS_DATE_TIME=1 | |
144 -DBOOST_HAS_REGEX=1 | |
145 ) |