"wrappers/python/vscode:/vscode.git/clone" did not exist on "48498b10c9bab5b86e3177b20b607dd5e62dfcf4"
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")
set(nml_headers ${nml_headers} ${headers})
set(nml_sources ${nml_sources} ${sources})
add_library(NormalModeLangevin SHARED ${nml_sources} ${nml_headers})
set_target_properties(NormalModeLangevin PROPERTIES COMPILE_FLAGS "-DOPENMM_BUILDING_SHARED_LIBRARY")
set(NML_PLUGIN NormalModeLangevin)
# On Unix or Cygwin we have to add the debug suffix manually
if(UNIX)
set_target_properties(NormalModeLangevin PROPERTIES DEBUG_OUTPUT_NAME NormalModeLangevin_d)
endif(UNIX)
target_link_libraries( NormalModeLangevin ${SHARED_TARGET} )
# Copy plugin to test_plugin_dir
# TODO - move this up to top level CMakeLists.txt
set(test_plugin_dir "${CMAKE_BINARY_DIR}/test_plugin_dir")
file(MAKE_DIRECTORY "${test_plugin_dir}")
if(UNIX AND CMAKE_BUILD_TYPE MATCHES Debug)
set(NML_PLUGIN ${NML_PLUGIN}_d)
endif(UNIX AND CMAKE_BUILD_TYPE MATCHES Debug)
add_library(${NML_PLUGIN} SHARED ${nml_sources} ${nml_headers})
set_target_properties(${NML_PLUGIN} PROPERTIES COMPILE_FLAGS "-DOPENMM_BUILDING_SHARED_LIBRARY")
target_link_libraries( ${NML_PLUGIN} ${SHARED_TARGET} )
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
if(MSVC)
set(args -E copy $\(TargetPath\) \"${test_plugin_dir}\")
message(${args})
add_custom_command(TARGET NormalModeLangevin POST_BUILD
add_custom_command(TARGET ${NML_PLUGIN} POST_BUILD
DEPENDS $(TargetPath)
COMMAND "${CMAKE_COMMAND}"
ARGS -E copy \"$\(TargetPath\)\" \"${test_plugin_dir}\"
COMMENT "Copying normal mode langevin plugin for testing (WIN32)")
else(MSVC)
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}"
get_target_property(old_loc ${NML_PLUGIN} LOCATION)
add_custom_command(TARGET ${NML_PLUGIN} POST_BUILD
COMMAND "${CMAKE_COMMAND}"
ARGS -E copy ${old_loc} ${test_plugin_dir}
COMMENT "Copying normal mode langevin plugin for testing")
endif(MSVC)
add_subdirectory(test)
endif(BUILD_TESTING)
if(WIN32)
# install DLL but not LIB
install(TARGETS NormalModeLangevin RUNTIME DESTINATION lib/plugins)
install(TARGETS ${NML_PLUGIN} RUNTIME DESTINATION lib/plugins)
else(WIN32)
install(TARGETS NormalModeLangevin LIBRARY DESTINATION lib/plugins)
install(TARGETS ${NML_PLUGIN} LIBRARY DESTINATION lib/plugins)
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