-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
executable file
·57 lines (46 loc) · 1.88 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
cmake_minimum_required(VERSION 3.6)
project(qin)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/../)
add_subdirectory(${CMAKE_SOURCE_DIR}/HttpServer)
#cmake中指定生成64位程序
set(CMAKE_GENERATOR_PLATFORM x64)
aux_source_directory(. DIR_SRCS)
aux_source_directory(./protocol DIR_SRCS)
aux_source_directory(./protocol/ImageJsonData DIR_SRCS)
aux_source_directory(./module DIR_SRCS)
aux_source_directory(./MysqlQuery DIR_SRCS)
aux_source_directory(./ChatClient DIR_SRCS)
aux_source_directory(./ChatServer DIR_SRCS)
include_directories("${PROJECT_SOURCE_DIR}/MysqlQuery")
include_directories("${PROJECT_SOURCE_DIR}/ChatServer")
include_directories("${PROJECT_SOURCE_DIR}/ChatClient")
include_directories("${PROJECT_SOURCE_DIR}/protocol")
include_directories("${PROJECT_SOURCE_DIR}/protocol/ImageJsonData")
include_directories("${PROJECT_SOURCE_DIR}/module")
include_directories("${PROJECT_SOURCE_DIR}")
include_directories("${PROJECT_SOURCE_DIR}/include")
if(WIN32)
include_directories("C:/Program Files/MySQL/MySQL Server 8.0/include")
endif()
# add_subdirectory(MysqlQuery)
# add_subdirectory(ChatClient)
# add_subdirectory(ChatServer)
# add_subdirectory(protocol)
# add_subdirectory(module)
link_directories("${PROJECT_SOURCE_DIR}/lib")
add_executable(qin ${DIR_SRCS})
# TARGET_LINK_LIBRARIES(qin MysqlQueryLib)
# TARGET_LINK_LIBRARIES(qin ChatServerLib)
# TARGET_LINK_LIBRARIES(qin ChatClientLib)
# TARGET_LINK_LIBRARIES(qin ProtocolLib)
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_SYSTEM_NAME STREQUAL "Windows")
target_link_libraries(qin mysqlclient)
elif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_SYSTEM_NAME STREQUAL "Linux")
target_link_libraries(qin mysqlclient boost_thread log4cxx)
else()
target_link_libraries(qin mysqlclient log4cxx)
endif()
# target_link_libraries(qin LogLib)
if(UNIX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -pthread")
endif()