Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tsoc
openmm
Commits
339cb645
Commit
339cb645
authored
Dec 02, 2009
by
Christopher Bruns
Browse files
TestNormalModeLangevin now passes for both Release and Debug on Linux
parent
732eaf77
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
25 deletions
+17
-25
plugins/normalModeLangevin/CMakeLists.txt
plugins/normalModeLangevin/CMakeLists.txt
+17
-25
No files found.
plugins/normalModeLangevin/CMakeLists.txt
View file @
339cb645
...
@@ -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
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment