Mercurial > hg > orthanc
annotate Resources/CMake/GoogleLogConfiguration.cmake @ 712:9e3f21441903
lua tests
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 13 Feb 2014 16:16:07 +0100 |
parents | e8e59e80868c |
children | f4f5ab513157 312d04beb0a2 |
rev | line source |
---|---|
634 | 1 if (STATIC_BUILD OR NOT USE_SYSTEM_GOOGLE_LOG) |
658
e8e59e80868c
note about glog-0.3.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
657
diff
changeset
|
2 SET(GOOGLE_LOG_SOURCES_DIR ${CMAKE_BINARY_DIR}/glog-0.3.2) |
411
5f6d75cd4b46
md5 of third party downlaods
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
382
diff
changeset
|
3 DownloadPackage( |
658
e8e59e80868c
note about glog-0.3.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
657
diff
changeset
|
4 "897fbff90d91ea2b6d6e78c8cea641cc" |
e8e59e80868c
note about glog-0.3.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
657
diff
changeset
|
5 "http://www.montefiore.ulg.ac.be/~jodogne/Orthanc/ThirdPartyDownloads/glog-0.3.2.tar.gz" |
553
27d32fc6209a
simplifications to cmake, use a digest of boost 1.54.0 thanks bcp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
495
diff
changeset
|
6 "${GOOGLE_LOG_SOURCES_DIR}") |
495 | 7 |
658
e8e59e80868c
note about glog-0.3.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
657
diff
changeset
|
8 |
e8e59e80868c
note about glog-0.3.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
657
diff
changeset
|
9 # Glog 0.3.3 fails to build with old versions of MinGW, such as the |
e8e59e80868c
note about glog-0.3.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
657
diff
changeset
|
10 # one installed on our Continuous Integration Server that runs |
e8e59e80868c
note about glog-0.3.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
657
diff
changeset
|
11 # Debian Squeeze. We thus stick to Glog 0.3.2 for the time being. |
e8e59e80868c
note about glog-0.3.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
657
diff
changeset
|
12 |
e8e59e80868c
note about glog-0.3.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
657
diff
changeset
|
13 #SET(GOOGLE_LOG_SOURCES_DIR ${CMAKE_BINARY_DIR}/glog-0.3.3) |
e8e59e80868c
note about glog-0.3.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
657
diff
changeset
|
14 #DownloadPackage( |
e8e59e80868c
note about glog-0.3.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
657
diff
changeset
|
15 # "a6fd2c22f8996846e34c763422717c18" |
e8e59e80868c
note about glog-0.3.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
657
diff
changeset
|
16 # "http://www.montefiore.ulg.ac.be/~jodogne/Orthanc/ThirdPartyDownloads/glog-0.3.3.tar.gz" |
e8e59e80868c
note about glog-0.3.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
657
diff
changeset
|
17 # "${GOOGLE_LOG_SOURCES_DIR}") |
e8e59e80868c
note about glog-0.3.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
657
diff
changeset
|
18 |
e8e59e80868c
note about glog-0.3.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
657
diff
changeset
|
19 |
130
b09b0ffd9941
trying to statically build google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
105
diff
changeset
|
20 set(GOOGLE_LOG_HEADERS |
b09b0ffd9941
trying to statically build google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
105
diff
changeset
|
21 ${GOOGLE_LOG_SOURCES_DIR}/src/glog/logging.h |
b09b0ffd9941
trying to statically build google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
105
diff
changeset
|
22 ${GOOGLE_LOG_SOURCES_DIR}/src/glog/raw_logging.h |
b09b0ffd9941
trying to statically build google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
105
diff
changeset
|
23 ${GOOGLE_LOG_SOURCES_DIR}/src/glog/stl_logging.h |
b09b0ffd9941
trying to statically build google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
105
diff
changeset
|
24 ${GOOGLE_LOG_SOURCES_DIR}/src/glog/vlog_is_on.h |
b09b0ffd9941
trying to statically build google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
105
diff
changeset
|
25 ) |
b09b0ffd9941
trying to statically build google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
105
diff
changeset
|
26 |
131
8ef8ce9fb6b3
fix of static google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
130
diff
changeset
|
27 set(ac_google_namespace google) |
8ef8ce9fb6b3
fix of static google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
130
diff
changeset
|
28 set(ac_google_start_namespace "namespace google {") |
8ef8ce9fb6b3
fix of static google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
130
diff
changeset
|
29 set(ac_google_end_namespace "}") |
8ef8ce9fb6b3
fix of static google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
130
diff
changeset
|
30 |
130
b09b0ffd9941
trying to statically build google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
105
diff
changeset
|
31 if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") |
b09b0ffd9941
trying to statically build google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
105
diff
changeset
|
32 set(ac_cv_have_unistd_h 1) |
b09b0ffd9941
trying to statically build google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
105
diff
changeset
|
33 set(ac_cv_have_stdint_h 1) |
b09b0ffd9941
trying to statically build google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
105
diff
changeset
|
34 set(ac_cv_have_systypes_h 0) |
b09b0ffd9941
trying to statically build google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
105
diff
changeset
|
35 set(ac_cv_have_inttypes_h 0) |
b09b0ffd9941
trying to statically build google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
105
diff
changeset
|
36 set(ac_cv_have_libgflags 0) |
b09b0ffd9941
trying to statically build google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
105
diff
changeset
|
37 set(ac_cv_have_uint16_t 1) |
b09b0ffd9941
trying to statically build google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
105
diff
changeset
|
38 set(ac_cv_have_u_int16_t 0) |
b09b0ffd9941
trying to statically build google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
105
diff
changeset
|
39 set(ac_cv_have___uint16 0) |
131
8ef8ce9fb6b3
fix of static google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
130
diff
changeset
|
40 set(ac_cv_cxx_using_operator 1) |
8ef8ce9fb6b3
fix of static google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
130
diff
changeset
|
41 set(ac_cv_have___builtin_expect 1) |
130
b09b0ffd9941
trying to statically build google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
105
diff
changeset
|
42 else() |
131
8ef8ce9fb6b3
fix of static google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
130
diff
changeset
|
43 set(ac_cv_have_unistd_h 0) |
8ef8ce9fb6b3
fix of static google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
130
diff
changeset
|
44 set(ac_cv_have_stdint_h 0) |
8ef8ce9fb6b3
fix of static google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
130
diff
changeset
|
45 set(ac_cv_have_systypes_h 0) |
8ef8ce9fb6b3
fix of static google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
130
diff
changeset
|
46 set(ac_cv_have_inttypes_h 0) |
8ef8ce9fb6b3
fix of static google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
130
diff
changeset
|
47 set(ac_cv_have_libgflags 0) |
8ef8ce9fb6b3
fix of static google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
130
diff
changeset
|
48 set(ac_cv_have_uint16_t 0) |
8ef8ce9fb6b3
fix of static google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
130
diff
changeset
|
49 set(ac_cv_have_u_int16_t 0) |
8ef8ce9fb6b3
fix of static google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
130
diff
changeset
|
50 set(ac_cv_have___uint16 1) |
8ef8ce9fb6b3
fix of static google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
130
diff
changeset
|
51 set(ac_cv_cxx_using_operator 1) |
132
5321f3609639
fix of static google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
131
diff
changeset
|
52 set(ac_cv_have___builtin_expect 0) |
130
b09b0ffd9941
trying to statically build google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
105
diff
changeset
|
53 endif() |
b09b0ffd9941
trying to statically build google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
105
diff
changeset
|
54 |
b09b0ffd9941
trying to statically build google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
105
diff
changeset
|
55 foreach (f ${GOOGLE_LOG_HEADERS}) |
b09b0ffd9941
trying to statically build google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
105
diff
changeset
|
56 configure_file(${f}.in ${f}) |
b09b0ffd9941
trying to statically build google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
105
diff
changeset
|
57 endforeach() |
b09b0ffd9941
trying to statically build google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
105
diff
changeset
|
58 |
102 | 59 include_directories( |
60 ${GOOGLE_LOG_SOURCES_DIR}/src | |
61 ) | |
62 | |
63 if (CMAKE_COMPILER_IS_GNUCXX) | |
569 | 64 if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase") |
561 | 65 execute_process( |
66 COMMAND patch utilities.cc ${CMAKE_SOURCE_DIR}/Resources/Patches/glog-utilities-lsb.diff | |
67 WORKING_DIRECTORY ${GOOGLE_LOG_SOURCES_DIR}/src | |
68 ) | |
69 else() | |
70 execute_process( | |
71 COMMAND patch utilities.cc ${CMAKE_SOURCE_DIR}/Resources/Patches/glog-utilities.diff | |
72 WORKING_DIRECTORY ${GOOGLE_LOG_SOURCES_DIR}/src | |
73 ) | |
74 endif() | |
75 | |
102 | 76 execute_process( |
105 | 77 COMMAND patch port.h ${CMAKE_SOURCE_DIR}/Resources/Patches/glog-port-h.diff |
78 WORKING_DIRECTORY ${GOOGLE_LOG_SOURCES_DIR}/src/windows | |
79 ) | |
80 execute_process( | |
81 COMMAND patch port.cc ${CMAKE_SOURCE_DIR}/Resources/Patches/glog-port-cc.diff | |
102 | 82 WORKING_DIRECTORY ${GOOGLE_LOG_SOURCES_DIR}/src/windows |
83 ) | |
84 endif() | |
85 | |
86 if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") | |
569 | 87 if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase") |
561 | 88 # Install the specific configuration for LSB SDK |
89 configure_file( | |
90 ${CMAKE_SOURCE_DIR}/Resources/CMake/GoogleLogConfigurationLSB.h | |
91 ${GOOGLE_LOG_SOURCES_DIR}/src/config.h | |
92 COPYONLY) | |
93 else() | |
94 configure_file( | |
95 ${CMAKE_SOURCE_DIR}/Resources/CMake/GoogleLogConfiguration.h | |
96 ${GOOGLE_LOG_SOURCES_DIR}/src/config.h | |
97 COPYONLY) | |
98 endif() | |
102 | 99 |
100 set(GOOGLE_LOG_SOURCES | |
101 ${GOOGLE_LOG_SOURCES_DIR}/src/demangle.cc | |
102 ${GOOGLE_LOG_SOURCES_DIR}/src/logging.cc | |
103 ${GOOGLE_LOG_SOURCES_DIR}/src/raw_logging.cc | |
104 ${GOOGLE_LOG_SOURCES_DIR}/src/signalhandler.cc | |
105 ${GOOGLE_LOG_SOURCES_DIR}/src/symbolize.cc | |
106 ${GOOGLE_LOG_SOURCES_DIR}/src/utilities.cc | |
107 ${GOOGLE_LOG_SOURCES_DIR}/src/vlog_is_on.cc | |
108 ) | |
109 | |
110 elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") | |
111 include_directories( | |
112 ${GOOGLE_LOG_SOURCES_DIR}/src/windows | |
113 ) | |
114 | |
115 set(GOOGLE_LOG_SOURCES | |
105 | 116 ${GOOGLE_LOG_SOURCES_DIR}/src/windows/port.cc |
102 | 117 ${GOOGLE_LOG_SOURCES_DIR}/src/logging.cc |
118 ${GOOGLE_LOG_SOURCES_DIR}/src/raw_logging.cc | |
119 ${GOOGLE_LOG_SOURCES_DIR}/src/utilities.cc | |
120 ${GOOGLE_LOG_SOURCES_DIR}/src/vlog_is_on.cc | |
121 ) | |
122 | |
123 add_definitions( | |
124 -DGLOG_NO_ABBREVIATED_SEVERITIES=1 | |
125 -DNO_FRAME_POINTER=1 | |
126 -DGOOGLE_GLOG_DLL_DECL= | |
127 ) | |
495 | 128 |
129 if (${CMAKE_COMPILER_IS_GNUCXX}) | |
130 # This is a patch for MinGW64 | |
131 add_definitions(-D_TIME_H__S=1) | |
132 endif() | |
133 | |
102 | 134 endif() |
135 | |
495 | 136 |
137 | |
102 | 138 add_library(GoogleLog STATIC ${GOOGLE_LOG_SOURCES}) |
139 link_libraries(GoogleLog) | |
140 | |
141 else() | |
142 CHECK_INCLUDE_FILE_CXX(glog/logging.h HAVE_GOOGLE_LOG_H) | |
143 if (NOT HAVE_GOOGLE_LOG_H) | |
144 message(FATAL_ERROR "Please install the libgoogle-glog-dev package") | |
145 endif() | |
146 | |
147 link_libraries(glog) | |
148 endif() |