Skip to content

Commit d7a0ca4

Browse files
author
Zachery Crandall
authored
Fix failing test for CMake 4 (#169)
* Add CMake minimum version command matching minimum version of CMaize * Remove old 'cpp/' test directory reference and use relative paths for test names * Default to using VERBOSE log level in tests * Fix line numbers referencing bare_bones_cmake from the docs * Revert minimum version of bare_bones_cmake example back to 3.5 to match other examples
1 parent dc8a4f7 commit d7a0ca4

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

docs/src/background/redundancy.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ then the minimal ``CMakeLists.txt`` file looks like:
6060

6161
.. literalinclude:: /../../tests/docs/bare_bones_cmake/CMakeLists.txt
6262
:language: CMake
63-
:lines: 15
63+
:lines: 18-20
6464
:linenos:
6565
:lineno-start: 1
6666

tests/CMakeLists.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ include(cmake_test/cmake_test)
1313

1414
set(BUILD_TESTING "${build_testing_old}" CACHE BOOL "" FORCE)
1515

16-
# ct_add_dir("cpp")
17-
ct_add_dir("cmaize")
16+
ct_add_dir(
17+
"cmaize"
18+
USE_REL_PATH_NAMES
19+
CMAKE_OPTIONS
20+
-DCMAKE_MESSAGE_LOG_LEVEL=VERBOSE
21+
)
1822
add_subdirectory(docs)

tests/docs/bare_bones_cmake/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
# Minimum version required as of CMake 4.0
16+
# (see https://cmake.org/cmake/help/latest/policy/CMP0000.html).
17+
# Match this with minimum version from 'CMaize/CMakeLists.txt'.
18+
cmake_minimum_required(VERSION 3.5) # Required as of CMake 4.0
19+
1520
add_executable(hello_world hello_world.cpp)
1621

1722
# The below lines of code are used in unit testing this code example

0 commit comments

Comments
 (0)