Disabling BUILD_TESTING cmake option causes compilation error
Submitted by Darren Bookless
Assigned to Nobody
Link to original bugzilla bug (#1656)
Version: 3.3 (current stable)
Description
CMake returns an error when attempting to compile with Eigen if the BUILD_TESTING option in Eigen's top-level CMakeLists is disabled.
The error CMake exits with is "Unknown CMake command 'ei_add_failtest'".
From a little investigation, this happens because of line 522 of the top-level CMakeLists:
add_subdirectory(failtest)
Which includes a CMakeLists file repeatedly using the ei_add_failtest macro.
With BUILD_TESTING disabled, the top-level CMakeLists does not include cmake/EigenConfigureTesting.cmake, and hence does not include cmake/EigenTesting.cmake, in which the ei_add_failtest macro is defined.
If I'm understanding the intention of the CMakeLists correctly, the add_subdirectory(failtest) line should simply be wrapped in an if(BUILD_TESTING) conditional. With that modification, Eigen seems to compile happily.