-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
43 lines (36 loc) · 1.19 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
CMAKE_MINIMUM_REQUIRED(VERSION 3.20)
PROJECT(todomgr VERSION 0.1)
SET(BUILD_SHARED_LIBS ON)
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY build/)
SET(CMAKE_EXPORT_COMPILE_COMMANDS TRUE)
SET(CMAKE_CXX_FLAGS -g)
AUX_SOURCE_DIRECTORY(src/ DIR_SRC)
ADD_EXECUTABLE(${PROJECT_NAME} ${DIR_SRC})
# -------------------FTXUI--------------------- #
INCLUDE(FetchContent)
FetchContent_Declare(ftxui
GIT_REPOSITORY https://github.com/ArthurSonzogni/ftxui
GIT_TAG v5.0.0
)
FetchContent_GetProperties(ftxui)
IF(NOT ftxui_POPULATED)
FetchContent_Populate(ftxui)
ADD_SUBDIRECTORY(${ftxui_SOURCE_DIR} ${ftxui_BINARY_DIR} EXCLUDE_FROM_ALL)
ENDIF()
TARGET_LINK_LIBRARIES(${PROJECT_NAME}
PRIVATE ftxui::screen
PRIVATE ftxui::dom
PRIVATE ftxui::component # Not needed for this example.
)
# --------------------------------------------- #
TARGET_INCLUDE_DIRECTORIES(${PROJECT_NAME}
PRIVATE src/
PRIVATE ${ftxui_SOURCE_DIR}/include/
)
FILE(GLOB DEPENDENCY_DLLS "${ftxui_BINARY_DIR}/*.dll")
FOREACH(DLL ${DEPENDENCY_DLLS})
ADD_CUSTOM_COMMAND(TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${DLL} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
)
ENDFOREACH()