Вот моя настройка: < /p>
Код: Выделить всё
.
├── CMakeLists.txt
└── a
├── CMakeLists.txt
├── a.cpp
└── test_a.cpp
< /code>
Где:
./cmakelists.txt:
cmake_minimum_required(VERSION 3.16)
project(cmaketest LANGUAGES CXX)
enable_testing()
add_subdirectory(a)
# modify target and test properties
set_target_properties(a PROPERTIES LABELS "bla") #
-- The CXX compiler identification is GNU 9.4.0
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:9 (set_tests_properties):
set_tests_properties Can not find test to add properties to: mytest_a
-- Configuring incomplete, errors occurred!
Подробнее здесь: https://stackoverflow.com/questions/762 ... ctory-scop