102 lines
3.8 KiB
CMake
102 lines
3.8 KiB
CMake
set(module_dir "${CMAKE_CURRENT_LIST_DIR}/module")
|
|
set(dir "${module_dir}/radio")
|
|
file(GLOB_RECURSE srcs "${dir}/*.c" "${dir}/*.cpp" "${dir}/*.h" "${dir}/*.hpp" "${dir}/*.qrc")
|
|
add_executable(radio ${srcs})
|
|
target_link_libraries(radio PUBLIC Renderive Renderive_Diagnostics Renderive_Widget)
|
|
# 为了一起维护代码
|
|
#target_link_libraries(radio PUBLIC Demo_Gallery_Lib)
|
|
if (MSVC)
|
|
target_compile_definitions(radio PRIVATE MockBackEnd)
|
|
target_compile_options(radio PRIVATE
|
|
/utf-8
|
|
)
|
|
endif ()
|
|
set_property(TARGET radio PROPERTY AUTOMOC ON)
|
|
set_property(TARGET radio PROPERTY AUTOUIC ON)
|
|
set_property(TARGET radio PROPERTY AUTORCC ON)
|
|
set(radio_document_dirs
|
|
"${CMAKE_SOURCE_DIR}/module/radio"
|
|
"${CMAKE_SOURCE_DIR}/third_party/CPP_Core/Core"
|
|
"${CMAKE_SOURCE_DIR}/third_party/Graphic_Core/Renderive"
|
|
)
|
|
set(radio_document_exclude_dirs
|
|
"${CMAKE_SOURCE_DIR}/third_party/Graphic_Core/Renderive/base/Virtual_Keyboard/googlepinyin"
|
|
)
|
|
psc_add_doxygen_target(psc_radio_doxygen
|
|
PROJECT_NAME "Radio"
|
|
INPUT_DIRS ${radio_document_dirs}
|
|
EXCLUDE_DIRS ${radio_document_exclude_dirs}
|
|
OUTPUT_DIR "${CMAKE_BINARY_DIR}/docs/doxygen/radio"
|
|
PREDEFINED LIB_DECL= Q_OBJECT= signals=public slots=public
|
|
)
|
|
psc_add_graphviz_directory_target(psc_radio_graphviz
|
|
INPUT_DIRS ${radio_document_dirs}
|
|
EXCLUDE_DIRS ${radio_document_exclude_dirs}
|
|
OUTPUT_DIR "${CMAKE_BINARY_DIR}/docs/graphviz/radio"
|
|
FORMAT svg
|
|
MAX_DEPTH 4
|
|
COLLAPSE_THRESHOLD 20
|
|
)
|
|
psc_add_cmake_graphviz_target(psc_radio_cmake_graphviz
|
|
TARGETS radio Renderive Renderive_Diagnostics Demo_Gallery Core_Static asio_object
|
|
OUTPUT_DIR "${CMAKE_BINARY_DIR}/docs/graphviz/radio"
|
|
FORMAT svg
|
|
)
|
|
add_custom_target(psc_radio_docs
|
|
DEPENDS psc_radio_doxygen psc_radio_graphviz psc_radio_cmake_graphviz
|
|
)
|
|
set(radio_metrics_dir "${CMAKE_BINARY_DIR}/metrics/radio")
|
|
psc_add_llvm_cognitive_target(psc_radio_llvm_cognitive
|
|
INPUT_DIRS ${radio_document_dirs}
|
|
EXCLUDE_DIRS ${radio_document_exclude_dirs}
|
|
COMPILE_COMMANDS "${CMAKE_BINARY_DIR}/compile_commands.json"
|
|
OUTPUT_DIR "${radio_metrics_dir}/llvm"
|
|
TOP_N 50
|
|
THRESHOLD 0
|
|
)
|
|
psc_add_cppcheck_target(psc_radio_cppcheck
|
|
INPUT_DIRS ${radio_document_dirs}
|
|
EXCLUDE_DIRS ${radio_document_exclude_dirs}
|
|
COMPILE_COMMANDS "${CMAKE_BINARY_DIR}/compile_commands.json"
|
|
OUTPUT_DIR "${radio_metrics_dir}/cppcheck"
|
|
CHECK_LEVEL normal
|
|
)
|
|
psc_add_lizard_target(psc_radio_lizard
|
|
INPUT_DIRS ${radio_document_dirs}
|
|
EXCLUDE_DIRS ${radio_document_exclude_dirs}
|
|
OUTPUT_DIR "${radio_metrics_dir}/lizard"
|
|
TOP_N 50
|
|
CCN_WARNING 15
|
|
FUNCTION_LENGTH_WARNING 200
|
|
ARGUMENT_WARNING 8
|
|
)
|
|
psc_add_code_count_target(psc_radio_code_count
|
|
INPUT_DIRS ${radio_document_dirs}
|
|
EXCLUDE_DIRS ${radio_document_exclude_dirs}
|
|
OUTPUT_DIR "${radio_metrics_dir}/code_count"
|
|
)
|
|
psc_add_coupling_target(psc_radio_coupling
|
|
INPUT_DIRS ${radio_document_dirs}
|
|
EXCLUDE_DIRS ${radio_document_exclude_dirs}
|
|
OUTPUT_DIR "${radio_metrics_dir}/coupling"
|
|
TOP_N 50
|
|
)
|
|
psc_add_metrics_report_target(psc_radio_metrics
|
|
PROJECT_NAME "Radio"
|
|
OUTPUT_DIR "${radio_metrics_dir}"
|
|
LLVM_DIR "${radio_metrics_dir}/llvm"
|
|
CPPCHECK_DIR "${radio_metrics_dir}/cppcheck"
|
|
LIZARD_DIR "${radio_metrics_dir}/lizard"
|
|
CODE_COUNT_DIR "${radio_metrics_dir}/code_count"
|
|
COUPLING_DIR "${radio_metrics_dir}/coupling"
|
|
DEPENDS
|
|
psc_radio_llvm_cognitive
|
|
psc_radio_cppcheck
|
|
psc_radio_lizard
|
|
psc_radio_code_count
|
|
psc_radio_coupling
|
|
)
|
|
add_custom_target(psc_radio_quality
|
|
DEPENDS psc_radio_metrics psc_radio_docs
|
|
)
|