1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-22 16:07:49 +08:00
Files
CMake/Help/guide/tutorial/Step2/Exercise3.cmake
Vito Gamberini b2e3e3e30e Tutorial: Rewrite using conventions enabled by CMake 3.23
This is a full re-write of the CMake Tutorial for CMake 3.23, both
the functionality it provides, as well as the modern workflows that
developers use when interfacing with CMake.

Issue: #22663, #23086, #23799, #26053, #26105, #26153, #26914
2025-09-17 11:57:23 -04:00

31 lines
627 B
CMake

cmake_minimum_required(VERSION 3.23)
# TODO4: Set the SKIP_TESTS variable to a true value, so that the tests from
# Exercise1 and Exercise2 are skipped
# TODO5: Include Exercise1.cmake and Exercise2.cmake
set(InList FooBar QuxBar)
# TODO6: Append FooBaz and QuxBaz to InList with FuncAppend
if(NOT InList STREQUAL "FooBar;QuxBar;FooBaz;QuxBaz")
message(WARNING "Append failed, InList contains: ${InList}")
endif()
# TODO7: Filter InList with FilterFoo, use OutList as the output variable
check_contains(FooBar)
check_contains(FooBaz)
check_nonfoo(${OutList})
if(NOT Failed)
message("Success!")
endif()