CMakeLists.txt 1015 Bytes
Newer Older
1

2
3
4
5
6
7
8
9
10
11
12
13
14
15
# Copy plugin to test_plugin_dir
set(test_plugin_dir "${CMAKE_BINARY_DIR}/test_plugin_dir")
file(MAKE_DIRECTORY "${test_plugin_dir}")
get_target_property(old_loc NormalModeLangevin LOCATION)
get_filename_component(new_loc ${old_loc} NAME)
set(new_loc "${test_plugin_dir}/${new_loc}")
add_custom_command(
    DEPENDS ${old_loc} NormalModeLangevin
    OUTPUT ${new_loc}
    COMMAND ${CMAKE_COMMAND} -E copy ${old_loc} ${new_loc})
add_custom_target(CopyTestNmlPlugin ALL
    DEPENDS "${new_loc}"
    COMMENT "Copying normal mode langevin plugin for testing")

16
17
18
add_executable(TestNormalModeLangevin TestNormalModeLangevin.cpp)
target_link_libraries(TestNormalModeLangevin ${SHARED_TARGET})

19
20
21
22
23
24
25
26
# pass OPENMM_PLUGIN_DIR as command line argument
add_test(TestNormalModeLangevin 
    "${EXECUTABLE_OUTPUT_PATH}/TestNormalModeLangevin"
    "${test_plugin_dir}")

# does not work - nice try - maybe in cmake 2.8
set_tests_properties(TestNormalModeLangevin  PROPERTIES 
    ENVIRONMENT "OPENMM_PLUGIN_DIR=${test_plugin_dir}")
27