Velocities and forces for selections.
[gromacs/qmmm-gamess-us.git] / cmake / gmxCFlags.cmake
blob7e2903d5dbdfca4a4b8c72f575299e2568beee56
1 MACRO(gmx_c_flags)
3 include(CheckCCompilerFlag)
5 if( CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX )
6   CHECK_C_COMPILER_FLAG( "-O3" XFLAGS_O3)
7   IF (XFLAGS_O3)
8     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3")
9   ENDIF(XFLAGS_O3)
11   CHECK_C_COMPILER_FLAG( "-Wall -Wno-unused" XFLAGS_WARN)
12   IF (XFLAGS_WARN)
13     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wno-unused")
14   ENDIF(XFLAGS_WARN)
15   CHECK_C_COMPILER_FLAG( "-std=gnu99" XFLAGS_GNU99)
16   IF (XFLAGS_GNU99)
17   set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99")
18   ENDIF(XFLAGS_GNU99)
20   CHECK_C_COMPILER_FLAG( "-march=native" XFLAGS_MARCH)
21   IF (XFLAGS_MARCH)
22     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=native")
23   ENDIF(XFLAGS_MARCH)
24 endif( CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX )
26 MARK_AS_ADVANCED(XFLAGS_O3 XFLAGS_WARN XFLAGS_GNU99 XFLAGS_MARCH)
28 ENDMACRO(gmx_c_flags)