代码拉取完成,页面将自动刷新
同步操作将从 ZZH-Finalize/信号实验箱 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
cmake_minimum_required(VERSION 3.21.1)
project(signalBox VERSION 2.2.6 DESCRIPTION 信号工具箱 LANGUAGES C CXX)
find_package(Qt5 COMPONENTS Core Widgets Charts LinguistTools REQUIRED)
find_package(FLEX)
find_package(BISON)
# 设置可执行文件的名称
set(execName ${PROJECT_NAME})
# 设置使用的C++标准
set(CMAKE_CXX_STANDARD 11)
# 设置基本数据类型
set(BASIC_TYPE float)
# 要求cmake导出compile_commands.json
set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE)
# 将构建系统设置的基本数据类型向代码传递
add_definitions(-DBASIC_TYPE=${BASIC_TYPE})
add_compile_options(-Wall)
add_compile_options(-fdata-sections -ffunction-sections)
add_link_options(-Wl,--gc-sections)
# Release编译情况下, 添加WIN32标记以禁止控制台窗口
if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
message("build in debug")
add_definitions(-DDEBUG=1)
else()
message("build in resease")
set(special_flag WIN32)
endif()
flex_target(SCANNER
compiler/scanner.l
${CMAKE_CURRENT_BINARY_DIR}/scanner.cpp
DEFINES_FILE ${CMAKE_CURRENT_BINARY_DIR}/scanner.h
COMPILE_FLAGS "--noline"
)
bison_target(GRAMMAR
compiler/grammar.ypp
${CMAKE_CURRENT_BINARY_DIR}/grammar.cpp
DEFINES_FILE ${CMAKE_CURRENT_BINARY_DIR}/grammar.h
COMPILE_FLAGS "--debug --no-lines --token-table -d -Wcex"
)
add_flex_bison_dependency(SCANNER GRAMMAR)
include_directories(
.
ui
calculator
compiler
util
lib
external_libs/z-fft
)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
include_directories(${Qt5Core_INCLUDE_DIRS})
set(TS_FILES ui/zh_CN.ts)
set(QRC_FILES ui/res.qrc)
set(PROJECT_SOURCES
main.cpp
${FLEX_SCANNER_OUTPUTS}
${BISON_GRAMMAR_OUTPUTS}
ui/mainWindow.ui
ui/logo.rc
ui/mainWindow.cpp
ui/ChartView.cpp
ui/SignalItem.cpp
ui/SignalListWidget.cpp
ui/SignalEditor.cpp
ui/SignalEditorWidget.cpp
ui/UIConfig.cpp
ui/CodeTip.cpp
ui/LoggerWindow.cpp
ui/SignalSuffixManager.cpp
compiler/symTable.cpp
compiler/compiler.cpp
compiler/ast.cpp
compiler/libManager.cpp
compiler/InnerLib.cpp
calculator/calculator.cpp
calculator/calculatorConf.cpp
calculator/bufferAllocator.cpp
)
# 扫描工程生成和更新ts文件
# qt5_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} ${TS_FILES})
# 发布ts文件, 也就是ts编译为qm
qt5_add_translation(QM_FILES ${TS_FILES})
# 添加资源文件
qt5_add_resources(PROJECT_SOURCES ${QRC_FILES})
if(ANDROID)
add_library(${execName} SHARED
${PROJECT_SOURCES}
)
add_definitions(-DANDROID=1)
add_definitions(-DANDROID_ABI="${ANDROID_ABI}")
add_custom_command(TARGET ${execName}
POST_BUILD
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
COMMAND echo Deploy project to Android
COMMAND androiddeployqt --input android_deployment_settings.json --output android-build/
)
add_custom_command(TARGET ${execName}
POST_BUILD
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
COMMAND cp android-build/build/outputs/apk/debug/android-build-debug.apk ${execName}.apk
)
else()
add_executable(${execName} ${special_flag}
${PROJECT_SOURCES}
)
endif()
set_target_properties(${execName} PROPERTIES AUTOMOC TRUE AUTOUIC TRUE AUTORCC TRUE)
target_link_libraries(${execName} ${Qt5Widgets_LIBRARIES} ${Qt5Charts_LIBRARIES})
file(GLOB libSrcFiles lib/*.cpp)
set(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/lib)
add_library(libCommon SHARED lib/common/libCommon.cpp)
# 项目自带的动态库, 即内置函数库
foreach(srcFile ${libSrcFiles})
cmake_path(RELATIVE_PATH srcFile)
cmake_path(GET srcFile FILENAME fn)
string(REPLACE "." ";" fn ${fn})
list(GET fn 0 fn)
add_library(${fn} SHARED
${srcFile}
)
target_link_directories(${fn} PUBLIC lib)
target_link_libraries(${fn} libCommon ${Qt5Core_LIBRARIES} fft)
endforeach()
# 拷贝预置的FIR滤波器参数到目标目录
if(NOT EXISTS coefficient_demo)
message("Copy FIR coefficient")
file(COPY coefficient_demo DESTINATION .)
endif()
if(NOT EXISTS workspace_demo)
message("Copy workspace demo")
file(COPY workspace_demo DESTINATION .)
endif()
add_subdirectory(external_libs)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。