# Sample CMakeLists.txt — samplefiles.com cmake_minimum_required(VERSION 3.20) project(Sample VERSION 1.0.0 LANGUAGES C CXX) set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) option(SAMPLE_BUILD_TESTS "Build unit tests" ON) add_library(customers src/customers.cpp) target_include_directories(customers PUBLIC include) add_executable(sample src/main.cpp) target_link_libraries(sample PRIVATE customers) if(SAMPLE_BUILD_TESTS) enable_testing() add_executable(customers_test tests/customers_test.cpp) target_link_libraries(customers_test PRIVATE customers) add_test(NAME customers_test COMMAND customers_test) endif() install(TARGETS sample RUNTIME DESTINATION bin)