blob: 4a2753ffc101006075504ddcadac7cfb30c1d940 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
|
diff --git a/qt4debugappender/CMakeLists.txt b/qt4debugappender/CMakeLists.txt
index 2f28be5..0a98704 100644
--- a/qt4debugappender/CMakeLists.txt
+++ b/qt4debugappender/CMakeLists.txt
@@ -4,15 +4,17 @@ set (qt4debugappender_sources
if (${BUILD_SHARED_LIBS})
add_definitions (-D${log4cplus}_EXPORTS)
endif ()
-if (UNICODE)
- add_definitions (-DUNICODE -D_UNICODE -UMBCS -U_MBCS)
-endif (UNICODE)
find_package (Qt4 REQUIRED)
include (${QT_USE_FILE})
set (qt4debugappender log4cplusqt4debugappender${log4cplus_postfix})
add_library (${qt4debugappender} ${qt4debugappender_sources})
+if (UNICODE)
+ target_compile_definitions (${qt4debugappender} PUBLIC UNICODE)
+ target_compile_definitions (${qt4debugappender} PUBLIC _UNICODE)
+ add_definitions (-UMBCS -U_MBCS)
+endif (UNICODE)
target_link_libraries (${qt4debugappender}
${log4cplus}
${QT_LIBRARIES}
diff --git a/qt5debugappender/CMakeLists.txt b/qt5debugappender/CMakeLists.txt
index 9570e76..de6fecf 100644
--- a/qt5debugappender/CMakeLists.txt
+++ b/qt5debugappender/CMakeLists.txt
@@ -4,15 +4,17 @@ set (qt5debugappender_sources
if (${BUILD_SHARED_LIBS})
add_definitions (-D${log4cplus}_EXPORTS)
endif ()
-if (UNICODE)
- add_definitions (-DUNICODE -D_UNICODE -UMBCS -U_MBCS)
-endif (UNICODE)
find_package (Qt5Core REQUIRED)
#include (${QT_USE_FILE})
set (qt5debugappender log4cplusqt5debugappender${log4cplus_postfix})
add_library (${qt5debugappender} ${qt5debugappender_sources})
+if (UNICODE)
+ target_compile_definitions (${qt5debugappender} PUBLIC UNICODE)
+ target_compile_definitions (${qt5debugappender} PUBLIC _UNICODE)
+ add_definitions (-UMBCS -U_MBCS)
+endif (UNICODE)
target_link_libraries (${qt5debugappender}
${log4cplus}
${Qt5Widgets_LIBRARIES}
diff --git a/simpleserver/CMakeLists.txt b/simpleserver/CMakeLists.txt
index e535120..5202f42 100644
--- a/simpleserver/CMakeLists.txt
+++ b/simpleserver/CMakeLists.txt
@@ -1,14 +1,15 @@
-if (UNICODE)
- add_definitions (-DUNICODE -D_UNICODE -UMBCS -U_MBCS)
-endif (UNICODE)
-
message (STATUS "Threads: ${CMAKE_THREAD_LIBS_INIT}")
-
set (loggingserver_sources loggingserver.cxx)
message (STATUS "Sources: ${loggingserver_sources}")
-add_executable (loggingserver ${loggingserver_sources})
-target_link_libraries (loggingserver ${log4cplus})
+set (loggingserver loggingserver${log4cplus_postfix})
+add_executable (${loggingserver} ${loggingserver_sources})
+if (UNICODE)
+ target_compile_definitions (${loggingserver} PUBLIC UNICODE)
+ target_compile_definitions (${loggingserver} PUBLIC _UNICODE)
+ add_definitions (-UMBCS -U_MBCS)
+endif (UNICODE)
+target_link_libraries (${loggingserver} ${log4cplus})
-install(TARGETS loggingserver DESTINATION ${CMAKE_INSTALL_BINDIR})
+install(TARGETS ${loggingserver} DESTINATION ${CMAKE_INSTALL_BINDIR})
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index b7b7ad8..91e0c63 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -67,9 +67,6 @@ endif ()
# Define _GNU_SOURCE so that functions like `pipe2()` are visible.
add_definitions (-D_GNU_SOURCE=1)
-if (UNICODE)
- add_definitions (-DUNICODE -D_UNICODE -UMBCS -U_MBCS)
-endif (UNICODE)
if (WIN32)
add_definitions (-DMINGW_HAS_SECURE_API=1)
add_definitions (-D_WIN32_WINNT=${_WIN32_WINNT})
@@ -85,6 +82,12 @@ endif (WIN32)
add_library (${log4cplus} ${log4cplus_sources})
+if (UNICODE)
+ target_compile_definitions (${log4cplus} PUBLIC UNICODE)
+ target_compile_definitions (${log4cplus} PUBLIC _UNICODE)
+ add_definitions (-UMBCS -U_MBCS)
+endif (UNICODE)
+
set (log4cplus_LIBS ${CMAKE_THREAD_LIBS_INIT})
if (LIBRT)
list (APPEND log4cplus_LIBS ${LIBRT})
|