Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,11 @@ if ( T8CODE_ENABLE_MPI )
endif()

if( T8CODE_ENABLE_VTK )
target_compile_definitions( T8 PUBLIC T8_VTK_VERSION_USED="${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}" )
set (T8CODE_VTK_VERSION_USED "${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}")
# Define T8_VTK_VERSION_USED for internal and external use in source files.
# Note, external libraries linking against t8code (i.e. using find_package ( T8CODE REQUIRED )) can
# use T8_VTK_VERSION_USED in source code and T8CODE_VTK_VERSION_USED (defined in config.cmake.in) in their CMake scripts.
target_compile_definitions( T8 PUBLIC T8_VTK_VERSION_USED="${T8CODE_VTK_VERSION_USED}" )
target_compile_definitions( T8 PUBLIC T8_ENABLE_VTK=1 )
target_include_directories( T8 PUBLIC ${VTK_INCLUDE_DIR} )
target_link_libraries( T8 PUBLIC ${VTK_LIBRARIES} )
Expand Down
3 changes: 3 additions & 0 deletions src/config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ set( T8CODE_USE_SYSTEM_P4EST @T8CODE_USE_SYSTEM_P4EST@ )

if(T8CODE_ENABLE_VTK)
find_dependency(VTK)
# Expose the variable T8CODE_VTK_VERSION_USED to external CMake scripts linking against t8code
# for example with find_package ( T8CODE REQUIRED )
set (T8CODE_VTK_VERSION_USED "@T8CODE_VTK_VERSION_USED@")
endif()

include( "${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@-targets.cmake" )
Expand Down