-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
36 lines (26 loc) · 1.15 KB
/
CMakeLists.txt
File metadata and controls
36 lines (26 loc) · 1.15 KB
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
cmake_minimum_required(VERSION 3.10)
# Set the project name
project(mce_encryption_server_cpp)
# Set the C++ standard
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
# Specify where Boost is installed (adjust this path if necessary)
if (WIN32)
set(BOOST_ROOT "C:/local/boost_1_81_0")
set(Boost_INCLUDE_DIR "C:/local/boost_1_81_0/boost")
endif()
# Add the Boost library dependency
find_package(Boost REQUIRED COMPONENTS system)
# Specify the location of the static library
set(MCE_CLIENT_AUTH_LIB ${CMAKE_SOURCE_DIR}/libMCEClientAuth.a)
# Add the executable
add_executable(mce_encryption_server_cpp main.cc)
# Include the current directory to find MCEClientAuth.h
target_include_directories(mce_encryption_server_cpp PRIVATE ${CMAKE_SOURCE_DIR})
# Link the static library and Boost libraries
target_link_libraries(mce_encryption_server_cpp PRIVATE ${MCE_CLIENT_AUTH_LIB} Boost::system)
# If additional dependencies like pthread are needed (for Boost), link them
find_package(Threads REQUIRED)
target_link_libraries(mce_encryption_server_cpp PRIVATE Threads::Threads)
# Disable PIE
target_link_options(mce_encryption_server_cpp PRIVATE -no-pie)