2 set(GMXPREPROCESS_SOURCES
36 gctio.c ionize.c runner.c
37 do_gct.c repl_ex.c xutils.c
38 md.c mdrun.c genalg.c md_openmm.c)
40 add_library(gmxpreprocess ${GMXPREPROCESS_SOURCES})
41 target_link_libraries(gmxpreprocess md)
44 add_subdirectory(gmx_gpu_utils)
45 include_directories(./gmx_gpu_utils ${OpenMM_INCLUDE_DIR})
46 link_directories(${OpenMM_LIBRARY_DIR})
47 # only define if this is a local build not a release
48 # we assume that the auto-generated version is not used &&
49 # version string does not contain "-dev" => it's a release build
50 if(NOT USE_VERSION_H AND NOT PROJECT_VERSION MATCHES ".*-dev.*")
51 add_definitions( -DOPENMM_PLUGIN_DIR="${OpenMM_PLUGIN_DIR}" )
53 add_definitions( -DOPENMM_PLUGIN_DIR="" )
55 add_library(openmm_api_wrapper openmm_wrapper.cpp)
56 # remove_definitions( -DOPENMM_PLUGIN_DIR="${OpenMM_PLUGIN_DIR}" ) # TODO where should this go?!
57 set(GMX_OPENMM_LIBRARIES openmm_api_wrapper gmx_gpu_utils OpenMM)
58 install(TARGETS openmm_api_wrapper DESTINATION ${LIB_INSTALL_DIR})
62 add_library(fahcore ${MDRUN_SOURCES})
65 list(APPEND GMX_EXTRA_LIBRARIES gmxpreprocess md)
67 add_executable(grompp grompp.c)
68 target_link_libraries(grompp ${GMX_EXTRA_LIBRARIES})
70 add_executable(tpbconv tpbconv.c)
71 target_link_libraries(tpbconv ${GMX_EXTRA_LIBRARIES})
73 add_executable(pdb2gmx pdb2gmx.c)
74 target_link_libraries(pdb2gmx ${GMX_EXTRA_LIBRARIES})
76 add_executable(protonate protonate.c)
77 target_link_libraries(protonate ${GMX_EXTRA_LIBRARIES})
79 add_executable(luck luck.c)
80 target_link_libraries(luck ${GMX_EXTRA_LIBRARIES})
82 add_executable(gmxdump gmxdump.c)
83 target_link_libraries(gmxdump ${GMX_EXTRA_LIBRARIES})
85 add_executable(x2top x2top.c)
86 target_link_libraries(x2top ${GMX_EXTRA_LIBRARIES})
88 add_executable(gmxcheck gmxcheck.c)
89 target_link_libraries(gmxcheck ${GMX_EXTRA_LIBRARIES})
91 add_executable(mdrun ${MDRUN_SOURCES})
92 target_link_libraries(mdrun ${GMX_EXTRA_LIBRARIES} ${GMX_OPENMM_LIBRARIES})
93 # this is to circumvent the following MSVC error:
94 # warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs
95 # fatal error LNK1169: one or more multiply defined symbols found
96 if(GMX_OPENMM AND MSVC)
97 set_target_properties(mdrun PROPERTIES LINK_FLAGS "/NODEFAULTLIB:LBCMT")
110 gmxpreprocess DESTINATION ${LIB_INSTALL_DIR}
111 RUNTIME DESTINATION ${BIN_INSTALL_DIR})