add_subdirectory(gmx_gpu_utils)
include_directories(./gmx_gpu_utils ${OpenMM_INCLUDE_DIR})
link_directories(${OpenMM_LIBRARY_DIR})
- add_definitions( -DOPENMM_PLUGIN_DIR="${OpenMM_PLUGIN_DIR}" )
+ # only define if this is a local build not a release
+ # we assume that the auto-generated version is not used &&
+ # version string does not contain "-dev" => it's a release build
+ if(NOT USE_VERSION_H AND NOT PROJECT_VERSION MATCHES ".*-dev.*")
+ add_definitions( -DOPENMM_PLUGIN_DIR="${OpenMM_PLUGIN_DIR}" )
+ else()
+ add_definitions( -DOPENMM_PLUGIN_DIR="" )
+ endif()
add_library(openmm_api_wrapper openmm_wrapper.cpp)
# remove_definitions( -DOPENMM_PLUGIN_DIR="${OpenMM_PLUGIN_DIR}" ) # TODO where should this go?!
set(GMX_OPENMM_LIBRARIES openmm_api_wrapper gmx_gpu_utils OpenMM)
add_executable(mdrun ${MDRUN_SOURCES})
target_link_libraries(mdrun ${GMX_EXTRA_LIBRARIES} ${GMX_OPENMM_LIBRARIES})
+# this is to circumvent the following MSVC error:
+# warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs
+# fatal error LNK1169: one or more multiply defined symbols found
+if(GMX_OPENMM AND MSVC)
+ set_target_properties(mdrun PROPERTIES LINK_FLAGS "/NODEFAULTLIB:LBCMT")
+endif()
install(TARGETS
grompp