Closed albator82 closed 3 years ago
I guess some of the occt->vtk linking shouldn't be linked public. Is it possible for you to share a minimal example?
I guess some of the occt->vtk linking shouldn't be linked public. Is it possible for you to share a minimal example?
Here is my CMakeLists
cmake_minimum_required(VERSION 3.0.0 FATAL_ERROR)
set(CMAKE_CXX_STANDARD 14)
#GTest
find_package(GTest REQUIRED)
message(STATUS " GTests library " ${GTEST_BOTH_LIBRARIES})
message(STATUS " GTests libraries " ${GTEST_LIBRARIES})
message(STATUS " GTests include " ${GTEST_INCLUDE_DIRS})
#nlohmann_json
find_package(nlohmann_json REQUIRED)
#OpenCASCADE
find_package(OpenCASCADE REQUIRED)
message(STATUS " OpenCASCADE library " ${OpenCASCADE_LIBRARIES})
message(STATUS " OpenCASCADE include dir " ${OpenCASCADE_INCLUDE_DIR})
message(STATUS "OpenCascade library dir " ${OpenCASCADE_LIBRARY_DIR})
#gsl
find_package(GSL REQUIRED)
message(STATUS "GSL ROOT DIR: " ${GSL_ROOT_DIR})
message(STATUS "gsl include dirs: " ${GSL_INCLUDE_DIRS})
message(STATUS "gsl lib dirs: " ${GSL_LIBRARIES})
#pybind11
find_package(pybind11 CONFIG REQUIRED)
message(STATUS "pybind11 include dirs: " ${pybind11_INCLUDE_DIRS})
message(STATUS "pybind11 lib dir: " ${pybind11_LIBRARIES})
###################################################
add_subdirectory(src)
I never call VTK because I don't need it.
As a workaround try not linking against TKIVtk
. Your cmake file does not tell much due to the add_subdriectory
call but I assume that you link against all OpenCASCADE_LIBRARIES
.
It seems that the fix-private-linking.patch is not applied properly @looooo .
@adam-urbanczyk you're right I link directly against OpenCASCADE_LIBRARIES
(target_link_libraries(Airfoil PUBLIC Utils ${OpenCASCADE_LIBRARIES})
).
I'm quite new to CMake. So how do you do to not link against TKIVtk
?
Could you tell me please the right command ?
To inform anyone who could be interested, I have found a solution to my problem by adding the following commands to the CMakeLists.txt :
find_package(VTK COMPONENTS CommonCore REQUIRED)
#Freetype
find_package(Freetype REQUIRED)
#GLEW
find_package(GLEW REQUIRED)
Issue:
I work on an C++ application using OCCT. I've updated OCCT to 7.4.0 (hd267c4f_8) with conda and rebuild the project with CMake. It seems there are no errors in the CMakeLists.txt but when I compile I got the error : "LINK : fatal error LNK1181: cannot open input file 'vtkCommonCore-9.0.lib" It is strange because I don't use vtk...
So I thought it was due to a vtk dependencies and I decided to change my OCCT build version to a version without vtk and finally install OCCT 7.4.0 h823b557_3 and everything works fine.
For me it seems the vtk dependency is the problem, is there a way to use the last build of OCCT (hd267c4f_8) or to fix the problem with a CMake command ?
Environment (
conda list
):Details about
conda
and system (conda info
):