MyModernCppStarter/standalone/CMakeLists.txt
2021-03-01 20:55:52 +00:00

24 lines
640 B
CMake

cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
project(GreeterStandalone LANGUAGES CXX)
# --- Import tools ----
include(../cmake/tools.cmake)
# ---- Dependencies ----
include(../cmake/CPM.cmake)
CPMAddPackage("gh:jarro2783/cxxopts@2.2.0")
CPMAddPackage(NAME Greeter SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/..)
# ---- Create standalone executable ----
file(GLOB sources CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/source/*.cpp)
add_executable(GreeterStandalone ${sources})
set_target_properties(GreeterStandalone PROPERTIES CXX_STANDARD 17 OUTPUT_NAME "Greeter")
target_link_libraries(GreeterStandalone Greeter::Greeter cxxopts)