Commit 780516e7 authored by Ghislain MARY's avatar Ghislain MARY

Generate RPM specfile only when targeting Linux platform.

parent d3e747b3
......@@ -108,22 +108,24 @@ macro(bc_project_build_version PROJECT_VERSION PROJECT_BUILD_VERSION)
endmacro()
macro(bc_generate_rpm_specfile SOURCE DEST)
set(BC_PACKAGE_NAME_PREFIX "" CACHE STRING "Prefix for name of package.")
if(UNIX AND NOT APPLE AND NOT ANDROID)
set(BC_PACKAGE_NAME_PREFIX "" CACHE STRING "Prefix for name of package.")
get_cmake_property(_variableNames VARIABLES)
set(RPM_ALL_CMAKE_OPTIONS "")
foreach(_variableName ${_variableNames})
if(_variableName MATCHES "^ENABLE_")
if(${_variableName})
set(${_variableName} 1)
else()
set(${_variableName} 0)
get_cmake_property(_variableNames VARIABLES)
set(RPM_ALL_CMAKE_OPTIONS "")
foreach(_variableName ${_variableNames})
if(_variableName MATCHES "^ENABLE_")
if(${_variableName})
set(${_variableName} 1)
else()
set(${_variableName} 0)
endif()
set(RPM_ALL_CMAKE_OPTIONS "${RPM_ALL_CMAKE_OPTIONS} -D${_variableName}=${${_variableName}}")
endif()
set(RPM_ALL_CMAKE_OPTIONS "${RPM_ALL_CMAKE_OPTIONS} -D${_variableName}=${${_variableName}}")
endif()
endforeach()
configure_file(${SOURCE} ${DEST} @ONLY)
unset(RPM_ALL_CMAKE_OPTIONS)
unset(_variableNames)
endforeach()
configure_file(${SOURCE} ${DEST} @ONLY)
unset(RPM_ALL_CMAKE_OPTIONS)
unset(_variableNames)
endif()
endmacro()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment