annotate Resources/CMake/GoogleLogConfiguration.cmake @ 352:cc9eddbf07d3

sample to anonymize patients
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 28 Jan 2013 16:43:49 +0100
parents bdc60d16cc98
children b45bc565d82a 61ab5fa36754
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
134
bdc60d16cc98 improved cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 132
diff changeset
1 if (STATIC_BUILD OR NOT USE_DYNAMIC_GOOGLE_LOG)
102
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 SET(GOOGLE_LOG_SOURCES_DIR ${CMAKE_BINARY_DIR}/glog-0.3.2)
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 DownloadPackage("http://google-glog.googlecode.com/files/glog-0.3.2.tar.gz" "${GOOGLE_LOG_SOURCES_DIR}" "" "")
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4
130
b09b0ffd9941 trying to statically build google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 105
diff changeset
5 set(GOOGLE_LOG_HEADERS
b09b0ffd9941 trying to statically build google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 105
diff changeset
6 ${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
7 ${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
8 ${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
9 ${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
10 )
b09b0ffd9941 trying to statically build google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 105
diff changeset
11
131
8ef8ce9fb6b3 fix of static google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 130
diff changeset
12 set(ac_google_namespace google)
8ef8ce9fb6b3 fix of static google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 130
diff changeset
13 set(ac_google_start_namespace "namespace google {")
8ef8ce9fb6b3 fix of static google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 130
diff changeset
14 set(ac_google_end_namespace "}")
8ef8ce9fb6b3 fix of static google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 130
diff changeset
15
130
b09b0ffd9941 trying to statically build google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 105
diff changeset
16 if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
b09b0ffd9941 trying to statically build google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 105
diff changeset
17 set(ac_cv_have_unistd_h 1)
b09b0ffd9941 trying to statically build google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 105
diff changeset
18 set(ac_cv_have_stdint_h 1)
b09b0ffd9941 trying to statically build google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 105
diff changeset
19 set(ac_cv_have_systypes_h 0)
b09b0ffd9941 trying to statically build google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 105
diff changeset
20 set(ac_cv_have_inttypes_h 0)
b09b0ffd9941 trying to statically build google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 105
diff changeset
21 set(ac_cv_have_libgflags 0)
b09b0ffd9941 trying to statically build google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 105
diff changeset
22 set(ac_cv_have_uint16_t 1)
b09b0ffd9941 trying to statically build google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 105
diff changeset
23 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
24 set(ac_cv_have___uint16 0)
131
8ef8ce9fb6b3 fix of static google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 130
diff changeset
25 set(ac_cv_cxx_using_operator 1)
8ef8ce9fb6b3 fix of static google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 130
diff changeset
26 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
27 else()
131
8ef8ce9fb6b3 fix of static google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 130
diff changeset
28 set(ac_cv_have_unistd_h 0)
8ef8ce9fb6b3 fix of static google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 130
diff changeset
29 set(ac_cv_have_stdint_h 0)
8ef8ce9fb6b3 fix of static google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 130
diff changeset
30 set(ac_cv_have_systypes_h 0)
8ef8ce9fb6b3 fix of static google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 130
diff changeset
31 set(ac_cv_have_inttypes_h 0)
8ef8ce9fb6b3 fix of static google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 130
diff changeset
32 set(ac_cv_have_libgflags 0)
8ef8ce9fb6b3 fix of static google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 130
diff changeset
33 set(ac_cv_have_uint16_t 0)
8ef8ce9fb6b3 fix of static google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 130
diff changeset
34 set(ac_cv_have_u_int16_t 0)
8ef8ce9fb6b3 fix of static google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 130
diff changeset
35 set(ac_cv_have___uint16 1)
8ef8ce9fb6b3 fix of static google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 130
diff changeset
36 set(ac_cv_cxx_using_operator 1)
132
5321f3609639 fix of static google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 131
diff changeset
37 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
38 endif()
b09b0ffd9941 trying to statically build google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 105
diff changeset
39
b09b0ffd9941 trying to statically build google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 105
diff changeset
40 foreach (f ${GOOGLE_LOG_HEADERS})
b09b0ffd9941 trying to statically build google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 105
diff changeset
41 configure_file(${f}.in ${f})
b09b0ffd9941 trying to statically build google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 105
diff changeset
42 endforeach()
b09b0ffd9941 trying to statically build google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 105
diff changeset
43
102
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 include_directories(
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 ${GOOGLE_LOG_SOURCES_DIR}/src
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 )
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48 if (CMAKE_COMPILER_IS_GNUCXX)
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49 execute_process(
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 COMMAND patch utilities.cc ${CMAKE_SOURCE_DIR}/Resources/Patches/glog-utilities.diff
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51 WORKING_DIRECTORY ${GOOGLE_LOG_SOURCES_DIR}/src
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52 )
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53 execute_process(
105
jodogne
parents: 102
diff changeset
54 COMMAND patch port.h ${CMAKE_SOURCE_DIR}/Resources/Patches/glog-port-h.diff
jodogne
parents: 102
diff changeset
55 WORKING_DIRECTORY ${GOOGLE_LOG_SOURCES_DIR}/src/windows
jodogne
parents: 102
diff changeset
56 )
jodogne
parents: 102
diff changeset
57 execute_process(
jodogne
parents: 102
diff changeset
58 COMMAND patch port.cc ${CMAKE_SOURCE_DIR}/Resources/Patches/glog-port-cc.diff
102
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59 WORKING_DIRECTORY ${GOOGLE_LOG_SOURCES_DIR}/src/windows
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60 )
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61 endif()
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
62
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
63 if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
64 configure_file(
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
65 ${CMAKE_SOURCE_DIR}/Resources/CMake/GoogleLogConfiguration.h
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
66 ${GOOGLE_LOG_SOURCES_DIR}/src/config.h
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
67 COPYONLY)
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
68
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
69 set(GOOGLE_LOG_SOURCES
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70 ${GOOGLE_LOG_SOURCES_DIR}/src/demangle.cc
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71 ${GOOGLE_LOG_SOURCES_DIR}/src/logging.cc
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72 ${GOOGLE_LOG_SOURCES_DIR}/src/raw_logging.cc
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73 ${GOOGLE_LOG_SOURCES_DIR}/src/signalhandler.cc
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74 ${GOOGLE_LOG_SOURCES_DIR}/src/symbolize.cc
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
75 ${GOOGLE_LOG_SOURCES_DIR}/src/utilities.cc
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
76 ${GOOGLE_LOG_SOURCES_DIR}/src/vlog_is_on.cc
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
77 )
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
78
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
79 elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
80 include_directories(
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
81 ${GOOGLE_LOG_SOURCES_DIR}/src/windows
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
82 )
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
83
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
84 set(GOOGLE_LOG_SOURCES
105
jodogne
parents: 102
diff changeset
85 ${GOOGLE_LOG_SOURCES_DIR}/src/windows/port.cc
102
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
86 ${GOOGLE_LOG_SOURCES_DIR}/src/logging.cc
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
87 ${GOOGLE_LOG_SOURCES_DIR}/src/raw_logging.cc
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
88 ${GOOGLE_LOG_SOURCES_DIR}/src/utilities.cc
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
89 ${GOOGLE_LOG_SOURCES_DIR}/src/vlog_is_on.cc
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
90 )
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
91
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
92 add_definitions(
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
93 -DGLOG_NO_ABBREVIATED_SEVERITIES=1
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
94 -DNO_FRAME_POINTER=1
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
95 -DGOOGLE_GLOG_DLL_DECL=
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
96 )
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
97 endif()
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
98
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
99 add_library(GoogleLog STATIC ${GOOGLE_LOG_SOURCES})
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
100 link_libraries(GoogleLog)
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
101
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
102 else()
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
103 CHECK_INCLUDE_FILE_CXX(glog/logging.h HAVE_GOOGLE_LOG_H)
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
104 if (NOT HAVE_GOOGLE_LOG_H)
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
105 message(FATAL_ERROR "Please install the libgoogle-glog-dev package")
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
106 endif()
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
107
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
108 link_libraries(glog)
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
109 endif()