From 96dd4202d56f8c16b216444a4be4e2e91e46ed6f Mon Sep 17 00:00:00 2001 From: Ivan Pelipenko Date: Mon, 4 May 2020 12:51:32 +0300 Subject: [PATCH] CROSSTOOLS support --- CMakeLists.txt | 98 ++++++++++++++++++++++++++++++-------------------- pip | 2 +- 2 files changed, 60 insertions(+), 40 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 009104e..65b278c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -51,11 +51,19 @@ if(CMAKE_CROSSCOMPILING) set(INSTALL_PREFIX "${CMAKE_STAGING_PREFIX}") endif() endif() +option(CROSSTOOLS "Crosstools minimal build" 0) option(LIB "System install" 1) option(QGLVIEW "Build QGLview library and utils" 0) option(QGLENGINE "Build QGLENGINE library and utils" 0) option(UTILS "Build various utils" ${_plugins_default_}) option(DESIGNER_PLUGINS "Build qt designer plugins" ${_plugins_default_}) +if (CROSSTOOLS) + set(LIB 1) + set(QGLVIEW 0) + set(QGLENGINE 0) + set(UTILS 0) + set(DESIGNER_PLUGINS 0) +endif() if (CMAKE_BUILD_TYPE MATCHES Debug) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g3 -Wall") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g3 -Wall") @@ -97,9 +105,11 @@ endforeach(F) if(CMAKE_CROSSCOMPILING OR (DEFINED ANDROID_PLATFORM)) set(PIP_CMG "pip_cmg") set(PIP_RC "pip_rc") + set(PIP_DEPLOY_TOOL "deploy_tool") else() set(PIP_CMG "${CMAKE_CURRENT_BINARY_DIR}/pip/utils/code_model_generator/pip_cmg") set(PIP_RC "${CMAKE_CURRENT_BINARY_DIR}/pip/utils/resources_compiler/pip_rc") + set(PIP_DEPLOY_TOOL "${CMAKE_CURRENT_BINARY_DIR}/pip/utils/deploy_tool/deploy_tool") endif() if(WIN32) set(PIP_DLL_DIR "${CMAKE_CURRENT_BINARY_DIR}/pip") @@ -107,53 +117,63 @@ endif() set(QAD_DIR ${CMAKE_CURRENT_SOURCE_DIR}/qad) -include(QtWraps) -find_qt(Core QUIET) -set(QtVersions) -set(SomeQtFound 0) -foreach(_v ${_QT_VERSIONS_}) - option(Qt${_v} "Build for Qt${_v}" 1) - if (Qt${_v}) - #message("Qt${_v} -> ${LOCAL_FOUND${_v}}") - if (LOCAL_FOUND${_v}) - list(APPEND QtVersions Qt${_v}) - set(SomeQtFound 1) - endif() - endif() -endforeach() +if (CROSSTOOLS) + + add_subdirectory(pip) + file(GLOB CMAKES "qad/cmake/*.cmake" "qad/cmake/*.in") + install(FILES ${CMAKES} DESTINATION ${CMAKE_ROOT}/Modules) -if(UTILS) - message(STATUS "Building with utils") else() - message(STATUS "Building only libraries") -endif() -add_subdirectory(pip) -set(_DIRS) -if (SomeQtFound) - message(STATUS "Building Qt-derived targets for ${QtVersions}") - add_subdirectory(qad) - set(_DIRS piqt piqt_utils qcd_utils) - if (Qt5) - if (QGLVIEW) - list(APPEND _DIRS qglview) - endif() - if (QGLENGINE) - list(APPEND _DIRS qglengine) + include(QtWraps) + find_qt(Core QUIET) + set(QtVersions) + set(SomeQtFound 0) + foreach(_v ${_QT_VERSIONS_}) + option(Qt${_v} "Build for Qt${_v}" 1) + if (Qt${_v}) + #message("Qt${_v} -> ${LOCAL_FOUND${_v}}") + if (LOCAL_FOUND${_v}) + list(APPEND QtVersions Qt${_v}) + set(SomeQtFound 1) + endif() endif() + endforeach() + + if(UTILS) + message(STATUS "Building with utils") + else() + message(STATUS "Building only libraries") endif() + + add_subdirectory(pip) + set(_DIRS) + if (SomeQtFound) + message(STATUS "Building Qt-derived targets for ${QtVersions}") + add_subdirectory(qad) + set(_DIRS piqt piqt_utils qcd_utils) + if (Qt5) + if (QGLVIEW) + list(APPEND _DIRS qglview) + endif() + if (QGLENGINE) + list(APPEND _DIRS qglengine) + endif() + endif() + foreach(_D ${_DIRS}) + list(APPEND QT_MULTILIB_LIST ${_D}) + endforeach(_D) + include_directories(piqt) + else() + message(STATUS "None of Qt found, skip Qt-derived targets") + endif() + include_directories(cd_utils) + list(INSERT _DIRS 0 cd_utils) foreach(_D ${_DIRS}) - list(APPEND QT_MULTILIB_LIST ${_D}) + add_subdirectory(${_D}) endforeach(_D) - include_directories(piqt) -else() - message(STATUS "None of Qt found, skip Qt-derived targets") + endif() -include_directories(cd_utils) -list(INSERT _DIRS 0 cd_utils) -foreach(_D ${_DIRS}) - add_subdirectory(${_D}) -endforeach(_D) if(WIN32) foreach(PIP_LT ${PIP_LIBS_TARGETS}) diff --git a/pip b/pip index 0302048..3386c77 160000 --- a/pip +++ b/pip @@ -1 +1 @@ -Subproject commit 0302048afa0ce3354d56698cbdeda728de9bc64f +Subproject commit 3386c7702cf1f459fc515923dd131a5b02004a90