I'm running CMake by this command:
cmake -DCMAKE_PREFIX_PATH=deps/build/destdir/usr/local -DBoost_NO_BOOST_CMAKE=ON ..
But, this error is received:
ldd: warning: you do not have execution permission for
`/home/m3/repos/cpp-service/deps/build/destdir/usr/local/lib/libopenvdb.a'not a dynamic executable
Call Stack (most recent call first):
/usr/local/lib64/cmake/OpenVDB/FindOpenVDB.cmake:550 (get_prerequisites) linux.cmake:29 (find_package)
CMakeLists.txt:28 (include)
I think the problem is due to the fact that I have libopenvdb.a
installed in two paths:
/usr/local/lib64/
inside my system filesystemdeps/build/destdir/usr/local/lib/
inside my source code treeI intend to use the OpenVDB inside my source code tree, not the system one. I don't have enough CMake expertise. How can I avoid such conflicts?
As @U.W. commented, the CMake file was problematic.
In my CMake file I had such statements:
list(APPEND CMAKE_MODULE_PATH "/usr/local/lib64/cmake/OpenVDB/")
find_package(OpenVDB REQUIRED)
target_link_libraries(
${PROJECT_NAME} PUBLIC
OpenVDB::openvdb)
The error got resovled by replacing the above statements with these ones:
list(
APPEND CMAKE_MODULE_PATH
"/home/m3/repos/cpp-service/deps/build/destdir/usr/local/lib/cmake/OpenVDB")
set(OPENVDB_USE_STATIC_LIBS ON)
find_package(OpenVDB REQUIRED)
target_link_libraries(
${PROJECT_NAME} PUBLIC
OpenVDB::openvdb)