cmake_minimum_required(VERSION 3.5) project(anyproc LANGUAGES CXX) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(ANYPROC_PYBIND No CACHE BOOL "If Anyproc Python bindings should be build") set(ANYPROC_COSCHED No CACHE BOOL "If Anyproc should make use of CoSched") if (ANYPROC_COSCHED) set(CMAKE_CXX_STANDARD 20) endif() add_library(anyproc INTERFACE) target_include_directories(anyproc INTERFACE include/) target_link_libraries(anyproc INTERFACE justlm) if (ANYPROC_COSCHED) target_link_libraries(anyproc INTERFACE cosched) endif() if (ANYPROC_PYBIND) find_package(Python COMPONENTS Interpreter Development) find_package(pybind11 CONFIG) pybind11_add_module(anyproc_py pybind.cpp) target_link_libraries(anyproc_py PRIVATE anyproc) if (ANYPROC_COSCHED) message(FATAL_ERROR "Pybind can't be enabled in combination with CoSched") endif() endif() install(TARGETS anyproc LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})