CMake style corrections

This commit is contained in:
Pawel "l0ner" Soltys 2015-01-17 23:23:21 +01:00
parent 5fdb0e6227
commit 1cc6b0c9ef

@ -26,23 +26,23 @@ endif(NOT CMAKE_BUILD_TYPE)
# detect system type # detect system type
if(CMAKE_SYSTEM_NAME MATCHES "Linux") if(CMAKE_SYSTEM_NAME MATCHES "Linux")
message("Linux detected") message("Linux detected")
SET( METER_SOURCES "linux/memory.cc" "linux/cpu.cc" "linux/load.cc" ) set(METER_SOURCES "linux/memory.cc" "linux/cpu.cc" "linux/load.cc")
ELSEIF(CMAKE_SYSTEM_NAME MATCHES "Darwin") elseif(CMAKE_SYSTEM_NAME MATCHES "Darwin")
# Mac OS X source setting will go here # Mac OS X source setting will go here
message( "Darwin detected") message( "Darwin detected")
SET( METER_SOURCES "osx/memory.cc" "osx/cpu.cc" "osx/load.cc" ) set(METER_SOURCES "osx/memory.cc" "osx/cpu.cc" "osx/load.cc")
ELSEIF(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") elseif(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
# FreeBSD STUFF HERE # FreeBSD STUFF HERE
message("FreeBSD detected") message("FreeBSD detected")
message( WARNING "FreeBSD is still experimental!" ) message( WARNING "FreeBSD is still experimental!" )
SET( METER_SOURCES "bsd/memory_freebsd.cc" "bsd/cpu.cc" "bsd/load.cc" ) set( METER_SOURCES "bsd/memory_freebsd.cc" "bsd/cpu.cc" "bsd/load.cc" )
ELSEIF(CMAKE_SYSTEM_NAME MATCHES "OpenBSD") elseif(CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
# OpenBSD Stuff Here # OpenBSD Stuff Here
message( "OpenBSD detected") message( "OpenBSD detected")
message( FATAL_ERROR "OpenBSD is not supported! See bsd/openBSD.txt for more message( FATAL_ERROR "OpenBSD is not supported! See bsd/openBSD.txt for more
info" ) info" )
SET( METER_SOURCES "bsd/memory_openbsd.cc" "bsd/cpu.cc" "bsd/load.cc" ) set( METER_SOURCES "bsd/memory_openbsd.cc" "bsd/cpu.cc" "bsd/load.cc" )
ELSE() else()
message( FATAL_ERROR "Cannot be compiled on this system" ) message( FATAL_ERROR "Cannot be compiled on this system" )
endif() endif()
@ -54,20 +54,20 @@ if (CMAKE_COMPILER_IS_GNUCC)
execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion
OUTPUT_VARIABLE GCC_VERSION) OUTPUT_VARIABLE GCC_VERSION)
if (GCC_VERSION VERSION_EQUAL 4.6) if (GCC_VERSION VERSION_EQUAL 4.6)
SET( GCC_COVERAGE_COMPILE_FLAGS "-std=c++0x " ) set( GCC_COVERAGE_COMPILE_FLAGS "-std=c++0x " )
elseif (GCC_VERSION GREATER 4.6) elseif (GCC_VERSION GREATER 4.6)
SET( GCC_COVERAGE_COMPILE_FLAGS "-std=c++11 " ) set( GCC_COVERAGE_COMPILE_FLAGS "-std=c++11 " )
else() else()
message( FATAL_ERROR "You need gcc version >= 4.6") message( FATAL_ERROR "You need gcc version >= 4.6")
endif() endif()
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
SET( GCC_COVERAGE_COMPILE_FLAGS "-std=c++11 " ) set( GCC_COVERAGE_COMPILE_FLAGS "-std=c++11 " )
else() else()
message( WARNING "Untested compiler detected. You may need to set c++11 message( WARNING "Untested compiler detected. You may need to set c++11
support manually through CMakeList.txt file") support manually through CMakeList.txt file")
SET( GCC_COVERAGE_COMPILE_FLAGS "" ) set( GCC_COVERAGE_COMPILE_FLAGS "" )
endif() endif()
SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_COVERAGE_COMPILE_FLAGS}" ) set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_COVERAGE_COMPILE_FLAGS}" )
# add binary tree so we find version.h # add binary tree so we find version.h
include_directories("${PROJECT_BINARY_DIR}" ) include_directories("${PROJECT_BINARY_DIR}" )