1 # The nbnxn kernel files take the longest time to compile, so we sneak
2 # them in first to take best advantage of make-time parallelisation.
3 file(GLOB MDLIB_SOURCES nbnxn_kernels/*.c *.c)
6 add_subdirectory(nbnxn_cuda)
7 set(GMX_GPU_LIBRARIES nbnxn_cuda)
10 # apply gcc 4.4.x bug workaround
11 if(GMX_USE_GCC44_BUG_WORKAROUND)
12 include(gmxGCC44O3BugWorkaround)
13 gmx_apply_gcc44_bug_workaround("force.c")
14 gmx_apply_gcc44_bug_workaround("constr.c")
17 # Files called xxx_test.c are test drivers with a main() function for
18 # module xxx.c, so they should not be included in the library
20 if(NOT GMX_FFT_FFTPACK)
21 list(REMOVE_ITEM MDLIB_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/fftpack.c)
24 add_library(md ${MDLIB_SOURCES})
26 target_link_libraries(md ${GMX_GPU_LIBRARIES} gmx ${GMX_EXTRA_LIBRARIES} ${FFT_LIBRARIES} ${OpenMP_SHARED_LINKER_FLAGS})
27 if(GMX_BUILD_OWN_FFTW)
28 # This dependency has to be made here rather than the CMakeLists.txt that
29 # does the FFTW build, because of the order in which
30 # add_subdirectory() calls are made in the top-level CMakeLists.txt; the
31 # md library target does not necessarily exist yet. Also enabling and
32 # disabling GMX_BUILD_OWN_FFTW changes dependencies correctly.
33 add_dependencies(md gmxfftw)
35 set_target_properties(md PROPERTIES OUTPUT_NAME "md${GMX_LIBS_SUFFIX}" SOVERSION ${SOVERSION} INSTALL_NAME_DIR "${LIB_INSTALL_DIR}"
36 COMPILE_FLAGS "${OpenMP_C_FLAGS}")
38 install(TARGETS md DESTINATION ${LIB_INSTALL_DIR} COMPONENT libraries)
40 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libmd.pc.cmakein ${CMAKE_CURRENT_BINARY_DIR}/libmd.pc @ONLY)
41 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libmd.pc
42 DESTINATION ${LIB_INSTALL_DIR}/pkgconfig
43 RENAME "libmd${GMX_LIBS_SUFFIX}.pc"
44 COMPONENT development)