1
0
Fork 0

Add cmake Linux distro detection.

This commit is contained in:
ThorstenB 2012-08-18 13:40:57 +02:00
parent c15af10a7d
commit 9c87aeb1fc
2 changed files with 16 additions and 0 deletions

View file

@ -26,6 +26,9 @@ if(InSourceBuild)
message(WARNING " mkdir ../fgbuild && cd ../fgbuild && cmake ${CMAKE_SOURCE_DIR}")
endif(InSourceBuild)
# System detection/default settings
include( DetectDistro )
set(CMAKE_DEBUG_POSTFIX "d" CACHE STRING "add a postfix, usually d on windows")
set(CMAKE_RELEASE_POSTFIX "" CACHE STRING "add a postfix, usually empty on windows")
set(CMAKE_RELWITHDEBINFO_POSTFIX "" CACHE STRING "add a postfix, usually empty on windows")

View file

@ -0,0 +1,13 @@
# DetectDistro.cmake -- Detect Linux distribution
message(STATUS "System is: ${CMAKE_SYSTEM_NAME}")
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
# Detect Linux distribution (if possible)
execute_process(COMMAND "/usr/bin/lsb-release" "-is"
TIMEOUT 4
OUTPUT_VARIABLE LINUX_DISTRO
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
message(STATUS "Linux distro is: ${LINUX_DISTRO}")
endif()