Skip to content

Commit

Permalink
Fixed CMake file for VTK in dependent projects.
Browse files Browse the repository at this point in the history
  • Loading branch information
XaverKlemenschits committed Oct 6, 2020
1 parent 6e2fda1 commit 305a8b3
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ if(VIENNALS_USE_VTK)
find_package(VTK QUIET)
if(VTK_FOUND)
message(STATUS "Found VTK")
add_definitions(-DVIENNALS_USE_VTK)
add_compile_definitions(VIENNALS_USE_VTK)
include(${VTK_USE_FILE})
# only link needed vtk libraries for static builds
if(VIENNALS_STATIC_BUILD)
Expand Down
20 changes: 20 additions & 0 deletions cmake/ViennaLSConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,26 @@ else(ViennaLS_COMMON_TARGET)
# include("${CMAKE_CURRENT_LIST_DIR}/@[email protected]")
endif()

if(@VIENNALS_USE_VTK@)
add_compile_definitions(VIENNALS_USE_VTK)
if(NOT VTK_DIR)
set(VTK_DIR $ENV{VTK_DIR})
endif(NOT VTK_DIR)
find_package(VTK QUIET)
if(VTK_FOUND)
message(STATUS "Found VTK")
add_compile_definitions(VIENNALS_USE_VTK)
include(${VTK_USE_FILE})
# only link needed vtk libraries for static builds
if(VIENNALS_STATIC_BUILD)
set(VTK_LIBRARIES vtksys;vtkIOCore;vtkexpat;vtklz4;vtkzlib;vtklzma;vtkdoubleconversion;vtkCommonMisc;vtkCommonSystem;vtkIOXML)
endif(VIENNALS_STATIC_BUILD)
list(APPEND VIENNALS_LIBRARIES ${VTK_LIBRARIES})
list(APPEND VIENNALS_PYTHON_LIBRARIES ${VTK_LIBRARIES})
else(VTK_FOUND)
message(STATUS "No VTK install found: Building without VTK.")
endif(VTK_FOUND)
endif()

if(@VIENNALS_BUILD_SHARED_LIBS@)
option(VIENNALS_USE_SHARED_LIBS "Use precompiled headers" ON)
Expand Down
5 changes: 1 addition & 4 deletions include/lsWriteVisualizationMesh.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ template <class T, int D> class lsWriteVisualizationMesh {
lsMessage::getInstance()
.addWarning("lsWriteVisualizationMesh: Level Set " +
std::to_string(i) +
" must have a width greater than 2! Not converting!")
" should have a width greater than 2! Conversion might fail!")
.print();
}
}
Expand Down Expand Up @@ -526,9 +526,6 @@ template <class T, int D> class lsWriteVisualizationMesh {
if (it->get()->getNumberOfPoints() == 0)
continue; // ignore empty levelSets

assert(it->get()->getLevelSetWidth() >=
numLayers); // check if enough information

// create grid of next LS with slight offset and project into current mesh
vtkSmartPointer<vtkRectilinearGrid> rgrid =
vtkSmartPointer<vtkRectilinearGrid>::New();
Expand Down

0 comments on commit 305a8b3

Please sign in to comment.