X-Git-Url: http://biod.pnpi.spb.ru/gitweb/?a=blobdiff_plain;f=src%2Fgromacs%2FCMakeLists.txt;h=912789403df6eeb2ca7239c0d6484427d8e22b3d;hb=982993423b348095df0e550ec9d7e6163a270b4f;hp=6db37e2402e57b5ead038c6f4fe53bdebb24c2f1;hpb=28bb38b9b5c10bff38e5e2fe0cd2b0c00433b382;p=alexxy%2Fgromacs.git diff --git a/src/gromacs/CMakeLists.txt b/src/gromacs/CMakeLists.txt index 6db37e2402..912789403d 100644 --- a/src/gromacs/CMakeLists.txt +++ b/src/gromacs/CMakeLists.txt @@ -77,6 +77,7 @@ endif() add_subdirectory(gmxlib) add_subdirectory(mdlib) add_subdirectory(gmxpreprocess) +add_subdirectory(bonded) add_subdirectory(commandline) add_subdirectory(fft) add_subdirectory(linearalgebra) @@ -84,7 +85,9 @@ add_subdirectory(math) add_subdirectory(random) add_subdirectory(onlinehelp) add_subdirectory(options) +add_subdirectory(pbcutil) add_subdirectory(timing) +add_subdirectory(topology) add_subdirectory(utility) add_subdirectory(fileio) add_subdirectory(swap) @@ -114,50 +117,43 @@ list(APPEND LIBGROMACS_SOURCES ${GMXLIB_SOURCES} ${MDLIB_SOURCES}) tmpi_get_source_list(THREAD_MPI_SOURCES ${CMAKE_SOURCE_DIR}/src/external/thread_mpi/src) list(APPEND LIBGROMACS_SOURCES ${THREAD_MPI_SOURCES}) -file(GLOB LIBGROMACS_HEADERS *.h) +set(LIBGROMACS_HEADERS + analysisdata.h + commandline.h + options.h + selection.h + trajectoryanalysis.h + utility.h) configure_file(version.h.cmakein version.h) gmx_install_headers("" ${LIBGROMACS_HEADERS}) gmx_install_headers("" ${CMAKE_CURRENT_BINARY_DIR}/version.h) -# Add target that generates baseversion-gen.c every time make is run -# if git version info is requested, or create it statically. -# This code is here instead of utility/CMakeLists.txt because CMake -# ignores set_source_file_properties from subdirectories. -set(GENERATED_VERSION_FILE - ${CMAKE_CURRENT_BINARY_DIR}/utility/baseversion-gen.c) -set(GENERATED_VERSION_FILE_SOURCE - ${CMAKE_CURRENT_SOURCE_DIR}/utility/baseversion-gen.c.cmakein) -if (GMX_GIT_VERSION_INFO) - add_custom_target(gmx-version ALL - COMMAND ${CMAKE_COMMAND} - -D GIT_EXECUTABLE="${GIT_EXECUTABLE}" - -D PROJECT_VERSION="${PROJECT_VERSION}" - -D PROJECT_SOURCE_DIR="${PROJECT_SOURCE_DIR}" - -D VERSION_CMAKEIN=${GENERATED_VERSION_FILE_SOURCE} - -D VERSION_OUT=${GENERATED_VERSION_FILE} - -P ${CMAKE_SOURCE_DIR}/cmake/gmxGenerateVersionInfo.cmake - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - DEPENDS ${GENERATED_VERSION_FILE_SOURCE} - COMMENT "Generating git version information") - set_source_files_properties(${GENERATED_VERSION_FILE} - PROPERTIES GENERATED true) -else() - set(GMX_PROJECT_VERSION_STR ${PROJECT_VERSION}) - configure_file(${GENERATED_VERSION_FILE_SOURCE} ${GENERATED_VERSION_FILE}) -endif() +# This code is here instead of utility/CMakeLists.txt, because CMake +# custom commands and source file properties can only be set in the directory +# that contains the target that uses them. +# TODO: Generate a header instead that can be included from baseversion.c. +# That probably simplifies things somewhat. +set(GENERATED_VERSION_FILE utility/baseversion-gen.c) +gmx_configure_version_file( + utility/baseversion-gen.c.cmakein ${GENERATED_VERSION_FILE} + REMOTE_HASH SOURCE_FILE) list(APPEND LIBGROMACS_SOURCES ${GENERATED_VERSION_FILE}) # apply gcc 4.4.x bug workaround if(GMX_USE_GCC44_BUG_WORKAROUND) include(gmxGCC44O3BugWorkaround) - gmx_apply_gcc44_bug_workaround("gmxlib/bondfree.c") + gmx_apply_gcc44_bug_workaround("bonded/bonded.cpp") gmx_apply_gcc44_bug_workaround("mdlib/force.c") gmx_apply_gcc44_bug_workaround("mdlib/constr.c") endif() -add_library(libgromacs ${LIBGROMACS_SOURCES}) -if (GMX_GIT_VERSION_INFO) - add_dependencies(libgromacs gmx-version) +if (GMX_GPU) + cuda_add_library(libgromacs ${LIBGROMACS_SOURCES} + OPTIONS + RELWITHDEBINFO -g + DEBUG -g -D_DEBUG_=1) +else() + add_library(libgromacs ${LIBGROMACS_SOURCES}) endif() # Recent versions of gcc and clang give warnings on scanner.cpp, which @@ -184,7 +180,6 @@ set_source_files_properties(selection/scanner.cpp PROPERTIES COMPILE_FLAGS "${_s target_link_libraries(libgromacs ${EXTRAE_LIBRARIES} - ${GMX_GPU_LIBRARIES} ${GMX_EXTRA_LIBRARIES} ${TNG_IO_LIBRARIES} ${FFT_LIBRARIES} ${LINEAR_ALGEBRA_LIBRARIES} @@ -200,19 +195,15 @@ set_target_properties(libgromacs PROPERTIES # for the binary if (NOT GMX_BUILD_MDRUN_ONLY OR BUILD_SHARED_LIBS) install(TARGETS libgromacs - LIBRARY DESTINATION ${LIB_INSTALL_DIR} - RUNTIME DESTINATION ${BIN_INSTALL_DIR} - ARCHIVE DESTINATION ${LIB_INSTALL_DIR} - COMPONENT libraries) + EXPORT libgromacs + LIBRARY DESTINATION ${LIB_INSTALL_DIR} + RUNTIME DESTINATION ${BIN_INSTALL_DIR} + ARCHIVE DESTINATION ${LIB_INSTALL_DIR} + COMPONENT libraries) endif() if (NOT GMX_BUILD_MDRUN_ONLY) - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libgromacs.pc.cmakein - ${CMAKE_CURRENT_BINARY_DIR}/libgromacs.pc @ONLY) - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libgromacs.pc - DESTINATION ${LIB_INSTALL_DIR}/pkgconfig - RENAME "libgromacs${GMX_LIBS_SUFFIX}.pc" - COMPONENT development) + include(InstallLibInfo.cmake) endif() if (INSTALL_CUDART_LIB) #can be set manual by user