cmake-modules: 下一代模块化构建

This commit is contained in:
zinface 2023-02-14 13:40:49 +08:00
parent cb597ca5ec
commit 9fe169963e
3 changed files with 64 additions and 60 deletions

View File

@ -17,71 +17,13 @@ endif()
# ----------------- QSci ----------------- #
if(TRUE)
# add_subdirectory(${PROJECT_SOURCE_DIR}/src/qscint)
# file(GLOB MOC_HEADER src/qscint/src/Qsci/*.h)
spark_file_glob(MOC_HEADER "src/qscint/src/Qsci/*.h")
spark_add_source_paths(QSciSources
src/qscint/src
src/qscint/scintilla/lexers
src/qscint/scintilla/lexlib
src/qscint/scintilla/src
src/qscint/scintilla/boostregex
# src/qscint/src/Qsci
# FAIL: only *.ui will spark_file_glob(MOC_HEADER ...)
)
spark_add_library(QSci STATIC ${QSciSources} ${MOC_HEADER})
target_compile_definitions(QSci PRIVATE SCINTILLA_QT SCI_LEXER INCLUDE_DEPRECATED_FEATURES)
target_include_directories(QSci PRIVATE
src/qscint/scintilla/boostregex
src/qscint/scintilla/lexlib)
target_include_directories(QSci PUBLIC
src/qscint/src
src/qscint/src/Qsci
src/qscint/scintilla/src
src/qscint/scintilla/include)
target_link_qt5(QSci)
target_link_qt5_PrintSupport(QSci)
target_link_qt5_Concurrent(QSci)
include(cmake/modules/QScint.cmake)
endif(TRUE)
# ----------------- Notepad-- ----------------- #
if(TRUE)
# CCEditor
set(QRC_SOURCES src/RealCompare.qrc)
spark_aux_source_paths(CCEditorSources
src
src/cceditor
)
spark_add_executable(${PROJECT_NAME} ${CCEditorSources} ${QRC_SOURCES})
target_include_directories(${PROJECT_NAME} PRIVATE
${PROJECT_SOURCE_DIR}/src
${PROJECT_SOURCE_DIR}/src/cceditor
${PROJECT_SOURCE_DIR}/src/qscint/src
${PROJECT_SOURCE_DIR}/src/qscint/src/Qsci
${PROJECT_SOURCE_DIR}/src/qscint/scintilla/src
${PROJECT_SOURCE_DIR}/src/qscint/scintilla/include
${PROJECT_SOURCE_DIR}/src/qscint/scintilla/lexlib
${PROJECT_SOURCE_DIR}/src/qscint/scintilla/boostregex
)
# target_link_libraries(${PROJECT_NAME} QSci)
target_link_QSci(${PROJECT_NAME})
target_link_qt5_XmlPatterns(${PROJECT_NAME})
endif(TRUE)
# ----------------- Notepad-- ----------------- #
if(TRUE)
#
target_compile_definitions(${PROJECT_NAME} PUBLIC NO_PLUGIN=0)
# ...
include(cmake/modules/Notepad--.cmake)
endif(TRUE)
# ----------------- Notepad-- 线 ----------------- #

View File

@ -0,0 +1,33 @@
if(TRUE)
# Notepad--
set(QRC_SOURCES src/RealCompare.qrc)
spark_aux_source_paths(CCEditorSources
src
src/cceditor
)
spark_add_executable(${PROJECT_NAME} ${CCEditorSources} ${QRC_SOURCES})
target_include_directories(${PROJECT_NAME} PRIVATE
${PROJECT_SOURCE_DIR}/src
${PROJECT_SOURCE_DIR}/src/cceditor
${PROJECT_SOURCE_DIR}/src/qscint/src
${PROJECT_SOURCE_DIR}/src/qscint/src/Qsci
${PROJECT_SOURCE_DIR}/src/qscint/scintilla/src
${PROJECT_SOURCE_DIR}/src/qscint/scintilla/include
${PROJECT_SOURCE_DIR}/src/qscint/scintilla/lexlib
${PROJECT_SOURCE_DIR}/src/qscint/scintilla/boostregex
)
# target_link_libraries(${PROJECT_NAME} QSci)
target_link_QSci(${PROJECT_NAME})
target_link_qt5_XmlPatterns(${PROJECT_NAME})
endif(TRUE)
# ----------------- Notepad-- ----------------- #
if(TRUE)
#
target_compile_definitions(${PROJECT_NAME} PUBLIC NO_PLUGIN=0)
# ...
endif(TRUE)

View File

@ -0,0 +1,29 @@
if(TRUE)
# add_subdirectory(${PROJECT_SOURCE_DIR}/src/qscint)
# file(GLOB MOC_HEADER src/qscint/src/Qsci/*.h)
spark_file_glob(MOC_HEADER "src/qscint/src/Qsci/*.h")
spark_add_source_paths(QSciSources
src/qscint/src
src/qscint/scintilla/lexers
src/qscint/scintilla/lexlib
src/qscint/scintilla/src
src/qscint/scintilla/boostregex
# src/qscint/src/Qsci
# FAIL: only *.ui will spark_file_glob(MOC_HEADER ...)
)
spark_add_library(QSci STATIC ${QSciSources} ${MOC_HEADER})
target_compile_definitions(QSci PRIVATE SCINTILLA_QT SCI_LEXER INCLUDE_DEPRECATED_FEATURES)
target_include_directories(QSci PRIVATE
src/qscint/scintilla/boostregex
src/qscint/scintilla/lexlib)
target_include_directories(QSci PUBLIC
src/qscint/src
src/qscint/src/Qsci
src/qscint/scintilla/src
src/qscint/scintilla/include)
target_link_qt5(QSci)
target_link_qt5_PrintSupport(QSci)
target_link_qt5_Concurrent(QSci)
endif(TRUE)