OpenMM: added combination rule check, disabled restraint check for now as it's buggy
[gromacs/qmmm-gamess-us.git] / src / kernel / CMakeLists.txt
blob7f1e27e0b3878f124562624e63cd82432ee236b4
2 set(GMXPREPROCESS_SOURCES 
3     add_par.c       
4     compute_io.c    
5     convparm.c      
6     gen_ad.c        
7     gen_vsite.c     
8     genhydro.c   
9     gpp_atomtype.c  
10     gpp_bond_atomtype.c     
11     h_db.c          
12     hackblock.c             
13     hizzie.c        
14     nm2type.c
15     pdb2top.c       
16     pgutil.c        
17     readir.c        
18     readpull.c      
19     resall.c        
20     sorting.c       
21     specbond.c      
22     ter_db.c        
23     tomorse.c       
24     topdirs.c       
25     topexcl.c       
26     topio.c         
27     toppush.c       
28     topshake.c      
29     toputil.c       
30     tpbcmp.c        
31     vsite_parm.c    
32     fflibutil.c
33     xlate.c)
35 set(MDRUN_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)
43 if(GMX_OPENMM) 
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}" ) 
52     else()
53         add_definitions( -DOPENMM_PLUGIN_DIR="" )
54     endif()
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})   
59 endif(GMX_OPENMM)
61 if(GMX_FAHCORE)
62   add_library(fahcore ${MDRUN_SOURCES})
63 else(GMX_FAHCORE)
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")
98 endif()
100 install(TARGETS 
101         grompp
102         tpbconv
103         pdb2gmx
104         protonate
105         luck
106         gmxdump
107         x2top
108         gmxcheck
109         mdrun
110         gmxpreprocess DESTINATION ${LIB_INSTALL_DIR}
111         RUNTIME DESTINATION ${BIN_INSTALL_DIR})
113 endif(GMX_FAHCORE)