annotate Resources/CMake/BoostConfiguration.cmake @ 917:312d04beb0a2 mac

branch for mac os build
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 24 Feb 2014 15:10:30 +0100
parents b8322fe3bdba
children ac8f68cbdbb6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
626
b8322fe3bdba possibility to disable the use of system dcmtk or boost
jodogne
parents: 610
diff changeset
1 if (STATIC_BUILD OR NOT USE_SYSTEM_BOOST)
608
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 560
diff changeset
2 set(BOOST_STATIC 1)
8
3a584803783e build with visual studio
jodogne
parents: 0
diff changeset
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
608
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 560
diff changeset
6 set(BOOST_STATIC 0)
109
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 107
diff changeset
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
3a584803783e build with visual studio
jodogne
parents: 0
diff changeset
10 find_package(Boost
608
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 560
diff changeset
11 COMPONENTS filesystem thread system date_time regex)
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
3a584803783e build with visual studio
jodogne
parents: 0
diff changeset
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")
608
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 560
diff changeset
33 # set(BOOST_STATIC 1)
107
3b45473c0a73 replace boost::locale with iconv for debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 81
diff changeset
34 #endif()
8
3a584803783e build with visual studio
jodogne
parents: 0
diff changeset
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
3a584803783e build with visual studio
jodogne
parents: 0
diff changeset
38 endif()
3a584803783e build with visual studio
jodogne
parents: 0
diff changeset
39
3a584803783e build with visual studio
jodogne
parents: 0
diff changeset
40
3a584803783e build with visual studio
jodogne
parents: 0
diff changeset
41 if (BOOST_STATIC)
552
938d8461cf8f revert to boost 1.54.0, use ZIP instead of TGZ because of bad directory in package
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 551
diff changeset
42 # Parameters for Boost 1.54.0
608
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 560
diff changeset
43 set(BOOST_NAME boost_1_54_0)
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 560
diff changeset
44 set(BOOST_BCP_SUFFIX bcpdigest-0.6.2)
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 560
diff changeset
45 set(BOOST_MD5 "a464288a976ba133f9b325f454cb503d")
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 560
diff changeset
46 set(BOOST_FILESYSTEM_SOURCES_DIR "${BOOST_NAME}/libs/filesystem/src")
550
210c96710592 switch to boost 1.54.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 411
diff changeset
47
608
0bedf8ff9288 basic find scp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 560
diff changeset
48 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
49 DownloadPackage(
550
210c96710592 switch to boost 1.54.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 411
diff changeset
50 "${BOOST_MD5}"
560
69c024f9c06b fix of Debian bug #724947
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 555
diff changeset
51 "http://www.montefiore.ulg.ac.be/~jodogne/Orthanc/ThirdPartyDownloads/${BOOST_NAME}_${BOOST_BCP_SUFFIX}.tar.gz"
553
27d32fc6209a simplifications to cmake, use a digest of boost 1.54.0 thanks bcp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 552
diff changeset
52 "${BOOST_SOURCES_DIR}"
411
5f6d75cd4b46 md5 of third party downlaods
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 382
diff changeset
53 )
8
3a584803783e build with visual studio
jodogne
parents: 0
diff changeset
54
18
f3551378e8f3 fixes for mingw
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 8
diff changeset
55 set(BOOST_SOURCES)
917
312d04beb0a2 branch for mac os build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 626
diff changeset
56 if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR
312d04beb0a2 branch for mac os build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 626
diff changeset
57 ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
18
f3551378e8f3 fixes for mingw
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 8
diff changeset
58 list(APPEND BOOST_SOURCES
8
3a584803783e build with visual studio
jodogne
parents: 0
diff changeset
59 ${BOOST_SOURCES_DIR}/libs/thread/src/pthread/once.cpp
3a584803783e build with visual studio
jodogne
parents: 0
diff changeset
60 ${BOOST_SOURCES_DIR}/libs/thread/src/pthread/thread.cpp
3a584803783e build with visual studio
jodogne
parents: 0
diff changeset
61 )
3a584803783e build with visual studio
jodogne
parents: 0
diff changeset
62 add_definitions(
3a584803783e build with visual studio
jodogne
parents: 0
diff changeset
63 -DBOOST_LOCALE_WITH_ICONV=1
3a584803783e build with visual studio
jodogne
parents: 0
diff changeset
64 )
193
a1b9d1e1497b failed attempt to compile with linux standard base
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 183
diff changeset
65
a1b9d1e1497b failed attempt to compile with linux standard base
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 183
diff changeset
66 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
67 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
68 endif()
a1b9d1e1497b failed attempt to compile with linux standard base
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 183
diff changeset
69
8
3a584803783e build with visual studio
jodogne
parents: 0
diff changeset
70 elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
18
f3551378e8f3 fixes for mingw
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 8
diff changeset
71 list(APPEND BOOST_SOURCES
8
3a584803783e build with visual studio
jodogne
parents: 0
diff changeset
72 ${BOOST_SOURCES_DIR}/libs/thread/src/win32/tss_dll.cpp
3a584803783e build with visual studio
jodogne
parents: 0
diff changeset
73 ${BOOST_SOURCES_DIR}/libs/thread/src/win32/thread.cpp
3a584803783e build with visual studio
jodogne
parents: 0
diff changeset
74 ${BOOST_SOURCES_DIR}/libs/thread/src/win32/tss_pe.cpp
550
210c96710592 switch to boost 1.54.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 411
diff changeset
75 ${BOOST_FILESYSTEM_SOURCES_DIR}/windows_file_codecvt.cpp
8
3a584803783e build with visual studio
jodogne
parents: 0
diff changeset
76 )
3a584803783e build with visual studio
jodogne
parents: 0
diff changeset
77 add_definitions(
3a584803783e build with visual studio
jodogne
parents: 0
diff changeset
78 -DBOOST_LOCALE_WITH_WCONV=1
3a584803783e build with visual studio
jodogne
parents: 0
diff changeset
79 )
3a584803783e build with visual studio
jodogne
parents: 0
diff changeset
80 else()
3a584803783e build with visual studio
jodogne
parents: 0
diff changeset
81 message(FATAL_ERROR "Support your platform here")
3a584803783e build with visual studio
jodogne
parents: 0
diff changeset
82 endif()
3a584803783e build with visual studio
jodogne
parents: 0
diff changeset
83
610
5ba825b87b21 fix static build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 608
diff changeset
84 aux_source_directory(${BOOST_SOURCES_DIR}/libs/regex/src BOOST_REGEX_SOURCES)
5ba825b87b21 fix static build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 608
diff changeset
85
18
f3551378e8f3 fixes for mingw
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 8
diff changeset
86 list(APPEND BOOST_SOURCES
610
5ba825b87b21 fix static build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 608
diff changeset
87 ${BOOST_REGEX_SOURCES}
81
0ec5e2e327b1 zip writer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 55
diff changeset
88 ${BOOST_SOURCES_DIR}/libs/date_time/src/gregorian/greg_month.cpp
550
210c96710592 switch to boost 1.54.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 411
diff changeset
89 ${BOOST_FILESYSTEM_SOURCES_DIR}/codecvt_error_category.cpp
210c96710592 switch to boost 1.54.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 411
diff changeset
90 ${BOOST_FILESYSTEM_SOURCES_DIR}/operations.cpp
210c96710592 switch to boost 1.54.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 411
diff changeset
91 ${BOOST_FILESYSTEM_SOURCES_DIR}/path.cpp
210c96710592 switch to boost 1.54.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 411
diff changeset
92 ${BOOST_FILESYSTEM_SOURCES_DIR}/path_traits.cpp
8
3a584803783e build with visual studio
jodogne
parents: 0
diff changeset
93 ${BOOST_SOURCES_DIR}/libs/locale/src/encoding/codepage.cpp
81
0ec5e2e327b1 zip writer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 55
diff changeset
94 ${BOOST_SOURCES_DIR}/libs/system/src/error_code.cpp
8
3a584803783e build with visual studio
jodogne
parents: 0
diff changeset
95 )
3a584803783e build with visual studio
jodogne
parents: 0
diff changeset
96
18
f3551378e8f3 fixes for mingw
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 8
diff changeset
97 list(APPEND THIRD_PARTY_SOURCES ${BOOST_SOURCES})
f3551378e8f3 fixes for mingw
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 8
diff changeset
98
8
3a584803783e build with visual studio
jodogne
parents: 0
diff changeset
99 add_definitions(
3a584803783e build with visual studio
jodogne
parents: 0
diff changeset
100 # Static build of Boost
3a584803783e build with visual studio
jodogne
parents: 0
diff changeset
101 -DBOOST_ALL_NO_LIB
3a584803783e build with visual studio
jodogne
parents: 0
diff changeset
102 -DBOOST_ALL_NOLIB
3a584803783e build with visual studio
jodogne
parents: 0
diff changeset
103 -DBOOST_DATE_TIME_NO_LIB
3a584803783e build with visual studio
jodogne
parents: 0
diff changeset
104 -DBOOST_THREAD_BUILD_LIB
3a584803783e build with visual studio
jodogne
parents: 0
diff changeset
105 -DBOOST_PROGRAM_OPTIONS_NO_LIB
3a584803783e build with visual studio
jodogne
parents: 0
diff changeset
106 -DBOOST_REGEX_NO_LIB
3a584803783e build with visual studio
jodogne
parents: 0
diff changeset
107 -DBOOST_SYSTEM_NO_LIB
3a584803783e build with visual studio
jodogne
parents: 0
diff changeset
108 -DBOOST_LOCALE_NO_LIB
107
3b45473c0a73 replace boost::locale with iconv for debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 81
diff changeset
109 -DBOOST_HAS_LOCALE=1
110
fd7b0a3e6260 support of boost 1.42 for debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 109
diff changeset
110 -DBOOST_HAS_FILESYSTEM_V3=1
8
3a584803783e build with visual studio
jodogne
parents: 0
diff changeset
111 )
3a584803783e build with visual studio
jodogne
parents: 0
diff changeset
112
18
f3551378e8f3 fixes for mingw
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 8
diff changeset
113 if (${CMAKE_COMPILER_IS_GNUCXX})
f3551378e8f3 fixes for mingw
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 8
diff changeset
114 add_definitions(-isystem ${BOOST_SOURCES_DIR})
f3551378e8f3 fixes for mingw
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 8
diff changeset
115 endif()
f3551378e8f3 fixes for mingw
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 8
diff changeset
116
8
3a584803783e build with visual studio
jodogne
parents: 0
diff changeset
117 include_directories(
3a584803783e build with visual studio
jodogne
parents: 0
diff changeset
118 ${BOOST_SOURCES_DIR}
3a584803783e build with visual studio
jodogne
parents: 0
diff changeset
119 )
3a584803783e build with visual studio
jodogne
parents: 0
diff changeset
120
3a584803783e build with visual studio
jodogne
parents: 0
diff changeset
121 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
122 else()
3b45473c0a73 replace boost::locale with iconv for debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 81
diff changeset
123 add_definitions(
3b45473c0a73 replace boost::locale with iconv for debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 81
diff changeset
124 -DBOOST_HAS_LOCALE=0
3b45473c0a73 replace boost::locale with iconv for debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 81
diff changeset
125 )
8
3a584803783e build with visual studio
jodogne
parents: 0
diff changeset
126 endif()