c1b114d15b0a7823f59238ebb406c17f79ff309f
[alexxy/gromacs.git] / src / gromacs / gmxlib / CMakeLists.txt
1 include_directories(${CMAKE_CURRENT_SOURCE_DIR})
2
3 add_subdirectory(nonbonded)
4
5 # The nonbonded directory contains subdirectories that are only
6 # conditionally built, so we cannot use a GLOB_RECURSE here.
7 file(GLOB GMXLIB_SOURCES *.c *.cpp statistics/*.c)
8
9 # This would be the standard way to include thread_mpi, but we want libgmx
10 # to link the functions directly
11 #if(GMX_THREAD_MPI)
12 #    add_subdirectory(thread_mpi)
13 #endif(GMX_THREAD_MPI)
14 #target_link_libraries(gmx ${GMX_EXTRA_LIBRARIES} ${THREAD_MPI_LIB})
15
16 # Files called xxx_test.c are test drivers with a main() function for module xxx.c,
17 # so they should not be included in the library
18 file(GLOB_RECURSE NOT_GMXLIB_SOURCES *_test.c *\#*)
19 list(REMOVE_ITEM GMXLIB_SOURCES ${NOT_GMXLIB_SOURCES})  
20
21 # gpu utils + cuda tools module
22 if(GMX_GPU)
23     # The log file output queries Cuda if GPU support is enabled
24     add_subdirectory(cuda_tools)
25     add_subdirectory(gpu_utils)   
26     set(GMX_GPU_LIBRARIES ${GMX_GPU_LIBRARIES} gpu_utils cuda_tools PARENT_SCOPE)
27 endif()
28
29 if(GMX_USE_PLUGINS)
30   set(GMXLIB_SOURCES ${GMXLIB_SOURCES} ${CMAKE_SOURCE_DIR}/src/external/vmd_molfile/vmddlopen.c)
31 else()
32   list(REMOVE_ITEM GMXLIB_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/vmdio.c)
33 endif()
34
35 # An ugly hack to get absolute paths...
36 file(GLOB THREAD_MPI_SOURCES ${THREAD_MPI_SRC})
37
38 set(GMXLIB_SOURCES ${GMXLIB_SOURCES} ${THREAD_MPI_SOURCES} ${NONBONDED_SOURCES}
39     PARENT_SCOPE)