-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
executable file
·100 lines (92 loc) · 2.62 KB
/
CMakeLists.txt
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
#
# Nicholas Yue [email protected]
#
# Note:
# (1) A dummy file include/config.h is required (remance from configure)
# (2) Default installation directory is /usr/local, override with -DCMAKE_INSTALL_PREFIX="" during cmake
# invocation
# (3) Do the usual "make clean all" to build the library
# (4) To install either "make install" or "make install DESTDIR=<your directory>"
# (5) Need to include changes in include/log4cpp/Portability.hh for OSX to build
PROJECT ( LOG4CPP )
INCLUDE_DIRECTORIES ( include )
INCLUDE_DIRECTORIES ( . )
IF (WIN32)
ADD_DEFINITIONS ( -D_CRT_SECURE_NO_WARNINGS )
ELSE (WIN32)
IF (APPLE)
ADD_DEFINITIONS ( -DNDEBUG -DLOG4CPP_HAVE_SSTREAM )
ELSE (APPLE)
ADD_DEFINITIONS ( -pthread -DNDEBUG -DLOG4CPP_HAVE_SSTREAM )
ENDIF (APPLE)
ENDIF (WIN32)
IF ( CMAKE_BUILD_TYPE MATCHES "Debug" )
SET ( LOG4CPP_LIBRARY_NAME "log4cppD" )
ELSE ( CMAKE_BUILD_TYPE MATCHES "Debug" )
SET ( LOG4CPP_LIBRARY_NAME "log4cpp" )
ENDIF ( CMAKE_BUILD_TYPE MATCHES "Debug" )
ADD_LIBRARY ( ${LOG4CPP_LIBRARY_NAME}
src/Appender.cpp
src/AppenderSkeleton.cpp
src/AppendersFactory.cpp
src/BufferingAppender.cpp
src/FactoryParams.cpp
src/LayoutsFactory.cpp
src/LevelEvaluator.cpp
src/Localtime.cpp
src/PassThroughLayout.cpp
src/TriggeringEventEvaluatorFactory.cpp
src/LayoutAppender.cpp
src/FileAppender.cpp
src/DailyRollingFileAppender.cpp
src/RollingFileAppender.cpp
src/FixedContextCategory.cpp
src/IdsaAppender.cpp
src/OstreamAppender.cpp
src/StringQueueAppender.cpp
src/SyslogAppender.cpp
src/RemoteSyslogAppender.cpp
src/SimpleLayout.cpp
src/BasicLayout.cpp
src/PatternLayout.cpp
src/Category.cpp
src/CategoryStream.cpp
src/HierarchyMaintainer.cpp
src/Configurator.cpp
src/BasicConfigurator.cpp
src/SimpleConfigurator.cpp
src/PropertyConfigurator.cpp
src/PropertyConfiguratorImpl.cpp
src/LoggingEvent.cpp
src/Priority.cpp
src/NDC.cpp
src/Filter.cpp
src/TimeStamp.cpp
src/StringUtil.cpp
src/Properties.cpp
src/Win32DebugAppender.cpp
src/NTEventLogAppender.cpp
src/DllMain.cpp
src/DummyThreads.cpp
src/MSThreads.cpp
src/OmniThreads.cpp
src/PThreads.cpp
src/PortabilityImpl.cpp
src/AbortAppender.cpp
)
IF (WIN32)
TARGET_LINK_LIBRARIES (${LOG4CPP_LIBRARY_NAME} kernel32 user32 ws2_32 advapi32 )
SET_TARGET_PROPERTIES(${LOG4CPP_LIBRARY_NAME} PROPERTIES LINK_FLAGS /NODEFAULTLIB:msvcrt )
ENDIF (WIN32)
INSTALL (
DIRECTORY include/log4cpp
DESTINATION include
PATTERN "config.h" EXCLUDE
PATTERN ".svn" EXCLUDE
PATTERN "*.am" EXCLUDE
PATTERN "*.in" EXCLUDE
)
INSTALL (
TARGETS ${LOG4CPP_LIBRARY_NAME}
ARCHIVE DESTINATION lib
)