Add missing linker flags
[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     add_subdirectory(cuda_tools)
24     add_subdirectory(gpu_utils)   
25     set(GMX_GPU_LIBRARIES ${GMX_GPU_LIBRARIES} gpu_utils cuda_tools PARENT_SCOPE)
26 endif()
27
28 if(GMX_USE_PLUGINS)
29   set(GMXLIB_SOURCES ${GMXLIB_SOURCES} ${CMAKE_SOURCE_DIR}/src/external/vmd_molfile/vmddlopen.c)
30 else()
31   list(REMOVE_ITEM GMXLIB_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/vmdio.c)
32 endif()
33
34 # An ugly hack to get absolute paths...
35 file(GLOB THREAD_MPI_SOURCES ${THREAD_MPI_SRC})
36
37 set(GMXLIB_SOURCES ${GMXLIB_SOURCES} ${THREAD_MPI_SOURCES} ${NONBONDED_SOURCES}
38     PARENT_SCOPE)