I am trying to use CMake to configure a project on Mac OS X that
contains different subdirectories where various libraries and such are
built. These subdirectories will also contain unit tests for the
built components. In the root CMakeLists.txt file, I have defined a
macro that will help set up the unit tests when I call this macro in
the sub directories. This is the basics of how the macro works:
macro(AddTestApplication Name)
# Generate test application information here ...
add_executable(${Name} ${ARGN})
get_target_property(TestCommand ${Name} LOCATION)
add_test(${Name} ${TestCommand})
endmacro(AddTestApplication)
When I include the macro in the subdirectory, the test application
gets built. When I try to run the RUN_TESTS target in the project, I
get error output like:
Start processing tests
Test project /Projects/MyProject/build
1/ 1 Testing TestLibrary Could not find
executable /Projects/MyProject/build/$(CONFIGURATION)/TestLibrary
Looked in the following places:
/Projects/MyProject/build/$(CONFIGURATION)/TestLibrary
/Projects/MyProject/build/$(CONFIGURATION)/TestLibrary
/Projects/MyProject/build/$(CONFIGURATION)/Debug/TestLibrary
/Projects/MyProject/build/$(CONFIGURATION)/Debug/TestLibrary
Debug//Projects/MyProject/build/$(CONFIGURATION)/TestLibrary
Debug//Projects/MyProject/build/$(CONFIGURATION)/TestLibrary
Projects/MyProject/build/$(CONFIGURATION)/TestLibrary
Projects/MyProject/build/$(CONFIGURATION)/TestLibrary
Projects/MyProject/build/$(CONFIGURATION)/Debug/TestLibrary
Projects/MyProject/build/$(CONFIGURATION)/Debug/TestLibrary
Debug/Projects/MyProject/build/$(CONFIGURATION)/TestLibrary
Debug/Projects/MyProject/build/$(CONFIGURATION)/TestLibrary
Unable to find executable: /Projects/MyProject/build/$(CONFIGURATION)/
TestLibrary
0% tests passed, 1 tests failed out of 1
The following tests FAILED:
1 - TestLibrary (Not Run)
Errors while running CTest
make: *** [RUN_TESTS_buildpart_0] Error 8
For some reason CTest is not performing any substitution for $
(CONFIGURATION). If it were, the first location it tried would have
succeeded in finding the test exectuable
What is needed so that the test application can run successfully?
_______________________________________________
CMake mailing list
[email protected]
http://www.cmake.org/mailman/listinfo/cmake