-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
37 lines (30 loc) · 944 Bytes
/
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
cmake_minimum_required(VERSION 3.10)
# Set vcpkg toolchain file before project() command
set(CMAKE_TOOLCHAIN_FILE "C:/Program Files/vcpkg/scripts/buildsystems/vcpkg.cmake"
CACHE STRING "")
project(KRXDNSChecker)
# Set C++ standard
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Find CURL package
find_package(CURL CONFIG REQUIRED)
# Add executable with source file in src directory
add_executable(KRXDNSChecker src/main.cpp)
# Windows-specific configuration
if(WIN32)
# Add Windows-specific libraries
target_link_libraries(KRXDNSChecker
winhttp
dnsapi
iphlpapi
ws2_32
CURL::libcurl
)
# Request administrator privileges in the manifest
if(MSVC)
set_target_properties(KRXDNSChecker PROPERTIES
WIN32_EXECUTABLE FALSE
LINK_FLAGS "/manifestuac:\"level='requireAdministrator' uiAccess='false'\""
)
endif()
endif()