[CMake] Test Shared Library Dependencies and set_tests_properties()

Jörg Kreuzberger j.kreuzberger at procitec.de
Mon May 12 03:10:38 EDT 2014


Hi!

For using tests those tests have sometimes dependencies to shared libraries, from cache and from build.

For execution i therefore call set_test_properties( testname PROPERTIES ENVIRONMENT )
with LD_LIBRARY_PATH on Linux and PATH for windows. This seems to work on linux for "cached" entries like e.g.  ${QT_LIBRARY_DIR} or others. If i want to add to add $<TARGET_FILE_DIR:othertarget> cmake seems not to resolve this path to an internaly build shard library dir.

It just adds \$<TARGET_FILE_DIR:othertarget> to the test cmake file in the CMAKE_CURRENT_BINARY_DIR instead of resolving this path.

On Windows i have the issue that i cannot set the path cause the semicolon is interpreted as list seperator

e.g. set_test_properties( mytest PROPERTIES ENVIRONMENT "PATH=$ENV{PATH};${QT_LIBRARY_DIR}")
How can i avoid this?

Any help welcome :-)



More information about the CMake mailing list