From 4a335e669daf0633e03d8c5c660990930ca7aa7f Mon Sep 17 00:00:00 2001 From: x-tools-author Date: Wed, 27 Mar 2024 15:44:50 +0800 Subject: [PATCH] chore: change the path of private module --- CMakeLists.txt | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1f46e218..9bbc1258 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -106,12 +106,10 @@ set(BUILD_SHARED_LIBS OFF) x_tools_add_third_party("glog-0.7.0") x_tools_add_third_party("qmdnsengine-master") -if(EXISTS ${CMAKE_SOURCE_DIR}/Source/Private/Private/Source/xTools/xToolsPrivate.cmake) - include(${CMAKE_SOURCE_DIR}/Source/Private/Private/Source/xTools/xToolsPrivate.cmake) - list(APPEND X_TOOLS_SOURCE - ${CMAKE_SOURCE_DIR}/Source/Private/Private/Source/xTools/xToolsPrivate.cmake) +if(EXISTS ${CMAKE_SOURCE_DIR}/Private/Source/xTools/xToolsPrivate.cmake) + include(${CMAKE_SOURCE_DIR}/Private/Source/xTools/xToolsPrivate.cmake) + list(APPEND X_TOOLS_SOURCE ${CMAKE_SOURCE_DIR}/Private/Source/xTools/xToolsPrivate.cmake) endif() -add_subdirectory(${CMAKE_SOURCE_DIR}/Source/Private) x_tools_add_executable(xTools ${X_TOOLS_SOURCE}) x_tools_generate_translations(xTools) x_tools_deploy_qt(xTools) @@ -142,3 +140,23 @@ option(X_TOOLS_ENABLE_APP_ASSISTANTS "Enable assistant applications" OFF) if(X_TOOLS_ENABLE_APP_ASSISTANTS) add_subdirectory(${CMAKE_SOURCE_DIR}/Source/Assistants) endif() + +# ------------------------------------------------------------------------------------------------- +# The private modules is not open-source. +if(NOT Qt6_VERSION VERSION_LESS "6.5.0") + if(EXISTS ${CMAKE_SOURCE_DIR}/Private) + add_subdirectory(${CMAKE_SOURCE_DIR}/Private) + endif() + + set(GITEE_URL "https://gitee.com/x-tools-author/x-tools-private.git") + add_custom_target( + xTools_clone_private_modules + COMMAND git clone ${GITEE_URL} ./Private || echo "clone private modules" + SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/README.md + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) + add_custom_target( + xTools_pull_private_modules + COMMAND git pull ${GITEE_URL} + SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/README.md + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/Private) +endif()