ab5c468ace
canon new lib|exe creates a project following P1204R0 (Canonical Project Structure) with a .canon.toml manifest and a CMakeLists.txt whose managed block is rendered from that manifest. Generators return a plan; the executor checks every operation before writing, so conflicts write nothing and --dry-run writes nothing. Tests: unit tests next to each source file, golden copies of generated projects, and an end-to-end build of both project kinds. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
29 lines
709 B
CMake
29 lines
709 B
CMake
cmake_minimum_required(VERSION 3.20)
|
|
project(hello VERSION 0.1.0 LANGUAGES CXX)
|
|
|
|
set(CMAKE_CXX_STANDARD 23)
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
set(CMAKE_CXX_EXTENSIONS OFF)
|
|
|
|
option(BUILD_TESTING "Build hello's tests" ON)
|
|
if(BUILD_TESTING)
|
|
enable_testing()
|
|
endif()
|
|
|
|
# Add your own CMake outside the managed block below.
|
|
|
|
# >>> canon:managed >>>
|
|
# Rendered from .canon.toml; canon rewrites everything between these markers.
|
|
|
|
add_executable(hello
|
|
hello/hello.cpp
|
|
)
|
|
target_include_directories(hello PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
|
|
|
if(BUILD_TESTING)
|
|
add_test(NAME basics COMMAND hello)
|
|
set_tests_properties(basics PROPERTIES PASS_REGULAR_EXPRESSION "Hello, World!")
|
|
endif()
|
|
|
|
# <<< canon:managed <<<
|