file(GLOB test_sources "Test*.cpp") foreach(test_source ${test_sources}) get_filename_component(test_name ${test_source} NAME_WE) add_executable(${test_name} ${test_source}) target_link_libraries(${test_name} ${SHARED_TARGET}) # pass OPENMM_PLUGIN_DIR as command line argument add_test(${test_name} "${EXECUTABLE_OUTPUT_PATH}/${test_name}" "${test_plugin_dir}") # does not work - nice try - maybe in cmake 2.8 set_tests_properties(${test_name} PROPERTIES ENVIRONMENT "OPENMM_PLUGIN_DIR=${test_plugin_dir}") endforeach(test_source ${test_sources})