src/chrono_fmi/CMakeLists.txt:51 guards FMU testing on a variable that does not exist:
cmake_dependent_option(FMU_TESTING "Enable FMU testing" ON "ENABLE_FMU_EXPORT" OFF)
ENABLE_FMU_EXPORT occurs exactly once in the whole repository, on that line, and is never defined
anywhere. The option the file actually uses for this everywhere else is FMU_EXPORT_SUPPORT, declared
20-odd lines earlier:
cmake_dependent_option(FMU_EXPORT_SUPPORT "Enable FMU export capabilities" ON "CH_ENABLE_MODULE_FMI" OFF)
Since cmake_dependent_option forces the option to its <force> value whenever the dependency
expression is false, and an undefined variable is false, FMU_TESTING is forced OFF and hidden
regardless of configuration. It does not appear in the CMake cache of a configured build. So FMU testing
cannot currently be switched on.
Introduced in 47ade30 ("Refactor Chrono::FMI to separate build requirements for FMU export and
import.", 2024-05-22), which renamed the export option; this one reference did not follow the rename.
The fix is presumably one word:
cmake_dependent_option(FMU_TESTING "Enable FMU testing" ON "FMU_EXPORT_SUPPORT" OFF)
I have not sent a patch because I have not confirmed what FMU_TESTING is supposed to gate, and whether
those tests currently pass, is worth knowing before it is turned on for everyone. Scope note on the
evidence: the single reference, the absent definition, and the absence of FMU_TESTING from a configured
cache are all verified. The claim that it would become settable after the rename follows from
cmake_dependent_option semantics and was not measured, since doing so needs a static build with
FMU_EXPORT_SUPPORT=ON.
Found while working on #762 / #772.
src/chrono_fmi/CMakeLists.txt:51guards FMU testing on a variable that does not exist:ENABLE_FMU_EXPORToccurs exactly once in the whole repository, on that line, and is never definedanywhere. The option the file actually uses for this everywhere else is
FMU_EXPORT_SUPPORT, declared20-odd lines earlier:
Since
cmake_dependent_optionforces the option to its<force>value whenever the dependencyexpression is false, and an undefined variable is false,
FMU_TESTINGis forced OFF and hiddenregardless of configuration. It does not appear in the CMake cache of a configured build. So FMU testing
cannot currently be switched on.
Introduced in 47ade30 ("Refactor Chrono::FMI to separate build requirements for FMU export and
import.", 2024-05-22), which renamed the export option; this one reference did not follow the rename.
The fix is presumably one word:
I have not sent a patch because I have not confirmed what
FMU_TESTINGis supposed to gate, and whetherthose tests currently pass, is worth knowing before it is turned on for everyone. Scope note on the
evidence: the single reference, the absent definition, and the absence of
FMU_TESTINGfrom a configuredcache are all verified. The claim that it would become settable after the rename follows from
cmake_dependent_optionsemantics and was not measured, since doing so needs a static build withFMU_EXPORT_SUPPORT=ON.Found while working on #762 / #772.