-
Notifications
You must be signed in to change notification settings - Fork 26
/
CMakeLists.txt
74 lines (57 loc) · 2.39 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
cmake_minimum_required(VERSION 3.8)
project(RenHook LANGUAGES CXX VERSION 1.0.0)
# Properties.
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# Variables.
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED YES)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/libs")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
foreach(configuration ${CMAKE_CONFIGURATION_TYPES})
string(TOLOWER ${configuration} configuration_lower)
string(TOUPPER ${configuration} configuration_upper)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${configuration_upper} "${CMAKE_BINARY_DIR}/${configuration_lower}/libs")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_${configuration_upper} "${CMAKE_BINARY_DIR}/${configuration_lower}/bin")
endforeach()
# Options.
option(RENHOOK_ENABLE_TESTS "Build unit tests" ON)
# Dependencies.
# Catch2
if(RENHOOK_ENABLE_TESTS)
set(CATCH_BUILD_STATIC_LIBRARY OFF CACHE INTERNAL "")
set(BUILD_TESTING OFF CACHE INTERNAL "")
set(CATCH_USE_VALGRIND OFF CACHE INTERNAL "")
set(CATCH_BUILD_TESTING OFF CACHE INTERNAL "")
set(CATCH_BUILD_EXAMPLES OFF CACHE INTERNAL "")
set(CATCH_BUILD_EXTRA_TESTS OFF CACHE INTERNAL "")
set(CATCH_ENABLE_COVERAGE OFF CACHE INTERNAL "")
set(CATCH_ENABLE_WERROR OFF CACHE INTERNAL "")
set(CATCH_INSTALL_DOCS OFF CACHE INTERNAL "")
set(CATCH_INSTALL_HELPERS OFF CACHE INTERNAL "")
add_subdirectory(deps/catch2)
endif()
# Zydis
set(ZYAN_DEV_MODE OFF CACHE INTERNAL "")
set(ZYAN_NO_LIBC OFF CACHE INTERNAL "")
set(ZYAN_WHOLE_PROGRAM_OPTIMIZATION OFF CACHE INTERNAL "")
set(ZYCORE_BUILD_EXAMPLES OFF CACHE INTERNAL "")
set(ZYCORE_BUILD_SHARED_LIB OFF CACHE INTERNAL "")
set(ZYCORE_BUILD_TESTS OFF CACHE INTERNAL "")
set(ZYDIS_BUILD_EXAMPLES OFF CACHE INTERNAL "")
set(ZYDIS_BUILD_SHARED_LIB OFF CACHE INTERNAL "")
set(ZYDIS_BUILD_TOOLS OFF CACHE INTERNAL "")
set(ZYDIS_FEATURE_AVX512 ON CACHE INTERNAL "")
set(ZYDIS_FEATURE_DECODER ON CACHE INTERNAL "")
set(ZYDIS_FEATURE_FORMATTER ON CACHE INTERNAL "")
set(ZYDIS_FEATURE_KNC ON CACHE INTERNAL "")
set(ZYDIS_FUZZ_AFL_FAST OFF CACHE INTERNAL "")
set(ZYDIS_LIBFUZZER OFF CACHE INTERNAL "")
set(ZYDIS_MINIMAL_MODE OFF CACHE INTERNAL "")
add_subdirectory(deps/zydis)
set_target_properties(Zydis PROPERTIES FOLDER "Dependencies")
set_target_properties(Zycore PROPERTIES FOLDER "Dependencies")
# Projects.
add_subdirectory(src)
if(RENHOOK_ENABLE_TESTS)
add_subdirectory(tests)
endif()