Fix building on non-rpm systems when rpm is not installed

master
Rogier 2016-06-25 09:36:02 +02:00
parent a08af6d0c6
commit 8e70740c7e
2 changed files with 14 additions and 10 deletions

View File

@ -497,16 +497,18 @@ else(WIN32)
# .rpm settings
# RPM package building needs rpmbuild, but cpack doesn't check for it first...
find_program(RPM_AVAILABLE "rpmbuild")
execute_process(COMMAND rpm -q rpm
RESULT_VARIABLE RPM_VERSION_EXIT
OUTPUT_VARIABLE RPMCOMMAND_PACKAGE_VERSION
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(RPM_VERSION_EXIT)
if(NOT RPMCOMMAND_PACKAGE_VERSION STREQUAL "package rpm is not installed")
message(FATAL_ERROR "Could not determine version of installed rpm package")
endif(NOT RPMCOMMAND_PACKAGE_VERSION STREQUAL "package rpm is not installed")
endif(RPM_VERSION_EXIT)
if(RPM_AVAILABLE)
execute_process(COMMAND rpm -q rpm
RESULT_VARIABLE RPM_VERSION_EXIT
OUTPUT_VARIABLE RPMCOMMAND_PACKAGE_VERSION
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(RPM_VERSION_EXIT)
if(NOT RPMCOMMAND_PACKAGE_VERSION STREQUAL "package rpm is not installed")
message(FATAL_ERROR "Could not determine version of installed rpm package")
endif(NOT RPMCOMMAND_PACKAGE_VERSION STREQUAL "package rpm is not installed")
endif(RPM_VERSION_EXIT)
endif(RPM_AVAILABLE)
if(RPM_AVAILABLE AND NOT RPM_VERSION_EXIT)
message(STATUS "rpmbuild found - enabling .rpm package generation")
set(CPACK_GENERATOR ${CPACK_GENERATOR} RPM)

View File

@ -9,6 +9,8 @@
(intentionally).
- Fixed a compilation failure on Fedora when using postgresql
- Fixed failure to compile with gcc 6
- Fixed failure to compile when rpm is not installed
(e.g. on non-rpm systems...)
[31 May 2016]
Features:
- Support for postgresql backend added