annotate Resources/CMake/GoogleLogConfiguration.cmake @ 1398:aa9b8fa97576

fix for msvc
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 01 Jun 2015 12:47:49 +0200
parents 704de8c30ff5
children 728c22ade2e2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
634
d775a3cb5a06 refactoring of CMake scripts
jodogne
parents: 569
diff changeset
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
5bb96a6100c0 fixes for mingw64
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 411
diff changeset
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
890
816dccaeb7cf Support of kFreeBSD
jodogne
parents: 870
diff changeset
31 if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR
930
27d256e0b458 integration mainline -> mac
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 926 890
diff changeset
32 ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" OR
1337
afaa55d42ddd FreeBSD support
jodogne
parents: 1059
diff changeset
33 ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD" OR
890
816dccaeb7cf Support of kFreeBSD
jodogne
parents: 870
diff changeset
34 ${CMAKE_SYSTEM_NAME} STREQUAL "kFreeBSD")
130
b09b0ffd9941 trying to statically build google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 105
diff changeset
35 set(ac_cv_have_unistd_h 1)
b09b0ffd9941 trying to statically build google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 105
diff changeset
36 set(ac_cv_have_stdint_h 1)
b09b0ffd9941 trying to statically build google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 105
diff changeset
37 set(ac_cv_have_systypes_h 0)
b09b0ffd9941 trying to statically build google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 105
diff changeset
38 set(ac_cv_have_inttypes_h 0)
b09b0ffd9941 trying to statically build google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 105
diff changeset
39 set(ac_cv_have_libgflags 0)
b09b0ffd9941 trying to statically build google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 105
diff changeset
40 set(ac_cv_have_uint16_t 1)
b09b0ffd9941 trying to statically build google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 105
diff changeset
41 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
42 set(ac_cv_have___uint16 0)
131
8ef8ce9fb6b3 fix of static google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 130
diff changeset
43 set(ac_cv_cxx_using_operator 1)
8ef8ce9fb6b3 fix of static google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 130
diff changeset
44 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
45 else()
131
8ef8ce9fb6b3 fix of static google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 130
diff changeset
46 set(ac_cv_have_unistd_h 0)
8ef8ce9fb6b3 fix of static google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 130
diff changeset
47 set(ac_cv_have_stdint_h 0)
8ef8ce9fb6b3 fix of static google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 130
diff changeset
48 set(ac_cv_have_systypes_h 0)
8ef8ce9fb6b3 fix of static google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 130
diff changeset
49 set(ac_cv_have_inttypes_h 0)
8ef8ce9fb6b3 fix of static google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 130
diff changeset
50 set(ac_cv_have_libgflags 0)
8ef8ce9fb6b3 fix of static google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 130
diff changeset
51 set(ac_cv_have_uint16_t 0)
8ef8ce9fb6b3 fix of static google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 130
diff changeset
52 set(ac_cv_have_u_int16_t 0)
8ef8ce9fb6b3 fix of static google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 130
diff changeset
53 set(ac_cv_have___uint16 1)
8ef8ce9fb6b3 fix of static google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 130
diff changeset
54 set(ac_cv_cxx_using_operator 1)
132
5321f3609639 fix of static google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 131
diff changeset
55 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
56 endif()
b09b0ffd9941 trying to statically build google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 105
diff changeset
57
b09b0ffd9941 trying to statically build google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 105
diff changeset
58 foreach (f ${GOOGLE_LOG_HEADERS})
b09b0ffd9941 trying to statically build google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 105
diff changeset
59 configure_file(${f}.in ${f})
b09b0ffd9941 trying to statically build google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 105
diff changeset
60 endforeach()
b09b0ffd9941 trying to statically build google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 105
diff changeset
61
102
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
62 include_directories(
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
63 ${GOOGLE_LOG_SOURCES_DIR}/src
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
64 )
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
65
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
66 if (CMAKE_COMPILER_IS_GNUCXX)
569
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 561
diff changeset
67 if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase")
561
ded40a9e8cc8 patches for lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 553
diff changeset
68 execute_process(
1362
bf6db7d2f8b1 fix slow DCMTK problem
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1337
diff changeset
69 COMMAND patch -N utilities.cc ${ORTHANC_ROOT}/Resources/Patches/glog-utilities-lsb.diff
561
ded40a9e8cc8 patches for lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 553
diff changeset
70 WORKING_DIRECTORY ${GOOGLE_LOG_SOURCES_DIR}/src
ded40a9e8cc8 patches for lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 553
diff changeset
71 )
ded40a9e8cc8 patches for lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 553
diff changeset
72 else()
ded40a9e8cc8 patches for lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 553
diff changeset
73 execute_process(
1362
bf6db7d2f8b1 fix slow DCMTK problem
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1337
diff changeset
74 COMMAND patch -N utilities.cc ${ORTHANC_ROOT}/Resources/Patches/glog-utilities.diff
561
ded40a9e8cc8 patches for lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 553
diff changeset
75 WORKING_DIRECTORY ${GOOGLE_LOG_SOURCES_DIR}/src
ded40a9e8cc8 patches for lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 553
diff changeset
76 )
ded40a9e8cc8 patches for lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 553
diff changeset
77 endif()
ded40a9e8cc8 patches for lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 553
diff changeset
78
1377
601d34afdab9 patch for recent versions of MinGW
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1362
diff changeset
79 # Patches for MinGW
102
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
80 execute_process(
1377
601d34afdab9 patch for recent versions of MinGW
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1362
diff changeset
81 #COMMAND patch -N port.h ${ORTHANC_ROOT}/Resources/Patches/glog-port-h.diff
601d34afdab9 patch for recent versions of MinGW
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1362
diff changeset
82 COMMAND patch -N port.h ${ORTHANC_ROOT}/Resources/Patches/glog-port-h-v2.diff
105
jodogne
parents: 102
diff changeset
83 WORKING_DIRECTORY ${GOOGLE_LOG_SOURCES_DIR}/src/windows
jodogne
parents: 102
diff changeset
84 )
jodogne
parents: 102
diff changeset
85 execute_process(
1362
bf6db7d2f8b1 fix slow DCMTK problem
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1337
diff changeset
86 COMMAND patch -N port.cc ${ORTHANC_ROOT}/Resources/Patches/glog-port-cc.diff
102
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
87 WORKING_DIRECTORY ${GOOGLE_LOG_SOURCES_DIR}/src/windows
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
88 )
1059
f25c79497739 patch glog for visual studio >= 11.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 983
diff changeset
89
f25c79497739 patch glog for visual studio >= 11.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 983
diff changeset
90 else(${MSVC})
f25c79497739 patch glog for visual studio >= 11.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 983
diff changeset
91 # https://code.google.com/p/google-glog/issues/detail?id=117
f25c79497739 patch glog for visual studio >= 11.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 983
diff changeset
92 configure_file(
f25c79497739 patch glog for visual studio >= 11.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 983
diff changeset
93 ${ORTHANC_ROOT}/Resources/Patches/glog-visual-studio-port.h
f25c79497739 patch glog for visual studio >= 11.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 983
diff changeset
94 ${GOOGLE_LOG_SOURCES_DIR}/src/windows/port.h
f25c79497739 patch glog for visual studio >= 11.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 983
diff changeset
95 COPYONLY)
f25c79497739 patch glog for visual studio >= 11.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 983
diff changeset
96
102
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
1059
f25c79497739 patch glog for visual studio >= 11.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 983
diff changeset
99
890
816dccaeb7cf Support of kFreeBSD
jodogne
parents: 870
diff changeset
100 if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR
930
27d256e0b458 integration mainline -> mac
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 926 890
diff changeset
101 ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" OR
1337
afaa55d42ddd FreeBSD support
jodogne
parents: 1059
diff changeset
102 ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD" OR
890
816dccaeb7cf Support of kFreeBSD
jodogne
parents: 870
diff changeset
103 ${CMAKE_SYSTEM_NAME} STREQUAL "kFreeBSD")
569
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 561
diff changeset
104 if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase")
561
ded40a9e8cc8 patches for lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 553
diff changeset
105 # Install the specific configuration for LSB SDK
ded40a9e8cc8 patches for lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 553
diff changeset
106 configure_file(
983
80d4f1618b33 Sample plugin to replace DCMTK by GDCM when decoding images
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 931
diff changeset
107 ${ORTHANC_ROOT}/Resources/CMake/GoogleLogConfigurationLSB.h
561
ded40a9e8cc8 patches for lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 553
diff changeset
108 ${GOOGLE_LOG_SOURCES_DIR}/src/config.h
ded40a9e8cc8 patches for lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 553
diff changeset
109 COPYONLY)
918
ac8f68cbdbb6 build cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 917
diff changeset
110 elseif ("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
ac8f68cbdbb6 build cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 917
diff changeset
111 # Install the specific configuration for Mac OS
ac8f68cbdbb6 build cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 917
diff changeset
112 configure_file(
983
80d4f1618b33 Sample plugin to replace DCMTK by GDCM when decoding images
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 931
diff changeset
113 ${ORTHANC_ROOT}/Resources/CMake/GoogleLogConfigurationDarwin.h
918
ac8f68cbdbb6 build cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 917
diff changeset
114 ${GOOGLE_LOG_SOURCES_DIR}/src/config.h
ac8f68cbdbb6 build cont
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 917
diff changeset
115 COPYONLY)
561
ded40a9e8cc8 patches for lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 553
diff changeset
116 else()
ded40a9e8cc8 patches for lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 553
diff changeset
117 configure_file(
983
80d4f1618b33 Sample plugin to replace DCMTK by GDCM when decoding images
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 931
diff changeset
118 ${ORTHANC_ROOT}/Resources/CMake/GoogleLogConfiguration.h
561
ded40a9e8cc8 patches for lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 553
diff changeset
119 ${GOOGLE_LOG_SOURCES_DIR}/src/config.h
ded40a9e8cc8 patches for lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 553
diff changeset
120 COPYONLY)
ded40a9e8cc8 patches for lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 553
diff changeset
121 endif()
102
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
122
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
123 set(GOOGLE_LOG_SOURCES
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
124 ${GOOGLE_LOG_SOURCES_DIR}/src/demangle.cc
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
125 ${GOOGLE_LOG_SOURCES_DIR}/src/logging.cc
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
126 ${GOOGLE_LOG_SOURCES_DIR}/src/raw_logging.cc
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
127 ${GOOGLE_LOG_SOURCES_DIR}/src/signalhandler.cc
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
128 ${GOOGLE_LOG_SOURCES_DIR}/src/symbolize.cc
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
129 ${GOOGLE_LOG_SOURCES_DIR}/src/utilities.cc
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
130 ${GOOGLE_LOG_SOURCES_DIR}/src/vlog_is_on.cc
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
131 )
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
132
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
133 elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
134 include_directories(
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
135 ${GOOGLE_LOG_SOURCES_DIR}/src/windows
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
136 )
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
137
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
138 set(GOOGLE_LOG_SOURCES
105
jodogne
parents: 102
diff changeset
139 ${GOOGLE_LOG_SOURCES_DIR}/src/windows/port.cc
102
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
140 ${GOOGLE_LOG_SOURCES_DIR}/src/logging.cc
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
141 ${GOOGLE_LOG_SOURCES_DIR}/src/raw_logging.cc
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
142 ${GOOGLE_LOG_SOURCES_DIR}/src/utilities.cc
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
143 ${GOOGLE_LOG_SOURCES_DIR}/src/vlog_is_on.cc
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
144 )
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
145
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
146 add_definitions(
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
147 -DGLOG_NO_ABBREVIATED_SEVERITIES=1
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
148 -DNO_FRAME_POINTER=1
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
149 -DGOOGLE_GLOG_DLL_DECL=
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
150 )
495
5bb96a6100c0 fixes for mingw64
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 411
diff changeset
151
5bb96a6100c0 fixes for mingw64
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 411
diff changeset
152 if (${CMAKE_COMPILER_IS_GNUCXX})
5bb96a6100c0 fixes for mingw64
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 411
diff changeset
153 # This is a patch for MinGW64
5bb96a6100c0 fixes for mingw64
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 411
diff changeset
154 add_definitions(-D_TIME_H__S=1)
5bb96a6100c0 fixes for mingw64
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 411
diff changeset
155 endif()
102
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
156 endif()
495
5bb96a6100c0 fixes for mingw64
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 411
diff changeset
157
102
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
158 add_library(GoogleLog STATIC ${GOOGLE_LOG_SOURCES})
870
f4f5ab513157 fix static builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 658
diff changeset
159 set(STATIC_GOOGLE_LOG GoogleLog)
102
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
160
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
161 else()
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
162 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
163 if (NOT HAVE_GOOGLE_LOG_H)
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
164 message(FATAL_ERROR "Please install the libgoogle-glog-dev package")
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
165 endif()
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
166
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
167 link_libraries(glog)
7593b57dc1bf switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
168 endif()
1379
d0bb3dd34e2d find build on old versions of MinGW
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1377
diff changeset
169
d0bb3dd34e2d find build on old versions of MinGW
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1377
diff changeset
170
d0bb3dd34e2d find build on old versions of MinGW
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1377
diff changeset
171 CHECK_INCLUDE_FILES(sec_api/string_s.h HAVE_SECURE_STRING_EXTENSIONS)
d0bb3dd34e2d find build on old versions of MinGW
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1377
diff changeset
172 if (HAVE_SECURE_STRING_EXTENSIONS)
d0bb3dd34e2d find build on old versions of MinGW
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1377
diff changeset
173 add_definitions(-DHAVE_SECURE_STRING_EXTENSIONS=1)
d0bb3dd34e2d find build on old versions of MinGW
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1377
diff changeset
174 else()
d0bb3dd34e2d find build on old versions of MinGW
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1377
diff changeset
175 add_definitions(-DHAVE_SECURE_STRING_EXTENSIONS=0)
d0bb3dd34e2d find build on old versions of MinGW
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1377
diff changeset
176 endif()
1397
704de8c30ff5 modularization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1379
diff changeset
177
704de8c30ff5 modularization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1379
diff changeset
178 add_definitions(-DHAVE_GOOGLE_LOG=1)