You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
1.3 KiB
51 lines
1.3 KiB
cmake_minimum_required(VERSION 3.10)
|
|
project(DGG_and_SVG LANGUAGES CXX)
|
|
|
|
set(CMAKE_CXX_STANDARD 20)
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
|
|
include(Config.cmake)
|
|
|
|
set(VTK_DIR ${VTK_PATH}/lib/cmake/vtk-9.4)
|
|
find_package(VTK REQUIRED)
|
|
if (VTK_FOUND)
|
|
message(STATUS "VTK found: ${VTK_USE_FILE}")
|
|
else()
|
|
message(FATAL_ERROR "VTK not found!")
|
|
endif()
|
|
|
|
set(SRC_DIR ${CMAKE_SOURCE_DIR}/src)
|
|
|
|
include_directories(${SRC_DIR})
|
|
|
|
file(GLOB SRC_FILES ${SRC_DIR}/**/*.cpp)
|
|
|
|
set(FILTERED_SRC_FILES ${SRC_FILES})
|
|
list(FILTER FILTERED_SRC_FILES EXCLUDE REGEX "src/DGG_precompute/main.cpp$")
|
|
list(FILTER FILTERED_SRC_FILES EXCLUDE REGEX "src/DGG_Solution/dgg_solution.cpp$")
|
|
|
|
MESSAGE(STATUS "Source files: ${SRC_FILES}")
|
|
MESSAGE(STATUS "Filtered source files: ${FILTERED_SRC_FILES}")
|
|
|
|
# 可执行文件 1:DGG_Precompute
|
|
add_executable(DGG_Precompute
|
|
${SRC_DIR}/DGG_precompute/main.cpp
|
|
${FILTERED_SRC_FILES}
|
|
)
|
|
|
|
# 可执行文件 2:DGG_Solution
|
|
add_executable(DGG_Solution
|
|
${SRC_DIR}/DGG_Solution/dgg_solution.cpp
|
|
${FILTERED_SRC_FILES}
|
|
)
|
|
|
|
file(GLOB_RECURSE RENDER_SRC_FILES ${CMAKE_SOURCE_DIR}/Renderer/*.cpp)
|
|
|
|
add_executable(EndToEnd
|
|
${CMAKE_SOURCE_DIR}/end_to_end.cpp
|
|
${FILTERED_SRC_FILES}
|
|
${RENDER_SRC_FILES}
|
|
)
|
|
|
|
target_link_libraries(EndToEnd PRIVATE ${VTK_LIBRARIES})
|
|
target_include_directories(EndToEnd PRIVATE ${VTK_USE_FILE})
|