create_test_sourcelist emits a lot of uninizialized warnings
Command create_test_sourcelist
has some optional variables (EXTRA_INCLUDE
, FUNCTION
) and variables to customize its behavior (CMAKE_TESTDRIVER_BEFORE_TESTMAIN
, CMAKE_TESTDRIVER_AFTER_TESTMAIN
).
If not all these variables are set by user code explicitely, running cmake --warn-unizitialized
gives a lot of warnings.
Its sufficient to run this short CMakeLists.txt
cmake_minimum_required(VERSION 3.9)
project(tst NONE)
create_test_sourcelist(DUMMY_NAME test_driver.cc test1.cc)
to get an output similar to
CMake Warning (dev) at CMakeLists.txt:4 (create_test_sourcelist):
uninitialized variable 'CMAKE_TESTDRIVER_EXTRA_INCLUDES'
This warning is for project developers. Use -Wno-dev to suppress it.
...
This may be a side effect of cbf0c0fc (cmake: Enable --warn-uninitialized inside string(CONFIGURE) and configure_file) 2018-12-13.
Edited by felix schwitzer