cmake 外部工具优化
This commit is contained in:
+14
-17
@@ -1,25 +1,23 @@
|
|||||||
set(module_dir "${CMAKE_CURRENT_LIST_DIR}/module")
|
set(module_dir "${CMAKE_CURRENT_LIST_DIR}/module")
|
||||||
|
set(third_party_dir "${CMAKE_CURRENT_LIST_DIR}/third_party")
|
||||||
set(dir "${module_dir}/radio")
|
set(dir "${module_dir}/radio")
|
||||||
append_glob_source(radio_src ${dir})
|
append_glob_source(radio_src ${dir})
|
||||||
add_executable(radio ${radio_src})
|
add_executable(radio ${radio_src})
|
||||||
target_link_libraries(radio PUBLIC Psc_Widget Renderive_Qt)
|
target_link_libraries(radio PUBLIC Psc_Widget Renderive_Qt)
|
||||||
if (MSVC)
|
if (MSVC)
|
||||||
target_compile_definitions(radio PRIVATE MockBackEnd)
|
target_compile_definitions(radio PRIVATE MockBackEnd)
|
||||||
target_compile_options(radio PRIVATE
|
target_compile_options(radio PRIVATE /utf-8)
|
||||||
/utf-8
|
|
||||||
)
|
|
||||||
endif ()
|
endif ()
|
||||||
set_property(TARGET radio PROPERTY AUTOMOC ON)
|
set_property(TARGET radio PROPERTY AUTOMOC ON)
|
||||||
set_property(TARGET radio PROPERTY AUTOUIC ON)
|
set_property(TARGET radio PROPERTY AUTOUIC ON)
|
||||||
set_property(TARGET radio PROPERTY AUTORCC ON)
|
set_property(TARGET radio PROPERTY AUTORCC ON)
|
||||||
# 代码质量相关工具
|
|
||||||
set(radio_document_dirs
|
set(radio_document_dirs
|
||||||
"${CMAKE_SOURCE_DIR}/module/radio"
|
"${module_dir}/radio"
|
||||||
"${CMAKE_SOURCE_DIR}/third_party/CPP_Core/Core"
|
"${third_party_dir}/CPP_Core/Core"
|
||||||
"${CMAKE_SOURCE_DIR}/third_party/Graphic_Core/Core"
|
"${third_party_dir}/Graphic_Core/Core"
|
||||||
)
|
)
|
||||||
set(radio_document_exclude_dirs
|
set(radio_document_exclude_dirs
|
||||||
"${CMAKE_SOURCE_DIR}/third_party/Graphic_Core/Core/base/Virtual_Keyboard/googlepinyin"
|
"${third_party_dir}/Graphic_Core/Core/base/Virtual_Keyboard/googlepinyin"
|
||||||
)
|
)
|
||||||
psc_add_doxygen_target(psc_radio_doxygen
|
psc_add_doxygen_target(psc_radio_doxygen
|
||||||
PROJECT_NAME "Radio"
|
PROJECT_NAME "Radio"
|
||||||
@@ -29,6 +27,8 @@ psc_add_doxygen_target(psc_radio_doxygen
|
|||||||
PREDEFINED LIB_DECL= Q_OBJECT= signals=public slots=public
|
PREDEFINED LIB_DECL= Q_OBJECT= signals=public slots=public
|
||||||
)
|
)
|
||||||
psc_add_graphviz_directory_target(psc_radio_graphviz
|
psc_add_graphviz_directory_target(psc_radio_graphviz
|
||||||
|
PROJECT_NAME "Radio"
|
||||||
|
OUTPUT_BASENAME "radio"
|
||||||
INPUT_DIRS ${radio_document_dirs}
|
INPUT_DIRS ${radio_document_dirs}
|
||||||
EXCLUDE_DIRS ${radio_document_exclude_dirs}
|
EXCLUDE_DIRS ${radio_document_exclude_dirs}
|
||||||
OUTPUT_DIR "${CMAKE_BINARY_DIR}/docs/graphviz/radio"
|
OUTPUT_DIR "${CMAKE_BINARY_DIR}/docs/graphviz/radio"
|
||||||
@@ -36,8 +36,10 @@ psc_add_graphviz_directory_target(psc_radio_graphviz
|
|||||||
MAX_DEPTH 4
|
MAX_DEPTH 4
|
||||||
COLLAPSE_THRESHOLD 20
|
COLLAPSE_THRESHOLD 20
|
||||||
)
|
)
|
||||||
psc_add_cmake_graphviz_target(psc_radio_cmake_graphviz
|
psc_add_cmake_target_graph_target(psc_radio_cmake_graphviz
|
||||||
TARGETS radio Core Renderive_Diagnostics Demo_Gallery Core_Static asio_object
|
PROJECT_NAME "Radio"
|
||||||
|
OUTPUT_BASENAME "radio_targets"
|
||||||
|
TARGETS radio
|
||||||
OUTPUT_DIR "${CMAKE_BINARY_DIR}/docs/graphviz/radio"
|
OUTPUT_DIR "${CMAKE_BINARY_DIR}/docs/graphviz/radio"
|
||||||
FORMAT svg
|
FORMAT svg
|
||||||
)
|
)
|
||||||
@@ -45,7 +47,7 @@ add_custom_target(psc_radio_docs
|
|||||||
DEPENDS psc_radio_doxygen psc_radio_graphviz psc_radio_cmake_graphviz
|
DEPENDS psc_radio_doxygen psc_radio_graphviz psc_radio_cmake_graphviz
|
||||||
)
|
)
|
||||||
set(radio_metrics_dir "${CMAKE_BINARY_DIR}/metrics/radio")
|
set(radio_metrics_dir "${CMAKE_BINARY_DIR}/metrics/radio")
|
||||||
psc_add_llvm_cognitive_target(psc_radio_llvm_cognitive
|
psc_add_cognitive_complexity_target(psc_radio_llvm_cognitive
|
||||||
INPUT_DIRS ${radio_document_dirs}
|
INPUT_DIRS ${radio_document_dirs}
|
||||||
EXCLUDE_DIRS ${radio_document_exclude_dirs}
|
EXCLUDE_DIRS ${radio_document_exclude_dirs}
|
||||||
COMPILE_COMMANDS "${CMAKE_BINARY_DIR}/compile_commands.json"
|
COMPILE_COMMANDS "${CMAKE_BINARY_DIR}/compile_commands.json"
|
||||||
@@ -83,12 +85,7 @@ psc_add_coupling_target(psc_radio_coupling
|
|||||||
psc_add_metrics_report_target(psc_radio_metrics
|
psc_add_metrics_report_target(psc_radio_metrics
|
||||||
PROJECT_NAME "Radio"
|
PROJECT_NAME "Radio"
|
||||||
OUTPUT_DIR "${radio_metrics_dir}"
|
OUTPUT_DIR "${radio_metrics_dir}"
|
||||||
LLVM_DIR "${radio_metrics_dir}/llvm"
|
INPUT_TARGETS
|
||||||
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_llvm_cognitive
|
||||||
psc_radio_cppcheck
|
psc_radio_cppcheck
|
||||||
psc_radio_lizard
|
psc_radio_lizard
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ static bool radio_show_performance_overlay() {
|
|||||||
return ok ? value != 0 : false;
|
return ok ? value != 0 : false;
|
||||||
}
|
}
|
||||||
static void configure_radio_plot_perf(renderive::Latency_Eager_Plot* plot) {
|
static void configure_radio_plot_perf(renderive::Latency_Eager_Plot* plot) {
|
||||||
plot->set_max_render_fps(radio_mock_perf_mode() ? 1000 : 60);
|
plot->set_max_render_fps(radio_mock_perf_mode() ? 1000 : 1000);
|
||||||
}
|
}
|
||||||
static renderive::Performance_Overlay_Options radio_performance_options() {
|
static renderive::Performance_Overlay_Options radio_performance_options() {
|
||||||
renderive::Performance_Overlay_Options options;
|
renderive::Performance_Overlay_Options options;
|
||||||
|
|||||||
Reference in New Issue
Block a user