You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.1 KiB

cmake_minimum_required(VERSION 3.10)
project(planificador)
add_compile_options(-Wall -Wextra -pedantic)
include(FetchContent)
FetchContent_Declare(
rpclib
GIT_REPOSITORY https://github.com/rpclib/rpclib.git
GIT_TAG master
)
FetchContent_MakeAvailable(rpclib)
FetchContent_Declare(
tomlplusplus
GIT_REPOSITORY https://github.com/marzer/tomlplusplus.git
GIT_TAG v3.3.0
)
FetchContent_MakeAvailable(tomlplusplus)
file(GLOB nameFile "src/*.cpp")
add_library(rpclib_lib STATIC IMPORTED)
set_target_properties(rpclib_lib PROPERTIES IMPORTED_LOCATION "${rpclib_BINARY_DIR}/librpc.a")
add_executable(planificador src/host.cpp src/runner.cpp src/config.cpp src/main.cpp)
target_compile_features(planificador PUBLIC cxx_std_17)
include_directories(${tomlplusplus_SOURCE_DIR}/include)
include_directories(${rpclib_SOURCE_DIR}/include)
SET(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
target_link_libraries(planificador PRIVATE Threads::Threads)
# Lier votre exécutable avec la bibliothèque rpclib
target_link_libraries(planificador PRIVATE rpclib_lib)