forked from spc476/SPCDNS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
53 lines (43 loc) · 1.12 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
project(SPCDNS LANGUAGES CXX)
cmake_minimum_required(VERSION 3.13.0)
if (NOT WIN32)
message(FATAL_ERROR "Unsupported platform")
endif()
include(Version.cmake)
set(${PROJECT_NAME}_INCLUDE
src/dns.h
src/mappings.h
src/output.h)
set(${PROJECT_NAME}_SOURCE
src/codec.c
src/mappings.c
src/output.c
)
configure_file(Resource.rc.in Resource.rc @ONLY)
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/Resource.rc PROPERTIES GENERATED 1)
set(${PROJECT_NAME}_RESOURCE
${CMAKE_CURRENT_BINARY_DIR}/Resource.rc
)
source_group("resource" FILES ${${PROJECT_NAME}_RESOURCE})
source_group("include" FILES ${${PROJECT_NAME}_INCLUDE})
source_group("source" FILES ${${PROJECT_NAME}_SOURCE})
add_library(${PROJECT_NAME} SHARED
${${PROJECT_NAME}_INCLUDE}
${${PROJECT_NAME}_SOURCE}
${${PROJECT_NAME}_RESOURCE}
)
target_compile_options(${PROJECT_NAME}
PRIVATE
$<$<CXX_COMPILER_ID:MSVC>:
/MP /W3 /Zf>
)
target_include_directories(${PROJECT_NAME}
PUBLIC
${PROJECT_SOURCE_DIR}/src
)
target_link_libraries(${PROJECT_NAME}
PUBLIC
Ws2_32
iphlpapi
Ntdll
)