* Remove duplicate mentions of project name and replaced it with ${PROJECT_NAME} variable Update CMakeLists.txt * Added ${CMAKE_PROJECT_NAME} * reverted usage of to Greeter and ran fix-format * Update test/CMakeLists.txt Co-authored-by: Dominic Dinser <dominic.dinser@leica-geosystems.com> Co-authored-by: Lars Melchior <TheLartians@users.noreply.github.com>
29 lines
754 B
CMake
29 lines
754 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(
|
|
GITHUB_REPOSITORY jarro2783/cxxopts
|
|
VERSION 2.2.1
|
|
OPTIONS "CXXOPTS_BUILD_EXAMPLES NO" "CXXOPTS_BUILD_TESTS NO" "CXXOPTS_ENABLE_INSTALL YES"
|
|
)
|
|
|
|
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(${PROJECT_NAME} ${sources})
|
|
|
|
set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 17 OUTPUT_NAME "Greeter")
|
|
|
|
target_link_libraries(${PROJECT_NAME} Greeter::Greeter cxxopts)
|