Skip to content

Commit

Permalink
Fix Ubuntu detection at build configure stage
Browse files Browse the repository at this point in the history
  • Loading branch information
vnaydionov committed Feb 10, 2013
1 parent 62d749d commit c18cf35
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,18 @@ include(SociDependencies)

if(EXISTS /etc/os-release)
file(READ /etc/os-release OS_RELEASE)
string(REGEX MATCH "ID(_LIKE?)=debian" DEBIAN ${OS_RELEASE})
string(REGEX MATCH "ID(_LIKE?)=fedora" FEDORA ${OS_RELEASE})
string(REGEX MATCH "ID(_LIKE?)=ubuntu" UBUNTU ${OS_RELEASE})
string(REGEX MATCH "ID(_LIKE)?=debian" DEBIAN ${OS_RELEASE})
string(REGEX MATCH "ID(_LIKE)?=fedora" FEDORA ${OS_RELEASE})
string(REGEX MATCH "ID(_LIKE)?=ubuntu" UBUNTU ${OS_RELEASE})
elseif(EXISTS /etc/lsb-release)
file(READ /etc/lsb-release OS_RELEASE)
string(REGEX MATCH "DISTRIB_ID=[Uu]buntu" UBUNTU ${OS_RELEASE})
string(REGEX MATCH "DISTRIB_ID=[Db]ebian" DEBIAN ${OS_RELEASE})
endif()


if(DEBIAN)
if(UBUNTU)
set(SOCI_LIBDIR "lib")
elseif(DEBIAN)
execute_process(COMMAND uname -m
OUTPUT_VARIABLE SOCI_ARCH
OUTPUT_STRIP_TRAILING_WHITESPACE)
Expand Down

0 comments on commit c18cf35

Please sign in to comment.