Skip to content

Commit

Permalink
Linux: Add Fedora as supported distribution in CMakeLists.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
idrassi committed Sep 22, 2024
1 parent 68e2e01 commit ba8dd51
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/Build/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,15 @@ if ( UNIX )
file(READ "/etc/centos-release" CENTOS_RELEASE)
string(REGEX MATCH "release ([0-9 /\\.]+)" _ ${CENTOS_RELEASE})
set(PLATFORM_VERSION ${CMAKE_MATCH_1})

# Get fedora release version
elseif(EXISTS "/etc/fedora-release")

set ( PLATFORM "Fedora" )

file(READ "/etc/fedora-release" FEDORA_RELEASE)
string(REGEX MATCH "release ([0-9 /\\.]+)" _ ${FEDORA_RELEASE})
set(PLATFORM_VERSION ${CMAKE_MATCH_1})

# Only if distribution uses systemd and if all previous files didn't exist
# i.e OpenSUSE
Expand All @@ -128,6 +137,8 @@ if ( UNIX )
set ( PLATFORM "Debian" )
elseif ( FULL_PLATFORM MATCHES "^.*CentOS.*$" )
set ( PLATFORM "CentOS" )
elseif ( FULL_PLATFORM MATCHES "^.*Fedora.*$" )
set ( PLATFORM "Fedora" )
endif ( )

# Get ditribution release version
Expand Down Expand Up @@ -164,7 +175,7 @@ if ( PLATFORM STREQUAL "Debian" OR PLATFORM STREQUAL "Ubuntu" )
execute_process(COMMAND dpkg --print-architecture OUTPUT_VARIABLE ARCHITECTURE OUTPUT_STRIP_TRAILING_WHITESPACE)
endif( )

elseif ( ( PLATFORM STREQUAL "CentOS" ) OR ( PLATFORM STREQUAL "openSUSE" ) )
elseif ( ( PLATFORM STREQUAL "CentOS" ) OR ( PLATFORM STREQUAL "openSUSE" ) OR ( PLATFORM STREQUAL "Fedora" ))

execute_process(COMMAND arch OUTPUT_VARIABLE ARCHITECTURE OUTPUT_STRIP_TRAILING_WHITESPACE)

Expand Down Expand Up @@ -295,7 +306,7 @@ if ( ( PLATFORM STREQUAL "Debian" ) OR ( PLATFORM STREQUAL "Ubuntu" ) )
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA ${DEBIAN_PREINST};${DEBIAN_POSTINST};${DEBIAN_PRERM};${DEBIAN_POSTRM})
set(CPACK_DEBIAN_PACKAGE_CONFLICTS "${CONFLICT_PACKAGE}")

elseif ( ( PLATFORM STREQUAL "CentOS" ) OR ( PLATFORM STREQUAL "openSUSE" ) )
elseif ( ( PLATFORM STREQUAL "CentOS" ) OR ( PLATFORM STREQUAL "openSUSE" ) OR ( PLATFORM STREQUAL "Fedora" ))

# RPM control script(s)
file( MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/Packaging/rpm-control)
Expand Down

0 comments on commit ba8dd51

Please sign in to comment.