-
Notifications
You must be signed in to change notification settings - Fork 5
/
CMakeLists.txt
71 lines (50 loc) · 1.81 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
cmake_minimum_required(VERSION 3.16.0)
project(GenshinImpactPianoExtract VERSION 0.1.3)
cmake_policy(SET CMP0048 NEW)
include(CTest)
enable_testing()
set(CMAKE_CXX_STANDARD 20)
if(WIN32)
set(OpenCV_DIR D:/Downloads/opencv/build/)
endif()
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
if(WIN32)
add_definitions(-D_HAS_STD_BYTE=0)
add_compile_options(/utf-8)
endif()
if(CMAKE_BUILD_TYPE)
if(CMAKE_BUILD_TYPE STREQUAL Debug)
if(WIN32)
add_compile_options(/fsanitize=address)
else()
add_compile_options(-fsanitize=address)
add_link_options(-fsanitize=address)
endif()
endif()
endif()
aux_source_directory(src GenshinImpactPianoExtract_SRC)
add_executable(GenshinImpactPianoExtract ${GenshinImpactPianoExtract_SRC})
add_subdirectory(dependencies)
find_package(OpenCV REQUIRED)
target_include_directories(GenshinImpactPianoExtract PUBLIC ${OpenCV_INCLUDE_DIRS})
target_include_directories(GenshinImpactPianoExtract PUBLIC ${ftxui_INCLUDE_DIRS})
target_include_directories(GenshinImpactPianoExtract PUBLIC dependencies)
target_include_directories(GenshinImpactPianoExtract PUBLIC src)
configure_file(${PROJECT_SOURCE_DIR}/src/buildconfig.h.in ${PROJECT_SOURCE_DIR}/src/buildconfig.h)
target_link_libraries(GenshinImpactPianoExtract PRIVATE ${OpenCV_LIBS})
target_link_libraries(GenshinImpactPianoExtract
PRIVATE ftxui::screen
PRIVATE ftxui::dom
PRIVATE ftxui::component
PRIVATE midifile
)
find_package(OpenMP)
if(OpenMP_CXX_FOUND)
target_link_libraries(GenshinImpactPianoExtract PRIVATE OpenMP::OpenMP_CXX)
endif()
set_target_properties(GenshinImpactPianoExtract PROPERTIES CXX_STANDARD 20)
set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
include(CPack)