geopro/tools/gpr_poc/CMakeLists.txt

39 lines
1.6 KiB
CMake
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# POC-B headless 度量 CLIgpr_poc
# 串起geopro_io_gpr解析装配→ geopro_core建体→ geopro_store分块落盘/金字塔)
# → geopro_renderWholeVolumeSource 整卷加载)。
# Windows 峰值内存用 PsapiProbe.hpp
# VTK_LIBRARIES 在子作用域内由各 find_package 设定,这里显式再请求一次
# (与 geopro_render 同组件集),确保本 target 的 vtk_module_autoinit 可用。
find_package(VTK REQUIRED COMPONENTS
CommonCore CommonDataModel
RenderingCore RenderingOpenGL2 RenderingVolume RenderingVolumeOpenGL2
ImagingCore InteractionStyle GUISupportQt)
add_executable(gpr_poc main.cpp)
target_include_directories(gpr_poc PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(gpr_poc PRIVATE
geopro_io_gpr
geopro_core
geopro_store
geopro_render)
if(WIN32)
target_link_libraries(gpr_poc PRIVATE Psapi)
# 运行时 DLL(VTK/Qt/GDAL 等)拷到 exe 旁,使 gpr_poc.exe 可直接运行(无需手设 PATH)。
# 与 geopro_tests 同款 TARGET_RUNTIME_DLLS POST_BUILD。
add_custom_command(TARGET gpr_poc POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
$<TARGET_RUNTIME_DLLS:gpr_poc> $<TARGET_FILE_DIR:gpr_poc>
COMMAND_EXPAND_LISTS)
endif()
target_compile_features(gpr_poc PRIVATE cxx_std_17)
set_target_properties(gpr_poc PROPERTIES AUTOMOC OFF AUTOUIC OFF AUTORCC OFF)
# geopro_render 透传 VTK_LIBRARIESPUBLIC消费方需 autoinit 各 VTK 模块工厂,
# 否则 vtkImageData/渲染对象工厂未注册。
vtk_module_autoinit(TARGETS gpr_poc MODULES ${VTK_LIBRARIES})