"ssh:/git@developer.sourcefind.cn:2222/tsoc/openmm.git" did not exist on "a6eccd99087f9926c8d98ae4dce4ece9118ceab6"
Commit 339cb645 authored by Christopher Bruns's avatar Christopher Bruns
Browse files

TestNormalModeLangevin now passes for both Release and Debug on Linux

parent 732eaf77
...@@ -43,47 +43,39 @@ file(GLOB sources "${CMAKE_CURRENT_SOURCE_DIR}/platforms/reference/src/*.cpp") ...@@ -43,47 +43,39 @@ file(GLOB sources "${CMAKE_CURRENT_SOURCE_DIR}/platforms/reference/src/*.cpp")
set(nml_headers ${nml_headers} ${headers}) set(nml_headers ${nml_headers} ${headers})
set(nml_sources ${nml_sources} ${sources}) set(nml_sources ${nml_sources} ${sources})
add_library(NormalModeLangevin SHARED ${nml_sources} ${nml_headers}) set(NML_PLUGIN NormalModeLangevin)
set_target_properties(NormalModeLangevin PROPERTIES COMPILE_FLAGS "-DOPENMM_BUILDING_SHARED_LIBRARY")
# On Unix or Cygwin we have to add the debug suffix manually # On Unix or Cygwin we have to add the debug suffix manually
if(UNIX) if(UNIX AND CMAKE_BUILD_TYPE MATCHES Debug)
set_target_properties(NormalModeLangevin PROPERTIES DEBUG_OUTPUT_NAME NormalModeLangevin_d) set(NML_PLUGIN ${NML_PLUGIN}_d)
endif(UNIX) endif(UNIX AND CMAKE_BUILD_TYPE MATCHES Debug)
target_link_libraries( NormalModeLangevin ${SHARED_TARGET} ) add_library(${NML_PLUGIN} SHARED ${nml_sources} ${nml_headers})
# Copy plugin to test_plugin_dir set_target_properties(${NML_PLUGIN} PROPERTIES COMPILE_FLAGS "-DOPENMM_BUILDING_SHARED_LIBRARY")
# TODO - move this up to top level CMakeLists.txt target_link_libraries( ${NML_PLUGIN} ${SHARED_TARGET} )
set(test_plugin_dir "${CMAKE_BINARY_DIR}/test_plugin_dir")
file(MAKE_DIRECTORY "${test_plugin_dir}")
if(BUILD_TESTING) if(BUILD_TESTING)
# Copy plugin to test_plugin_dir
set(test_plugin_dir "${CMAKE_BINARY_DIR}/test_plugin_dir")
file(MAKE_DIRECTORY "${test_plugin_dir}")
# On Windows we need to copy the correct Release/Debug plugin for testing # On Windows we need to copy the correct Release/Debug plugin for testing
if(MSVC) if(MSVC)
set(args -E copy $\(TargetPath\) \"${test_plugin_dir}\") add_custom_command(TARGET ${NML_PLUGIN} POST_BUILD
message(${args})
add_custom_command(TARGET NormalModeLangevin POST_BUILD
DEPENDS $(TargetPath) DEPENDS $(TargetPath)
COMMAND "${CMAKE_COMMAND}" COMMAND "${CMAKE_COMMAND}"
ARGS -E copy \"$\(TargetPath\)\" \"${test_plugin_dir}\" ARGS -E copy \"$\(TargetPath\)\" \"${test_plugin_dir}\"
COMMENT "Copying normal mode langevin plugin for testing (WIN32)") COMMENT "Copying normal mode langevin plugin for testing (WIN32)")
else(MSVC) else(MSVC)
get_target_property(old_loc NormalModeLangevin LOCATION) get_target_property(old_loc ${NML_PLUGIN} LOCATION)
get_filename_component(new_loc ${old_loc} NAME) add_custom_command(TARGET ${NML_PLUGIN} POST_BUILD
set(new_loc "${test_plugin_dir}/${new_loc}") COMMAND "${CMAKE_COMMAND}"
add_custom_command( ARGS -E copy ${old_loc} ${test_plugin_dir}
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") COMMENT "Copying normal mode langevin plugin for testing")
endif(MSVC) endif(MSVC)
add_subdirectory(test) add_subdirectory(test)
endif(BUILD_TESTING) endif(BUILD_TESTING)
if(WIN32) if(WIN32)
# install DLL but not LIB # install DLL but not LIB
install(TARGETS NormalModeLangevin RUNTIME DESTINATION lib/plugins) install(TARGETS ${NML_PLUGIN} RUNTIME DESTINATION lib/plugins)
else(WIN32) else(WIN32)
install(TARGETS NormalModeLangevin LIBRARY DESTINATION lib/plugins) install(TARGETS ${NML_PLUGIN} LIBRARY DESTINATION lib/plugins)
endif(WIN32) endif(WIN32)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment