1 cmake_minimum_required(VERSION 2.6)
5 # PROJECT_VERSION should have the following structure:
6 # VERSION[-dev-SUFFIX] where the VERSION can have any form and the suffix
7 set(PROJECT_VERSION "4.0.99-dev-20100315"
8 CACHE STRING "Gromacs version string")
10 # Cmake modules/macros are in a subdirectory to keep this file cleaner
11 set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
13 if(NOT CMAKE_BUILD_TYPE)
14 set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." FORCE)
15 endif(NOT CMAKE_BUILD_TYPE)
20 ########################################################################
21 # Fix stupid flags on MSVC
22 ########################################################################
23 IF(CMAKE_GENERATOR MATCHES "Visual Studio")
24 STRING(REPLACE /MD /MT CMAKE_C_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE})
25 SET(CMAKE_C_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE} CACHE STRING "" FORCE)
26 STRING(REPLACE /MD /MT CMAKE_C_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG})
27 SET(CMAKE_C_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG} CACHE STRING "" FORCE)
28 ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio")
30 set(GMX_EXTRA_LIBRARIES)
32 ######################################################################
34 # these need ot be done early (before further tests).
35 #####################################################################
37 include(CheckCCompilerFlag)
38 include(CheckCXXCompilerFlag)
40 # --- REMOVED as bugzilla 431 turned out to be a bug in GB
41 # and there is no confirmed case in which gcc causes a crash
42 # check for buggy GCC 4.1.x
43 # include(gmxCheckGCCVersion)
48 ########################################################################
49 # User input options #
50 ########################################################################
51 option(GMX_DOUBLE "Use double precision" OFF)
52 option(GMX_MPI "Build a parallel (message-passing) version of GROMACS" OFF)
53 option(GMX_THREADS "Build a parallel (threaded-based) version of GROMACS)" ON)
54 option(GMX_SOFTWARE_INVSQRT "Use GROMACS software 1/sqrt" ON)
55 option(GMX_FAHCORE "Build a library with mdrun functionality" OFF)
56 option(GMX_OPENMM "Accelerated execution on GPUs through the OpenMM library" OFF)
57 set(GMX_ACCELERATION "auto"
58 CACHE STRING "Accelerated kernels. Pick one of: none, SSE, BlueGene, Power6, ia64, altivec")
60 set(GMX_FFT_LIBRARY "fftw3"
61 CACHE STRING "FFT library choices: fftw3,fftw2,mkl,fftpack[built-in]")
62 option(GMX_DISABLE_FFTW_MEASURE
63 "Do not optimize FFTW setups (not needed with SSE)" OFF)
64 set(GMX_QMMM_PROGRAM "none"
65 CACHE STRING "QM package choices: none,gaussian,mopac,gamess,orca")
66 option(GMX_BROKEN_CALLOC "Work around broken calloc()" OFF)
67 option(BUILD_SHARED_LIBS "Enable shared libraries (can be problematic with MPI)" OFF)
68 option(GMX_MPI_IN_PLACE "Enable MPI_IN_PLACE for MPIs that have it defined" ON)
69 option(GMX_DLOPEN "Compile with dlopen, needed to read VMD supported file formats" ON)
70 mark_as_advanced(GMX_MPI_IN_PLACE)
73 option(GMX_IA32_ASM "Add SSE assembly files for IA32" OFF)
74 option(GMX_X86_64_ASM "Add SSE assembly files for X86_64" OFF)
75 option(USE_VERSION_H "Generate development version string/information" ON)
76 # --- REMOVED as bugzilla 431 turned out to be a bug in GB
77 # and there is no confirmed case in which gcc causes a crash
78 # option(GMX_DISABLE_GCC41_CHECK "Disable check for (buggy) gcc 4.1.x" OFF)
80 set(GMX_BINARY_SUFFIX "" CACHE STRING "Suffix for GROMACS binaries.")
84 ########################################################################
86 ########################################################################
89 #message(FATAL_ERROR "Thread-based parallelization conflicts with MPI.")
90 set(GMX_THREADS OFF CACHE BOOL
91 "Thread-based parallelization conflicts with MPI." FORCE)
95 set(GROMACS_C_FLAGS ${GROMACS_FLAGS} ${MPI_COMPILE_FLAGS})
96 set(GROMACS_LINKER_FLAGS ${GROMACS_LINKER_FLAGS} ${MPI_LINK_FLAGS})
98 include_directories(${MPI_INCLUDE_PATH})
99 list(APPEND GMX_EXTRA_LIBRARIES ${MPI_LIBRARIES})
100 add_definitions( -DMPI ) #for FAHCORE
101 include(gmxTestMPI_IN_PLACE)
102 if (GMX_MPI_IN_PLACE)
103 gmx_test_mpi_in_place(MPI_IN_PLACE_EXISTS)
104 endif (GMX_MPI_IN_PLACE)
106 message(FATAL_ERROR "MPI support requested, but no MPI compiler found.")
108 include(gmxTestCatamount)
109 gmx_test_catamount(GMX_CRAY_XT3)
118 #######################################################################
119 # Check for options incompatible with OpenMM build #
120 #######################################################################
122 cmake_minimum_required(VERSION 2.6.4)
123 # we'll use the built-in fft to avoid unnecessary dependencies
124 set (GMX_FFT_LIBRARY "fftpack")
126 message(FATAL_ERROR "The OpenMM build is not compatible with MPI!")
129 message(STATUS "Threads not compatible with OpenMM build, disabled")
132 if(GMX_SOFTWARE_INVSQRT)
133 set(GMX_SOFTWARE_INVSQRT OFF)
134 endif(GMX_SOFTWARE_INVSQRT)
135 if(NOT GMX_ACCELERATION MATCHES "auto|none|None|NONE" OR NOT ${GMX_ACCELERATION} STREQUAL "")
136 message(WARNING "The OpenMM build does not support other acceleration modes!")
137 set(GMX_ACCELERATION "none")
140 message(FATAL_ERROR "The OpenMM build does not support FAH build!")
146 ########################################################################
147 # Basic system tests (standard libraries, headers, functions, types) #
148 ########################################################################
149 include(CheckIncludeFiles)
150 check_include_files(string.h HAVE_STRING_H)
151 check_include_files(math.h HAVE_MATH_H)
152 check_include_files(limits.h HAVE_LIMITS_H)
153 check_include_files(memory.h HAVE_MEMORY_H)
154 check_include_files(unistd.h HAVE_UNISTD_H)
155 check_include_files(pwd.h HAVE_PWD_H)
156 check_include_files(stdint.h HAVE_STDINT_H)
157 check_include_files(stdlib.h HAVE_STDLIB_H)
158 check_include_files(pthread.h HAVE_PTHREAD_H)
159 check_include_files(dirent.h HAVE_DIRENT_H)
160 check_include_files(inttypes.h HAVE_INTTYPES_H)
161 check_include_files(regex.h HAVE_REGEX_H)
162 check_include_files(copyfile.h HAVE_COPYFILE_H)
163 check_include_files(sys/types.h HAVE_SYS_TYPES_H)
164 check_include_files(sys/stat.h HAVE_SYS_STAT_H)
165 check_include_files(sys/time.h HAVE_SYS_TIME_H)
166 check_include_files(rpc/rpc.h HAVE_RPC_RPC_H)
167 check_include_files("rpc/rpc.h;rpc/xdr.h" HAVE_RPC_XDR_H)
169 check_include_files(xmmintrin.h HAVE_XMMINTRIN_H)
170 check_include_files(emmintrin.h HAVE_EMMINTRIN_H)
171 check_include_files(pmmintrin.h HAVE_PMMINTRIN_H)
172 check_include_files(smmintrin.h HAVE_SMMINTRIN_H)
173 check_include_files(io.h HAVE_IO_H)
176 include(CheckFunctionExists)
177 check_function_exists(strcasecmp HAVE_STRCASECMP)
178 check_function_exists(strdup HAVE_STRDUP)
179 check_function_exists(vprintf HAVE_VPRINTF)
180 check_function_exists(memcmp HAVE_MEMCMP)
181 check_function_exists(posix_memalign HAVE_POSIX_MEMALIGN)
182 check_function_exists(memalign HAVE_MEMALIGN)
183 check_function_exists(_aligned_malloc HAVE__ALIGNED_MALLOC)
184 check_function_exists(gettimeofday HAVE_GETTIMEOFDAY)
185 check_function_exists(isnan HAVE_ISNAN)
186 check_function_exists(_isnan HAVE__ISNAN)
187 check_function_exists(isfinite HAVE_ISFINITE)
188 check_function_exists(_isfinite HAVE__ISFINITE)
189 check_function_exists(fsync HAVE_FSYNC)
190 check_function_exists(_fileno HAVE__FILENO)
191 check_function_exists(fileno HAVE_FILENO)
192 check_function_exists(_commit HAVE__COMMIT)
193 check_function_exists(copyfile HAVE_COPYFILE)
194 # check_function_exists(CopyFile HAVE_WIN_COPYFILE)
195 # After large files? check_function_exists(fseeko HAVE_FSEEKO)
197 include(CheckLibraryExists)
198 check_library_exists(m sqrt "" HAVE_LIBM)
199 check_library_exists(m cbrt "" HAVE_CBRT)
201 include(CheckTypeSize)
202 check_type_size("bool" SIZEOF_BOOL) # will also set HAVE_BOOL
203 check_type_size("int" SIZEOF_INT)
204 check_type_size("long int" SIZEOF_LONG_INT)
205 check_type_size("long long int" SIZEOF_LONG_LONG_INT)
206 check_type_size("off_t" SIZEOF_OFF_T)
207 check_type_size("void *" SIZEOF_VOIDP)
209 if (SIZEOF_VOIDP LESS 8)
210 set(GMX_64_BIT FALSE)
211 else (SIZEOF_VOIDP LESS 8)
213 endif (SIZEOF_VOIDP LESS 8)
215 # Check for some basic types that we *need*, so set these to int if they are not present
216 check_type_size(uid_t uid_t)
223 check_type_size(gid_t gid_t)
230 check_type_size(size_t size_t)
237 check_type_size(off_t off_t)
244 include(TestBigEndian)
245 test_big_endian(GMX_INTEGER_BIG_ENDIAN)
250 ########################################################################
251 # Find external packages #
252 ########################################################################
254 find_package(LibXml2)
257 include_directories(${LIBXML2_INCLUDE_DIR})
258 set(PKG_XML libxml-2.0)
259 set(XML_LIBRARIES ${LIBXML2_LIBRARIES})
266 include_directories(${GSL_INCLUDE_DIR})
272 # X11 includes/libraries are only set in the ngmx subdirectory!
279 set(THREAD_MPI_LIB thread_mpi)
281 string(TOUPPER ${GMX_FFT_LIBRARY} ${GMX_FFT_LIBRARY})
282 if(${GMX_FFT_LIBRARY} STREQUAL "FFTW2")
283 message(FATAL_ERROR "FFTW2 can't be used with threads. Try fftw3 or mkl.")
288 set(CUDA_BUILD_EMULATION OFF)
289 find_package(CUDA 3.1 REQUIRED)
290 add_definitions(-DGMX_OPENMM)
291 if(CMAKE_BUILD_TYPE STREQUAL "DEBUG")
292 set(CUDA_VERBOSE_BUILD ON)
298 find_library(ACCELERATE_FRAMEWORK Accelerate)
299 list(APPEND GMX_EXTRA_LIBRARIES ${ACCELERATE_FRAMEWORK})
302 # only bother with finding git and using version.h if the source is a git repo
303 if(EXISTS "${CMAKE_SOURCE_DIR}/.git")
305 # We need at least git v1.5.1 be able to parse git's date output. If not
306 # fund or the version is too small, we can't generate version information.
307 find_package(Git 1.5.1)
308 # this should at some point become VERSION_LESS
309 if(NOT Git_FOUND OR Git_VERSION STRLESS "1.5.1")
310 message("No compatible git version found, won't be able to generate proper development version information.")
314 set(USE_VERSION_H OFF)
318 list(APPEND GMX_EXTRA_LIBRARIES ${CMAKE_DL_LIBS})
321 ########################################################################
322 # Generate development version info for cache
323 ########################################################################
324 # set(GEN_VERSION_INFO_INTERNAL "ON")
325 # include(gmxGenerateVersionString)
327 ########################################################################
328 # Our own GROMACS tests
329 ########################################################################
331 add_definitions( -DHAVE_CONFIG_H )
332 include_directories(${CMAKE_BINARY_DIR}/src)
333 include_directories(${CMAKE_SOURCE_DIR}/include)
335 include(gmxCheckBuildUserTime)
336 gmx_check_build_user_time(BUILD_TIME BUILD_USER BUILD_MACHINE)
338 include(gmxTestFloatFormat)
339 gmx_test_float_format(GMX_FLOAT_FORMAT_IEEE754
340 GMX_IEEE754_BIG_ENDIAN_BYTE_ORDER
341 GMX_IEEE754_BIG_ENDIAN_WORD_ORDER)
343 include(gmxTestLargeFiles)
344 gmx_test_large_files(GMX_LARGEFILES)
346 include(gmxTestSignal)
347 gmx_test_retsigtype(RETSIGTYPE)
349 include(gmxTestInline)
350 gmx_test_inline(INLINE_KEYWORD)
352 include(gmxTestRestrict)
353 gmx_test_inline(RESTRICT_KEYWORD)
355 include(gmxTestPipes)
356 gmx_test_pipes(HAVE_PIPES)
358 include(gmxTestInlineASM)
359 gmx_test_inline_asm_gcc_x86(GMX_X86_GCC_INLINE_ASM)
360 gmx_test_inline_asm_msvc_x86(GMX_X86_MSVC_INLINE_ASM)
362 # turn on SSE if supported with reasonable defaults.
363 if (${GMX_ACCELERATION} STREQUAL "auto")
364 if (GMX_X86_GCC_INLINE_ASM)
365 set(GMX_ACCELERATION "SSE" CACHE STRING "Accelerated kernels. Pick one of: none, SSE, BlueGene, Power6, ia64, altivec" FORCE)
367 set(GMX_X86_64_ASM ON CACHE BOOL
368 "Add SSE assembly files for x86_64" FORCE)
370 set(GMX_IA32_ASM ON CACHE BOOL
371 "Add SSE assembly files for IA32" FORCE)
373 endif (GMX_X86_GCC_INLINE_ASM)
374 endif (${GMX_ACCELERATION} STREQUAL "auto")
380 gmx_test_xdr(GMX_SYSTEM_XDR)
381 if(NOT GMX_SYSTEM_XDR)
382 set(GMX_INTERNAL_XDR 1)
383 endif(NOT GMX_SYSTEM_XDR)
385 if(GMX_FORTRAN OR GMX_POWER6)
386 enable_language(Fortran)
387 include(FortranCInterface)
388 discover_fortran_mangling(prefix isupper suffix extra_under_score found)
389 if(extra_under_score)
391 endif(extra_under_score)
394 set(F77_FUNCDEF "${prefix} ## NAME ## ${suffix}")
395 set(F77_FUNCDEF_ "${prefix} ## NAME ## ${suffix}${extrasuffix}")
397 set(F77_FUNCDEF "${prefix} ## name ## ${suffix}")
398 set(F77_FUNCDEF_ "${prefix} ## name ## ${suffix}${extrasuffix}")
400 else(GMX_FORTRAN OR GMX_POWER6)
401 set(F77_FUNCDEF "name ## _")
402 set(F77_FUNCDEF_ "name ## _")
403 endif(GMX_FORTRAN OR GMX_POWER6)
406 # Process nonbonded accelerated kernels settings
407 option(GMX_ASM_USECCOMPILER "Use C compiler for assembly" ON)
408 string(TOUPPER ${GMX_ACCELERATION} ${GMX_ACCELERATION})
409 if(${GMX_ACCELERATION} STREQUAL "NONE")
411 elseif(${GMX_ACCELERATION} STREQUAL "SSE")
413 # for 32-bit compiles, we might need to turn on sse
414 CHECK_C_COMPILER_FLAG("-msse2" XFLAGS_SSE)
416 set(GROMACS_C_FLAGS "-msse2 ${GROMACS_C_FLAGS}")
418 CHECK_CXX_COMPILER_FLAG("-msse2" XXFLAGS_SSE)
420 set(GROMACS_CXX_FLAGS "-msse2 ${GROMACS_CXX_FLAGS}")
422 endif (NOT GMX_64_BIT)
425 option(GMX_ASM_USEASM-ATT "Use ATT-style assembly" ON)
427 else(GMX_IA32_ASM) #only use intrinsic if not using the ASM loops
430 endif(HAVE_XMMINTRIN_H)
433 option(GMX_ASM_USEASM-ATT "Use ATT-style assembly" ON)
434 set(GMX_X86_64_SSE 1)
435 else(GMX_X86_64_ASM) #only use intrinsic if not using the ASM loops
438 endif(NOT GMX_IA32_ASM)
439 endif(GMX_X86_64_ASM)
440 endif(HAVE_EMMINTRIN_H)
441 # if(HAVE_PMMINTRIN_H)
443 # endif(HAVE_PMMINTRIN_H)
444 # if(HAVE_SMMINTRIN_H)
446 # endif(HAVE_SMMINTRIN_H)
448 elseif(${GMX_ACCELERATION} STREQUAL "FORTRAN")
450 elseif(${GMX_ACCELERATION} STREQUAL "BLUEGENE")
452 elseif(${GMX_ACCELERATION} STREQUAL "POWER6")
454 elseif(${GMX_ACCELERATION} STREQUAL "IA64")
456 set(DISABLE_WATERWATER_NLIST 1)
457 set(DISABLE_WATER_NLIST 1)
458 elseif(${GMX_ACCELERATION} STREQUAL "ALTIVEC")
459 check_include_files(altivec.h HAVE_ALTIVEC_H)
461 set(GMX_PPC_ALTIVEC 1)
462 endif(HAVE_ALTIVEC_H)
463 else(${GMX_ACCELERATION} STREQUAL "NONE")
464 MESSAGE(FATAL_ERROR "Unrecognized option for accelerated kernels: ${GMX_ACCELERATION}. Pick one of none, SSE, Fortran, BlueGene, Power6, ia64, altivec")
465 endif(${GMX_ACCELERATION} STREQUAL "NONE")
473 # Process QM/MM Settings
474 string(TOUPPER ${GMX_QMMM_PROGRAM} ${GMX_QMMM_PROGRAM})
475 if(${GMX_QMMM_PROGRAM} STREQUAL "GAUSSIAN")
476 set(GMX_QMMM_GAUSSIAN 1)
477 elseif(${GMX_QMMM_PROGRAM} STREQUAL "MOPAC")
478 set(GMX_QMMM_MOPAC 1)
479 elseif(${GMX_QMMM_PROGRAM} STREQUAL "GAMESS")
480 set(GMX_QMMM_GAMESS 1)
481 elseif(${GMX_QMMM_PROGRAM} STREQUAL "ORCA")
483 elseif(${GMX_QMMM_PROGRAM} STREQUAL "NONE")
485 else(${GMX_QMMM_PROGRAM} STREQUAL "GAUSSIAN")
486 MESSAGE(FATAL_ERROR "Invalid QM/MM program option: ${GMX_QMMM_PROGRAM}. Choose one of: Gaussian, Mopac, Gamess, Orca, None")
487 endif(${GMX_QMMM_PROGRAM} STREQUAL "GAUSSIAN")
489 # Process FFT library settings - if not OpenMM build
490 string(TOUPPER ${GMX_FFT_LIBRARY} ${GMX_FFT_LIBRARY})
493 if(${GMX_FFT_LIBRARY} STREQUAL "FFTW3")
494 # MESSAGE(STATUS "Using external FFT library - fftw3")
496 find_package(FFTW3 REQUIRED)
499 find_package(FFTW3F REQUIRED)
500 set(PKG_FFT "fftw3f")
504 MESSAGE(FATAL_ERROR "Cannot find fftw3 (with correct precision). Fix it, choose another FFT library, or use the Gromacs built-in fftpack (slower)!")
505 endif(NOT FFTW3_FOUND)
508 include_directories(${FFTW3_INCLUDE_DIR})
509 set(FFT_LIBRARIES ${FFTW3_LIBRARIES})
511 elseif(${GMX_FFT_LIBRARY} STREQUAL "FFTW2")
512 # MESSAGE(STATUS "Using external FFT library - fftw2")
514 find_package(FFTW2 REQUIRED)
516 find_package(FFTW2F REQUIRED)
520 MESSAGE(FATAL_ERROR "Cannot find fftw2 (with correct precision). Fix it, choose another FFT library, or use the Gromacs built-in fftpack (slower)!")
521 endif(NOT FFTW2_FOUND)
522 include_directories(${FFTW2_INCLUDE_DIR})
523 set(FFT_LIBRARIES ${FFTW2_LIBRARIES})
524 set(PKG_FFT_LIBS ${FFTW2_LIBRARIES})
526 if("${FFTW2_LIBRARIES}" MATCHES "dfftw")
527 set(FFTW2_NAME_DFFTW 1)
528 elseif("${FFTW2_LIBRARIES}" MATCHES "sfftw")
529 set(FFTW2_NAME_SFFTW 1)
530 else("${FFTW2_LIBRARIES}" MATCHES "dfftw")
531 set(FFTW2_NAME_FFTW 1)
532 endif("${FFTW2_LIBRARIES}" MATCHES "dfftw")
535 elseif(${GMX_FFT_LIBRARY} STREQUAL "MKL")
536 # MESSAGE(STATUS "Using external FFT library - Intel MKL")
537 find_package(MKL REQUIRED)
538 include_directories(${MKL_INCLUDE_DIR})
539 set(FFT_LIBRARIES ${MKL_LIBRARIES})
540 set(PKG_FFT_LIBS ${MKL_LIBRARIES})
545 #elseif(${GMX_FFT_LIBRARY} STREQUAL "ACML")
546 # MESSAGE(STATUS "Using external FFT library - AMD core math library")
547 # set(GMX_FFT_ACML 1)
548 elseif(${GMX_FFT_LIBRARY} STREQUAL "FFTPACK")
549 MESSAGE(STATUS "Using internal FFT library - fftpack")
550 set(GMX_FFT_FFTPACK 1)
551 else(${GMX_FFT_LIBRARY} STREQUAL "FFTW3")
552 MESSAGE(FATAL_ERROR "Invalid FFT library setting: ${GMX_FFT_LIBRARY}. Choose one of: fftw3, fftw2, mkl, acml, fftpack")
553 endif(${GMX_FFT_LIBRARY} STREQUAL "FFTW3")
555 # MKL has BLAS/LAPACK routines
556 if(HAVE_MKL OR ACCELERATE_FRAMEWORK)
557 set(GMX_EXTERNAL_BLAS TRUE CACHE BOOL "Use external BLAS instead of built-in")
558 set(GMX_EXTERNAL_LAPACK TRUE CACHE BOOL "Use external LAPACK instead of built-in")
559 else(HAVE_MKL OR ACCELERATE_FRAMEWORK)
560 set(GMX_EXTERNAL_BLAS FALSE CACHE BOOL "Use external LAPACK instead of built-in")
561 set(GMX_EXTERNAL_LAPACK FALSE CACHE BOOL "Use external LAPACK instead of built-in")
562 endif(HAVE_MKL OR ACCELERATE_FRAMEWORK)
564 # Math and thread libraries must often come after all others when linking...
566 list(APPEND GMX_EXTRA_LIBRARIES m)
572 set(COREWRAP_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/../corewrap" CACHE STRING
573 "Path to swindirect.h")
574 include_directories(${COREWRAP_INCLUDE_DIR})
577 # # # # # # # # # # NO MORE TESTS AFTER THIS LINE! # # # # # # # # # # #
578 # these are set after everything else
579 if (NOT DEFINED GROMACS_C_FLAGS_SET)
580 set(GROMACS_C_FLAGS_SET true CACHE INTERNAL "Whether to reset the C flags"
582 set(CMAKE_C_FLAGS "${GROMACS_C_FLAGS} ${CMAKE_C_FLAGS}" CACHE STRING
583 "Flags used by the compiler during all build types" FORCE)
584 set(CMAKE_CXX_FLAGS "${GROMACS_CXX_FLAGS} ${CMAKE_CXX_FLAGS}" CACHE STRING
585 "Flags used by the compiler during all build types" FORCE)
586 set(CMAKE_EXE_LINKER_FLAGS
587 "${GROMACS_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}"
588 CACHE STRING "Linker flags" FORCE)
589 endif (NOT DEFINED GROMACS_C_FLAGS_SET)
591 ########################################################################
592 # Specify install locations and which subdirectories to process #
593 ########################################################################
594 set(LIB_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/lib)
595 set(BIN_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/bin)
596 set(DATA_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/share/gromacs)
597 set(MAN_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/share/man)
598 set(INCL_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/include)
600 set(GMXLIBDIR ${DATA_INSTALL_DIR}/top)
603 add_subdirectory(share)
604 add_subdirectory(include)
605 add_subdirectory(man)
607 add_subdirectory(src)
609 #######################
611 #######################
613 "${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
614 "${CMAKE_CURRENT_BINARY_DIR}/cmake/cmake_uninstall.cmake"
616 ###########################
617 ADD_CUSTOM_TARGET(uninstall
618 "${CMAKE_COMMAND}" -P
619 "${CMAKE_CURRENT_BINARY_DIR}/cmake/cmake_uninstall.cmake")
620 ###########################
623 ########################################################################
625 ########################################################################
628 add_test(TestBuildAll make)
630 add_subdirectory(tests)