Commit b05b9c74 authored by Victor Yacovlev's avatar Victor Yacovlev

Do not build disabled modules from list

parent 42eff220
......@@ -7,6 +7,7 @@ scripts/*.pyc
scripts/*.pyo
*~
*.bak
*.swp
.classpath
.metadata
.project
......
find_package(PythonInterp 2.7.0 REQUIRED)
execute_process(
COMMAND ${PYTHON_EXECUTABLE} "${CMAKE_SOURCE_DIR}/scripts/read_disabled_modules.py"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE DISABLED_SUBDIRS
)
macro(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})
else()
message(STATUS "Component ${SUBDIR_NAME} disabled for this version")
endif()
endif()
endmacro(add_opt_subdirectory)
import re
import subprocess
import os
import os.path
import string
import sys
def get_version_information(top_level_dir):
assert isinstance(top_level_dir, str) or isinstance(top_level_dir, unicode)
if os.path.exists(top_level_dir + os.path.sep + ".git"):
try:
version_info = subprocess.check_output(
"git describe --abbrev=0 --tags --exact-match",
shell=True,
stderr=subprocess.PIPE
).strip()
except subprocess.CalledProcessError:
version_info = subprocess.check_output(
"git rev-parse --abbrev-ref HEAD",
shell=True
).strip()
else:
dir_name = os.path.basename(top_level_dir)
match = re.match(r"kumir2-(.+)", dir_name)
version_info = match.group(1)
return version_info
def find_suitable_list_file_name(version_name):
base = os.getcwd() + os.path.sep + "subdirs-disabled-{}.txt"
name = base.format(version_name)
if os.path.exists(name):
return name
match = re.match(r"(.+)-(alpha|beta|rc)[0-9]+", version_name)
if match:
version_base = match.group(1)
name = base.format(version_base)
if os.path.exists(name):
return name
def main():
version_name = get_version_information(os.getcwd())
disabled_list_file_name = find_suitable_list_file_name(version_name)
disabled_list = []
if disabled_list_file_name:
with open(disabled_list_file_name) as source:
lines = source.read().split('\n')
for line in lines:
line = line.strip()
if line and not line.startswith("#"):
disabled_list += ["[" + line + "]"]
if disabled_list:
sys.stdout.write(string.join(disabled_list))
if __name__ == "__main__":
main()
\ No newline at end of file
include(${CMAKE_SOURCE_DIR}/kumir2_common.cmake)
# -- linux
if(NOT APPLE AND NOT MSVC)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--enable-new-dtags -Wl,-rpath,'\$ORIGIN/../${LIB_BASENAME}/kumir2'")
......@@ -33,7 +35,7 @@ else()
OUTPUT_VARIABLE GIT_HASH
)
execute_process(
COMMAND ${GIT} describe --abbrev=0 --tags
COMMAND ${GIT} describe --abbrev=0 --tags --exact-match
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_TAG
RESULT_VARIABLE GIT_TAG_ERROR
......@@ -77,53 +79,33 @@ endif (MSVC_IDE)
if(NOT APPLE)
# Various GUI configurations
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/kumir2-classic")
add_subdirectory(kumir2-classic)
endif()
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/kumir2-highgrade")
add_subdirectory(kumir2-highgrade)
endif()
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/kumir2-ide")
add_subdirectory(kumir2-ide)
endif()
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/kumir2-teacher")
add_subdirectory(kumir2-teacher)
endif()
add_opt_subdirectory(kumir2-classic)
add_opt_subdirectory(kumir2-highgrade)
add_opt_subdirectory(kumir2-ide)
add_opt_subdirectory(kumir2-teacher)
# Check if Python present in this git branch and Python3 libraries found
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/kumir2-python")
if(PYTHONLIBS_FOUND)
add_subdirectory(kumir2-python)
add_subdirectory(kumir2-python-teacher)
else()
message(WARNING "No Python 3.x libs found, building of Python language support disabled")
endif()
endif() # kumir2-python exists
if(PYTHONLIBS_FOUND)
add_opt_subdirectory(kumir2-python)
add_opt_subdirectory(kumir2-python-teacher)
else()
message(STATUS "No Python 3.x libs found, building of Python language support disabled")
endif()
# Check if Pascal present in this git branch
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/kumir2-pascal")
add_subdirectory(kumir2-pascal)
endif() # kumir2-pascal exists
add_opt_subdirectory(kumir2-pascal)
endif(NOT APPLE)
if(APPLE)
# Apple platform has exact one GUI configuration
add_subdirectory(kumir2-macx)
add_opt_subdirectory(kumir2-macx)
endif(APPLE)
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/kumir2-bc")
add_subdirectory(kumir2-bc)
endif()
add_opt_subdirectory(kumir2-bc)
add_opt_subdirectory(kumir2-xrun)
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/kumir2-xrun")
add_subdirectory(kumir2-xrun)
endif()
# kumir2-llvmc is optional in case if LLVM libraries present
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/kumir2-llvmc")
if(Llvm_FOUND)
add_subdirectory(kumir2-llvmc)
else()
message(WARNING "LLVM developer libraries not found, building of LLVM support disabled")
endif(Llvm_FOUND)
endif()
if(Llvm_FOUND)
add_opt_subdirectory(kumir2-llvmc)
else()
message(STATUS "LLVM developer libraries not found, building of LLVM support disabled")
endif(Llvm_FOUND)
include(${CMAKE_SOURCE_DIR}/kumir2_common.cmake)
find_package(Llvm)
find_package(PythonLibs 3.2)
......@@ -9,48 +11,22 @@ add_subdirectory(coregui)
add_subdirectory(coursemanager)
# Plugins related to kumir language only
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/kumiranalizer")
add_subdirectory(kumiranalizer)
endif()
add_opt_subdirectory(kumiranalizer)
add_opt_subdirectory(kumircodegenerator)
add_opt_subdirectory(kumircoderun)
add_opt_subdirectory(kumircompilertool)
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/kumircodegenerator")
add_subdirectory(kumircodegenerator)
endif()
if(Llvm_FOUND)
add_opt_subdirectory(llvmcodegenerator)
else()
message(STATUS "LLVM developer libraries not found, building of LLVM support disabled")
endif(Llvm_FOUND)
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/kumircoderun")
add_subdirectory(kumircoderun)
if(PYTHONLIBS_FOUND)
add_opt_subdirectory(python3language)
else()
message(STATUS "No Python 3.x libs found, building of Python language support disabled")
endif()
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/kumircompilertool")
add_subdirectory(kumircompilertool)
endif()
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/llvmcodegenerator")
if(Llvm_FOUND)
add_subdirectory(llvmcodegenerator)
else()
message(WARNING "LLVM developer libraries not found, building of LLVM support disabled")
endif(Llvm_FOUND)
endif()
# Experimental plugins from various git branches
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/python3language")
if(PYTHONLIBS_FOUND)
add_subdirectory(python3language)
else()
message(WARNING "No Python 3.x libs found, building of Python language support disabled")
endif()
endif() # python3language exists
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/fpcanalizer")
add_subdirectory(fpcanalizer)
endif() # fpcanalizer exists
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/lldbrun")
add_subdirectory(lldbrun)
endif() # gdbrun exists
add_opt_subdirectory(fpcanalizer)
add_opt_subdirectory(lldbrun)
......@@ -34,7 +34,7 @@ if(QCA_LIBRARY AND QCA_INCLUDE_DIR)
include_directories(${QCA_INCLUDE_DIR})
set(EXTRA_LIBS ${QCA_LIBRARY})
else()
message(WARNING "QCA library not found! Signing and verifying programs will disabled!")
message(STATUS "QCA library not found! Signing and verifying programs will disabled!")
endif()
include_directories(${CMAKE_CURRENT_BINARY_DIR})
......
include(${CMAKE_SOURCE_DIR}/kumir2_common.cmake)
# -- linux
if(NOT APPLE AND NOT MSVC)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--enable-new-dtags -Wl,-rpath,'\$ORIGIN/../${LIB_BASENAME}/kumir2'")
......@@ -7,31 +9,17 @@ if(APPLE)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath,'../Plugins'")
endif(APPLE)
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/as")
if(CMAKE_BUILD_TYPE MATCHES Debug)
add_subdirectory(as)
endif()
endif()
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/pictomir2course")
add_subdirectory(pictomir2course)
if(CMAKE_BUILD_TYPE MATCHES Debug)
add_opt_subdirectory(as)
endif()
add_opt_subdirectory(pictomir2course)
add_opt_subdirectory(docbook2latex)
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/docbook2latex")
add_subdirectory(docbook2latex)
if(NOT APPLE)
add_opt_subdirectory(open)
endif()
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/open")
if(NOT APPLE)
add_subdirectory(open)
endif()
endif()
add_opt_subdirectory(courseeditor)
add_opt_subdirectory(run)
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/courseeditor")
add_subdirectory(courseeditor)
endif()
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/run")
add_subdirectory(run)
endif()
# Actors not ready for production use
complexnumbers
draw
grasshopper
isometricrobot
turtle
vodoley
# Tools used by developers only
as
# Python related stuff
kumir2-python
kumir2-python-teacher
python3language
# Disable components for Python, which are
# in separate branch
kumir2-python
kumir2-python-teacher
python3language
# Components disabled for Python
# 1. Kumir language modules
kumiranalizer
kumircodegenerator
kumircoderun
kumircompilertool
llvmcodegenerator
# 2. Kumir-related apps
kumir2-bc
kumir2-classic
kumir2-highgrade
kumir2-ide
kumir2-llvmc
kumir2-macx
kumir2-teacher
kumir2-xrun
as
open
run
# 3. Actors not ready to support Python
complexnumbers
draw
grasshopper
isometricrobot
pictomir2course
keyboard
turtle
vodoley
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