Hello,
We are trying to setup our applications, that uses VTK (9.1), to be automatically built by our build system, Gitlab. Before that, however, we are trying to build manually.
When building the ‘install’ target of VTK, all binaries and headers, etc, are copied to our Build folder.
Applications that are to use VTK, subsequently, are using CMake. However, when only the the ‘install’ folder of VTK is present, we have problems with apps finding VTK headers and libraries properly.
We basically want a binary VTK build package that we can just copy into our build folder, and from there build our ‘on top of VTK’ apps. If that is possible?
The CMake file for one of our apps (actually a library), that are using VTK, looks (snippet) like this:
...
...
#===== Shared library
add_library(${target} SHARED
${src}
${HDRS}
)
#Find boost
find_package(Boost ${BOOST_VERSION} EXACT COMPONENTS system filesystem REQUIRED)
find_package(VTK 9.1)
message("VTK_FOUND: ${VTK_FOUND}")
message("VTK_INCLUDE_DIRS: ${VTK_INCLUDE_DIRS}")
message("VTK_LIBRARIES: ${VTK_LIBRARIES}")
#
#vtk_module_autoinit(
# TARGETS arbFoundation
# MODULES ${VTK_LIBRARIES}
#)
find_package(Poco REQUIRED COMPONENTS Foundation Data JSON DataSQLite)
target_include_directories (${target} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${Boost_INCLUDE_DIRS})
target_compile_definitions(${target} PRIVATE
EXPORT_ARBORETA_FOUNDATION
EXPORT_ARBORETA_COMMON
EXPORT_ARBORETA_MATH
EXPORT_ARBORETA_GRAPHICS
EXPORT_ARBORETA_VOLUMEMANAGER
)
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
message(STATUS "Setting up BOOST")
message(STATUS " Includes - ${Boost_INCLUDE_DIRS}")
message(STATUS " Library - ${Boost_LIBRARY_DIRS}")
endif()
target_link_libraries(
${target}
${VTK_LIBRARIES}
Poco::Foundation debug
Poco::Data
Poco::DataSQLite
Poco::JSON
${boost_FILESYSTEM_LIBRARY}
${boost_SYSTEM_LIBRARY}
)
When setting VTK_DIR to /our_build_folder/lib/cmake/vtk-9.1 , then when configuring the above CMake file, we get errors:
CMake Error at X:/arboreta_auto_build/lib/cmake/vtk-9.1/vtk-config.cmake:138 (include):
include could not find requested file:
X:/arboreta_auto_build/lib/cmake/vtk-9.1/VTK-targets.cmake
Call Stack (most recent call first):
foundation/CMakeLists.txt:163 (find_package)
CMake Error at X:/arboreta_auto_build/lib/cmake/vtk-9.1/vtk-config.cmake:139 (include):
include could not find requested file:
X:/arboreta_auto_build/lib/cmake/vtk-9.1/VTK-vtk-module-properties.cmake
Call Stack (most recent call first):
foundation/CMakeLists.txt:163 (find_package)
...
And they message statements above gives:
VTK_FOUND: 1
VTK_INCLUDE_DIRS:
VTK_LIBRARIES:
Any hints on what we might be missing?