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

This commit is contained in:
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,6 +497,7 @@ else(WIN32)
# .rpm settings # .rpm settings
# RPM package building needs rpmbuild, but cpack doesn't check for it first... # RPM package building needs rpmbuild, but cpack doesn't check for it first...
find_program(RPM_AVAILABLE "rpmbuild") find_program(RPM_AVAILABLE "rpmbuild")
if(RPM_AVAILABLE)
execute_process(COMMAND rpm -q rpm execute_process(COMMAND rpm -q rpm
RESULT_VARIABLE RPM_VERSION_EXIT RESULT_VARIABLE RPM_VERSION_EXIT
OUTPUT_VARIABLE RPMCOMMAND_PACKAGE_VERSION OUTPUT_VARIABLE RPMCOMMAND_PACKAGE_VERSION
@ -507,6 +508,7 @@ else(WIN32)
message(FATAL_ERROR "Could not determine version of installed rpm package") message(FATAL_ERROR "Could not determine version of installed rpm package")
endif(NOT RPMCOMMAND_PACKAGE_VERSION STREQUAL "package rpm is not installed") endif(NOT RPMCOMMAND_PACKAGE_VERSION STREQUAL "package rpm is not installed")
endif(RPM_VERSION_EXIT) endif(RPM_VERSION_EXIT)
endif(RPM_AVAILABLE)
if(RPM_AVAILABLE AND NOT RPM_VERSION_EXIT) if(RPM_AVAILABLE AND NOT RPM_VERSION_EXIT)
message(STATUS "rpmbuild found - enabling .rpm package generation") message(STATUS "rpmbuild found - enabling .rpm package generation")
set(CPACK_GENERATOR ${CPACK_GENERATOR} RPM) set(CPACK_GENERATOR ${CPACK_GENERATOR} RPM)

View File

@ -9,6 +9,8 @@
(intentionally). (intentionally).
- Fixed a compilation failure on Fedora when using postgresql - Fixed a compilation failure on Fedora when using postgresql
- Fixed failure to compile with gcc 6 - 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] [31 May 2016]
Features: Features:
- Support for postgresql backend added - Support for postgresql backend added