-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
65 lines (55 loc) · 1.89 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
cmake_minimum_required(VERSION 3.13)
project(FTPServer)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_COMPILER $ENV{CC} clang++-7)
#set(CMAKE_CXX_COMPILER /usr/bin/g++)
add_compile_options(-W -Wall -g)
include_directories(.)
set(SRC
src/main/util/Def.hpp
src/main/tools/FileSystem.hpp
src/main/core/FTP.hpp
src/main/tools/ListFiles.hpp
src/main/main.cpp
src/main/util/NetUtility.hpp
src/main/core/NetworkManager.hpp
src/main/core/Login.hpp
src/main/core/Session.hpp
src/main/tools/ThreadPool.hpp
src/main/util/ThreadUtility.hpp
src/main/util/Utility.hpp
src/main/config/Config.hpp
)
set(UtilTestSrc
src/test/util/main.cpp
src/test/util/UtilityTest.hpp
src/test/util/config.hpp
)
set(ToolsTestSrc
src/test/tools/main.cpp
src/test/tools/ThreadPoolTest.hpp
src/test/tools/OtherToolsTest.hpp
src/test/tools/config.hpp
)
set(CoreTestSrc
src/test/core/main.cpp
src/test/core/OtherTest.hpp
src/test/core/FTPTest.hpp
src/test/core/config.hpp
)
add_executable(${PROJECT_NAME} ${SRC})
add_executable(UtilTest ${UtilTestSrc})
add_executable(ToolsTest ${ToolsTestSrc})
add_executable(CoreTest ${CoreTestSrc})
enable_testing()
add_test(UTest UtilTest)
add_test(TTest ToolsTest)
add_test(CTest CoreTest)
#target_compile_options(UtilTest PUBLIC -fprofile-arcs -ftest-coverage)
#target_compile_options(ToolsTest PUBLIC -fprofile-arcs -ftest-coverage)
target_link_libraries(${PROJECT_NAME} -lpthread -rdynamic -lcrypt)
#target_link_libraries(UtilTest -lpthread -rdynamic -lgcov --coverage)
#target_link_libraries(ToolsTest -lpthread -rdynamic -lgcov --coverage)
target_link_libraries(UtilTest -lpthread -rdynamic)
target_link_libraries(ToolsTest -lpthread -rdynamic)
target_link_libraries(CoreTest -lcrypt -lpthread -rdynamic)