pfe/CMakeLists.txt

57 lines
1.4 KiB
CMake

cmake_minimum_required(VERSION 3.15)
project(pfe)
set(VTK_COMPONENTS
VTK::CommonCore
VTK::IOCore
VTK::FiltersCore
VTK::CommonColor
VTK::CommonDataModel
VTK::IOLegacy
VTK::IOXML)
set(ENABLE_VIEWER OFF CACHE BOOL "Enable the 3D viewer, depends on Qt.")
if(ENABLE_VIEWER)
list(APPEND VTK_COMPONENTS
VTK::RenderingCore
VTK::ViewsCore
VTK::GUISupportQt
VTK::RenderingQt
VTK::ViewsQt
VTK::RenderingVolume
VTK::RenderingVolumeOpenGL2)
endif()
set(USE_SYSTEM_VTK NO CACHE BOOL
"Use the version of vtk installed in the system instead of downloading and compiling it ourselves.")
if(USE_SYSTEM_VTK)
list(TRANSFORM VTK_COMPONENTS REPLACE "VTK::" ""
OUTPUT_VARIABLE VTK_PACKAGE_COMPONENTS)
message("VTK_COMPONENTS: ${VTK_COMPONENTS}")
message("VTK_PACKAGE_COMPONENTS: ${VTK_PACKAGE_COMPONENTS}")
find_package(VTK COMPONENTS ${VTK_PACKAGE_COMPONENTS})
else()
add_subdirectory(external/vtk)
endif()
add_executable(pfe)
target_compile_features(pfe PRIVATE cxx_std_17)
target_sources(pfe PRIVATE
src/main.cc
src/angles_filter.cc
src/angles_filter.h
src/aspect_ratio_filter.cc
src/aspect_ratio_filter.h
src/dihedral_angles_filter.cc
src/dihedral_angles_filter.h
src/external_points_filter.cc
src/external_points_filter.h)
target_link_libraries(pfe PRIVATE ${VTK_COMPONENTS})
if(ENABLE_VIEWER)
target_compile_definitions(pfe PRIVATE ENABLE_VIEWER)
endif()