-
Notifications
You must be signed in to change notification settings - Fork 96
/
CMakeLists.txt
56 lines (41 loc) · 1.3 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
CMAKE_MINIMUM_REQUIRED(VERSION 3.1)
SET(CMAKE_CXX_STANDARD 11)
SET(CMAKE_CXX_STANDARD_REQUIRED ON)
PROJECT(CuteLogger)
FIND_PACKAGE(Qt5Core REQUIRED)
ADD_DEFINITIONS(-DCUTELOGGER_LIBRARY)
INCLUDE_DIRECTORIES(BEFORE include)
SET(sources
src/Logger.cpp
src/AbstractAppender.cpp
src/AbstractStringAppender.cpp
src/ConsoleAppender.cpp
src/FileAppender.cpp
src/RollingFileAppender.cpp
)
SET(includes
include/Logger.h
include/FileAppender.h
include/CuteLogger_global.h
include/ConsoleAppender.h
include/AbstractStringAppender.h
include/AbstractAppender.h
include/RollingFileAppender.h
)
# OutputDebugAppender is only for Windows systems
IF(WIN32)
SET(sources ${sources} src/OutputDebugAppender.cpp)
SET(includes ${includes} include/OutputDebugAppender.h)
ENDIF(WIN32)
SET(library_target CuteLogger)
ADD_LIBRARY(${library_target} SHARED ${sources} ${includes})
TARGET_LINK_LIBRARIES(${library_target} Qt5::Core)
TARGET_INCLUDE_DIRECTORIES(${library_target} PUBLIC include)
INSTALL(TARGETS ${library_target} DESTINATION lib)
SET(ENABLE_TESTS OFF CACHE BOOL "Enable building CuteLogger tests")
IF (ENABLE_TESTS)
SET(CMAKE_AUTOMOC ON)
FIND_PACKAGE(Qt5Test REQUIRED)
ADD_EXECUTABLE(basictest test/basictest.cpp)
TARGET_LINK_LIBRARIES(basictest Qt5::Core Qt5::Test CuteLogger)
ENDIF ()