-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
49 lines (39 loc) · 1.27 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
cmake_minimum_required(VERSION 3.10)
project(TCPServerCLI)
# Specify the C++ standard
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
# Include directories
include_directories(include)
# Source files
set(SOURCES
src/main.cpp
src/clientManager.cpp
src/ClientResponse.cpp
src/ServerQueries.cpp
src/tcpNetworkManager.cpp
)
# Header files
set(HEADERS
include/clientManager.h
include/ClientResponse.h
include/ServerQueries.h
include/tcpNetworkManager.h
)
# Group source files
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/src PREFIX "Source Files" FILES ${SOURCES})
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/include PREFIX "Header Files" FILES ${HEADERS})
# Enable Unicode
add_definitions(-D_UNICODE -DUNICODE)
# Set runtime library to /MT for release builds [make it standalone, without requiring the Visual C++ Redistributable package on the target system]
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
# Executable
add_executable(TCPServerCLI ${SOURCES} ${HEADERS})
# Link with Ws2_32.lib
target_link_libraries(TCPServerCLI Ws2_32)
# Handle 32-bit and 64-bit builds
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
message(STATUS "Configuring for 64-bit build")
else()
message(STATUS "Configuring for 32-bit build")
endif()