Mercurial > hg > orthanc
annotate Resources/CMake/GoogleLogConfiguration.cmake @ 584:a042693cc6a9
uninstall target for make
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 02 Oct 2013 14:21:43 +0200 |
parents | 701d748cf327 |
children | d775a3cb5a06 |
rev | line source |
---|---|
134 | 1 if (STATIC_BUILD OR NOT USE_DYNAMIC_GOOGLE_LOG) |
102 | 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( |
5f6d75cd4b46
md5 of third party downlaods
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
382
diff
changeset
|
4 "897fbff90d91ea2b6d6e78c8cea641cc" |
5f6d75cd4b46
md5 of third party downlaods
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
382
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 |
130
b09b0ffd9941
trying to statically build google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
105
diff
changeset
|
8 set(GOOGLE_LOG_HEADERS |
b09b0ffd9941
trying to statically build google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
105
diff
changeset
|
9 ${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
|
10 ${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
|
11 ${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
|
12 ${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
|
13 ) |
b09b0ffd9941
trying to statically build google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
105
diff
changeset
|
14 |
131
8ef8ce9fb6b3
fix of static google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
130
diff
changeset
|
15 set(ac_google_namespace google) |
8ef8ce9fb6b3
fix of static google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
130
diff
changeset
|
16 set(ac_google_start_namespace "namespace google {") |
8ef8ce9fb6b3
fix of static google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
130
diff
changeset
|
17 set(ac_google_end_namespace "}") |
8ef8ce9fb6b3
fix of static google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
130
diff
changeset
|
18 |
130
b09b0ffd9941
trying to statically build google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
105
diff
changeset
|
19 if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") |
b09b0ffd9941
trying to statically build google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
105
diff
changeset
|
20 set(ac_cv_have_unistd_h 1) |
b09b0ffd9941
trying to statically build google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
105
diff
changeset
|
21 set(ac_cv_have_stdint_h 1) |
b09b0ffd9941
trying to statically build google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
105
diff
changeset
|
22 set(ac_cv_have_systypes_h 0) |
b09b0ffd9941
trying to statically build google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
105
diff
changeset
|
23 set(ac_cv_have_inttypes_h 0) |
b09b0ffd9941
trying to statically build google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
105
diff
changeset
|
24 set(ac_cv_have_libgflags 0) |
b09b0ffd9941
trying to statically build google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
105
diff
changeset
|
25 set(ac_cv_have_uint16_t 1) |
b09b0ffd9941
trying to statically build google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
105
diff
changeset
|
26 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
|
27 set(ac_cv_have___uint16 0) |
131
8ef8ce9fb6b3
fix of static google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
130
diff
changeset
|
28 set(ac_cv_cxx_using_operator 1) |
8ef8ce9fb6b3
fix of static google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
130
diff
changeset
|
29 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
|
30 else() |
131
8ef8ce9fb6b3
fix of static google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
130
diff
changeset
|
31 set(ac_cv_have_unistd_h 0) |
8ef8ce9fb6b3
fix of static google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
130
diff
changeset
|
32 set(ac_cv_have_stdint_h 0) |
8ef8ce9fb6b3
fix of static google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
130
diff
changeset
|
33 set(ac_cv_have_systypes_h 0) |
8ef8ce9fb6b3
fix of static google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
130
diff
changeset
|
34 set(ac_cv_have_inttypes_h 0) |
8ef8ce9fb6b3
fix of static google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
130
diff
changeset
|
35 set(ac_cv_have_libgflags 0) |
8ef8ce9fb6b3
fix of static google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
130
diff
changeset
|
36 set(ac_cv_have_uint16_t 0) |
8ef8ce9fb6b3
fix of static google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
130
diff
changeset
|
37 set(ac_cv_have_u_int16_t 0) |
8ef8ce9fb6b3
fix of static google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
130
diff
changeset
|
38 set(ac_cv_have___uint16 1) |
8ef8ce9fb6b3
fix of static google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
130
diff
changeset
|
39 set(ac_cv_cxx_using_operator 1) |
132
5321f3609639
fix of static google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
131
diff
changeset
|
40 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
|
41 endif() |
b09b0ffd9941
trying to statically build google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
105
diff
changeset
|
42 |
b09b0ffd9941
trying to statically build google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
105
diff
changeset
|
43 foreach (f ${GOOGLE_LOG_HEADERS}) |
b09b0ffd9941
trying to statically build google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
105
diff
changeset
|
44 configure_file(${f}.in ${f}) |
b09b0ffd9941
trying to statically build google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
105
diff
changeset
|
45 endforeach() |
b09b0ffd9941
trying to statically build google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
105
diff
changeset
|
46 |
102 | 47 include_directories( |
48 ${GOOGLE_LOG_SOURCES_DIR}/src | |
49 ) | |
50 | |
51 if (CMAKE_COMPILER_IS_GNUCXX) | |
569 | 52 if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase") |
561 | 53 execute_process( |
54 COMMAND patch utilities.cc ${CMAKE_SOURCE_DIR}/Resources/Patches/glog-utilities-lsb.diff | |
55 WORKING_DIRECTORY ${GOOGLE_LOG_SOURCES_DIR}/src | |
56 ) | |
57 else() | |
58 execute_process( | |
59 COMMAND patch utilities.cc ${CMAKE_SOURCE_DIR}/Resources/Patches/glog-utilities.diff | |
60 WORKING_DIRECTORY ${GOOGLE_LOG_SOURCES_DIR}/src | |
61 ) | |
62 endif() | |
63 | |
102 | 64 execute_process( |
105 | 65 COMMAND patch port.h ${CMAKE_SOURCE_DIR}/Resources/Patches/glog-port-h.diff |
66 WORKING_DIRECTORY ${GOOGLE_LOG_SOURCES_DIR}/src/windows | |
67 ) | |
68 execute_process( | |
69 COMMAND patch port.cc ${CMAKE_SOURCE_DIR}/Resources/Patches/glog-port-cc.diff | |
102 | 70 WORKING_DIRECTORY ${GOOGLE_LOG_SOURCES_DIR}/src/windows |
71 ) | |
72 endif() | |
73 | |
74 if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") | |
569 | 75 if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase") |
561 | 76 # Install the specific configuration for LSB SDK |
77 configure_file( | |
78 ${CMAKE_SOURCE_DIR}/Resources/CMake/GoogleLogConfigurationLSB.h | |
79 ${GOOGLE_LOG_SOURCES_DIR}/src/config.h | |
80 COPYONLY) | |
81 else() | |
82 configure_file( | |
83 ${CMAKE_SOURCE_DIR}/Resources/CMake/GoogleLogConfiguration.h | |
84 ${GOOGLE_LOG_SOURCES_DIR}/src/config.h | |
85 COPYONLY) | |
86 endif() | |
102 | 87 |
88 set(GOOGLE_LOG_SOURCES | |
89 ${GOOGLE_LOG_SOURCES_DIR}/src/demangle.cc | |
90 ${GOOGLE_LOG_SOURCES_DIR}/src/logging.cc | |
91 ${GOOGLE_LOG_SOURCES_DIR}/src/raw_logging.cc | |
92 ${GOOGLE_LOG_SOURCES_DIR}/src/signalhandler.cc | |
93 ${GOOGLE_LOG_SOURCES_DIR}/src/symbolize.cc | |
94 ${GOOGLE_LOG_SOURCES_DIR}/src/utilities.cc | |
95 ${GOOGLE_LOG_SOURCES_DIR}/src/vlog_is_on.cc | |
96 ) | |
97 | |
98 elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") | |
99 include_directories( | |
100 ${GOOGLE_LOG_SOURCES_DIR}/src/windows | |
101 ) | |
102 | |
103 set(GOOGLE_LOG_SOURCES | |
105 | 104 ${GOOGLE_LOG_SOURCES_DIR}/src/windows/port.cc |
102 | 105 ${GOOGLE_LOG_SOURCES_DIR}/src/logging.cc |
106 ${GOOGLE_LOG_SOURCES_DIR}/src/raw_logging.cc | |
107 ${GOOGLE_LOG_SOURCES_DIR}/src/utilities.cc | |
108 ${GOOGLE_LOG_SOURCES_DIR}/src/vlog_is_on.cc | |
109 ) | |
110 | |
111 add_definitions( | |
112 -DGLOG_NO_ABBREVIATED_SEVERITIES=1 | |
113 -DNO_FRAME_POINTER=1 | |
114 -DGOOGLE_GLOG_DLL_DECL= | |
115 ) | |
495 | 116 |
117 if (${CMAKE_COMPILER_IS_GNUCXX}) | |
118 # This is a patch for MinGW64 | |
119 add_definitions(-D_TIME_H__S=1) | |
120 endif() | |
121 | |
102 | 122 endif() |
123 | |
495 | 124 |
125 | |
102 | 126 add_library(GoogleLog STATIC ${GOOGLE_LOG_SOURCES}) |
127 link_libraries(GoogleLog) | |
128 | |
129 else() | |
130 CHECK_INCLUDE_FILE_CXX(glog/logging.h HAVE_GOOGLE_LOG_H) | |
131 if (NOT HAVE_GOOGLE_LOG_H) | |
132 message(FATAL_ERROR "Please install the libgoogle-glog-dev package") | |
133 endif() | |
134 | |
135 link_libraries(glog) | |
136 endif() |