about summary refs log blame commit diff stats
path: root/CMakeLists.txt
blob: bf5b4dab009e6b7b98361a4dc94364797cfba6ed (plain) (tree)
1
2
3
4
5
6
7

                                      


                 
                                                                 
 










                                                                           
 

                                                            
                                                  








                                                                                                     

                                    
 

                              


                                 








                                                       
                           
                           
 
cmake_minimum_required(VERSION 3.26.0)

project(ytcpp
    LANGUAGES CXX
    VERSION 0.0.1
    HOMEPAGE_URL https://crow.port0.org/git/comradecrow/ytcpp.git
)

set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)

if(WIN32) # Install dlls in the same directory as the executable on Windows
    set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
    set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
endif()

include(FetchContent)
FetchContent_Declare(cpr GIT_REPOSITORY https://github.com/libcpr/cpr.git
                         GIT_TAG c4713a704ca12237485ecbfec185f76c2a81bd09)

FetchContent_Declare(ftxui
  GIT_REPOSITORY https://github.com/ArthurSonzogni/ftxui.git
  GIT_TAG d301fab1f4ecdd3544ed99b9c98e647d5804c341
)

FetchContent_GetProperties(ftxui)
if(NOT ftxui_POPULATED)
  FetchContent_Populate(ftxui)
  add_subdirectory(${ftxui_SOURCE_DIR} ${ftxui_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()

FetchContent_Declare(json URL https://github.com/nlohmann/json/releases/download/v3.11.2/json.tar.xz)

FetchContent_MakeAvailable(json cpr)

find_package(SQLite3 REQUIRED)

# find_package(pybind11 REQUIRED)
add_subdirectory(extern/pybind11)

add_executable(${PROJECT_NAME} src/main.cpp)
target_include_directories(${PROJECT_NAME} PRIVATE src)

target_link_libraries(${PROJECT_NAME} 
    PRIVATE cpr::cpr
    PRIVATE ftxui::screen
    PRIVATE ftxui::dom
    PRIVATE ftxui::component
    PRIVATE nlohmann_json::nlohmann_json
    PRIVATE SQLite::SQLite3
    PRIVATE pybind11::embed
)