-
Notifications
You must be signed in to change notification settings - Fork 13
/
CMakeLists.txt
62 lines (49 loc) · 1.8 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
# Minimum CMake required
cmake_minimum_required(VERSION 3.11)
# Project
project(yara-ttd LANGUAGES C VERSION 1.0.0)
# Opions
option(BUILD_TESTS "Build test programs" OFF)
#option(INSTALL_TTDDLL "Try to find and install ttd dll from Windbg Preview install folder" OFF)
# Config
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
SET(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
# Add cmake folder for
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
# Install ttd dlls if it's requested
# Use when generate installer
if (WindbgPreview_INSTALL_PATH)
message(STATUS "Find package TTD")
find_package(TTDReplay)
INSTALL_TTDREPLAY("${EXECUTABLE_OUTPUT_PATH}")
endif (WindbgPreview_INSTALL_PATH)
# Yara library
add_subdirectory(yara)
# The yarattd library
add_subdirectory(libyarattd)
# The yara-ttd executable program
add_subdirectory(yara-ttd)
# Tests
if(BUILD_TESTS)
add_subdirectory(tests)
endif(BUILD_TESTS)
# Summary
message(STATUS "Configuration summary")
message(STATUS "Project name : ${PROJECT_NAME}")
message(STATUS "Project version : ${PROJECT_VERSION}")
message(STATUS "Build Tests : ${BUILD_TESTS}")
message(STATUS "Install TTD Dlls : ${WindbgPreview_INSTALL_PATH}")
# CPack part
if(WIN32)
set(CPACK_GENERATOR "WIX")
set(CPACK_WIX_UPGRADE_GUID "512bd205-eebf-440d-b750-7b5e98b57d81")
set(CPACK_WIX_UNINSTALL "1")
if(NOT WindbgPreview_INSTALL_PATH)
set(CPACK_WIX_PATCH_FILE "${CMAKE_CURRENT_SOURCE_DIR}/install/patch.xml")
endif(NOT WindbgPreview_INSTALL_PATH)
set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/install\\\\CERT-blue-short.bmp")
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.txt")
endif()
include(CPack)