Commit 720b9bba authored by Victor Yacovlev's avatar Victor Yacovlev

Handle disabled subdirs in rpm build

parent d7da6ddc
......@@ -3,11 +3,15 @@ include(CMakeParseArguments)
set(MINIMUM_QT5_VERSION 5.3.0)
execute_process(
COMMAND ${PYTHON_EXECUTABLE} "${CMAKE_SOURCE_DIR}/scripts/query_version_info.py" "--mode=cmake_disabled_modules"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE DISABLED_SUBDIRS
)
if(DEFINED KUMIR2_DISABLED_SUBDIRS)
message(STATUS "Explicitly disabled subdirs: ${KUMIR2_DISABLED_SUBDIRS}")
else()
execute_process(
COMMAND ${PYTHON_EXECUTABLE} "${CMAKE_SOURCE_DIR}/scripts/query_version_info.py" "--mode=cmake_disabled_modules"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE DISABLED_SUBDIRS
)
endif()
if(NOT DEFINED KUMIR2_INSTALL_PREFIX)
set(KUMIR2_INSTALL_PREFIX "/usr")
......@@ -17,7 +21,12 @@ function(add_opt_subdirectory SUBDIR_NAME)
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${SUBDIR_NAME})
string(FIND "${DISABLED_SUBDIRS}" "[${SUBDIR_NAME}]" SubdirDisableIndex)
if(${SubdirDisableIndex} EQUAL -1)
add_subdirectory(${SUBDIR_NAME})
list(FIND KUMIR2_DISABLED_SUBDIRS "${SUBDIR_NAME}" ExplicitSubdirDisableIndex)
if(ExplicitSubdirDisableIndex EQUAL -1)
add_subdirectory(${SUBDIR_NAME})
else()
message(STATUS "Component ${SUBDIR_NAME} disabled for this build")
endif()
else()
message(STATUS "Component ${SUBDIR_NAME} disabled for this version")
endif()
......
......@@ -34,7 +34,7 @@ $unstableNotice
$removeBundledBoostIfNeed
$cmakeCommand \
-DUSE_QT=5 \
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
-DKUMIR2_DISABLED_SUBDIRS="$disabledSubdirs" \
-DKUMIR2_SDK_CMAKE_DIR=$cmakeFilesLocation \
-DKUMIR2_SDK_SCRIPTS_DIR=$develScriptsLocation \
-DPROVIDED_VERSION_INFO:BOOL=ON \
......@@ -178,6 +178,8 @@ def generate_rpm_spec_contents(dist: str, release: int, packager: str):
version_info = query_version_info.get_version_information(os.getcwd())
timestamp = query_version_info.get_timestamp(os.getcwd())
subst["gitTimestamp"] = str(timestamp)
disabled_subdirs = query_version_info.disabled_modules()
subst["disabledSubdirs"] = ";".join(disabled_subdirs)
if version_info["taggedRelease"]:
subst["name"] = "kumir2"
subst["version"] = version_info["version"]
......
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