cmake-basis / legacy

Legacy CMake BASIS project for versions 3.2 and older. For newer versions, go to
https://github.com/cmake-basis/BASIS
Other
13 stars 11 forks source link

test_utilities fails with "BASIS C++ Utilities not enabled" error #469

Closed schuhschuh closed 8 years ago

schuhschuh commented 9 years ago

The test_utilities test fails with the error message even though the BASIS C++ utilities are enabled and available in the BASIS build tree.

-- Adding executable helloworld...
CMake Error at /Users/as12312/Software/BASIS/src/cmake/UtilitiesTools.cmake:349 (message):
  This project makes use of the BASIS C++ utilities but BASIS was built
  without these utilities enabled.
Call Stack (most recent call first):
  /Users/as12312/Software/BASIS/src/cmake/TargetTools.cmake:456 (basis_add_utilities_library)
  /Users/as12312/Software/BASIS/src/cmake/TargetTools.cmake:1739 (basis_target_link_libraries)
  /Users/as12312/Software/BASIS/src/cmake/TargetTools.cmake:754 (basis_add_executable_target)
  src/CMakeLists.txt:44 (basis_add_executable)

When the same CMake command is executed a second time, the configuration ends without error.

P.S.: This is after adding set (BASIS_UTILITIES TRUE) to config/Settings.cmake of the test project.

schuhschuh commented 9 years ago

The test fails because the BASIS_EXPORTS_FILE variable set in the BASISConfig.cmake file is later on override in the same file and becomes ON...

Debug output from BASISConfig.cmake:

NS = BASIS_, BASIS_EXPORTS_FILE = /Users/as12312/Software/BASIS/build/BASISExports.cmake
NS = BASIS_, BASIS_EXPORTS_FILE = ON
schuhschuh commented 9 years ago

This error was introduced by 7027e48487fd7e6b2a17f874a996dba089cc4fcd for #359. See this comment.