I have some problem following this installation guide https://github.com/laxnpander/OpenREALM_ROS1_Bridge
Before quick start section, the command catkin_make -DCMAKE_BUILD_TYPE=Release does not work.
It is the last step before to use the whole library.
Someone can help me?
Example of the errors:
CMake Error at OpenREALM_ROS1_Bridge/realm_ros/CMakeLists.txt:141 (add_executable):
Target "realm_exiv2_grabber" links to target "Boost::filesystem" but the
target was not found. Perhaps a find_package() call is missing for an
IMPORTED target, or an ALIAS target is missing?
CMake Error at OpenREALM_ROS1_Bridge/realm_ros/CMakeLists.txt:141 (add_executable):
Target "realm_exiv2_grabber" links to target "FLANN::FLANN" but the target
was not found. Perhaps a find_package() call is missing for an IMPORTED
target, or an ALIAS target is missing?
CMake Error at OpenREALM_ROS1_Bridge/realm_ros/CMakeLists.txt:137 (add_executable):
Target "realm_ros_grabber" links to target "Boost::filesystem" but the
target was not found. Perhaps a find_package() call is missing for an
IMPORTED target, or an ALIAS target is missing?
CMake Error at OpenREALM_ROS1_Bridge/realm_ros/CMakeLists.txt:137 (add_executable):
Target "realm_ros_grabber" links to target "FLANN::FLANN" but the target
was not found. Perhaps a find_package() call is missing for an IMPORTED
target, or an ALIAS target is missing?
CMake Error at OpenREALM_ROS1_Bridge/realm_ros/CMakeLists.txt:109 (add_library):
Target "realm_ros" links to target "Boost::filesystem" but the target was
not found. Perhaps a find_package() call is missing for an IMPORTED
target, or an ALIAS target is missing?
CMake Error at OpenREALM_ROS1_Bridge/realm_ros/CMakeLists.txt:109 (add_library):
Target "realm_ros" links to target "FLANN::FLANN" but the target was not
found. Perhaps a find_package() call is missing for an IMPORTED target, or
an ALIAS target is missing?
CMake Error at OpenREALM_ROS1_Bridge/realm_ros/CMakeLists.txt:145 (add_executable):
Target "realm_stage_node" links to target "Boost::filesystem" but the
target was not found. Perhaps a find_package() call is missing for an
IMPORTED target, or an ALIAS target is missing?
CMake Error at OpenREALM_ROS1_Bridge/realm_ros/CMakeLists.txt:145 (add_executable):
Target "realm_stage_node" links to target "FLANN::FLANN" but the target was
not found. Perhaps a find_package() call is missing for an IMPORTED
target, or an ALIAS target is missing?
-- Generating done
CMake Generate step failed. Build files cannot be regenerated correctly.
I don't have any idea of how to solve it.
Cheers!
You need to make sure the correct boost libraries are actually added to the CMakeLists.txt. That repo does not appear to be set up correctly. In realm_ros/CMakeLists.txt find the line target_link_libraries(...) and add:
${Boost_FILESYSTEM_LIBRARIES}
${Boost_SYSTEM_LIBRARIES}
Related
Configuring done
CMake Error at CMakeLists.txt:5 (target_link_libraries):
Target "101_GlyphRendering_bin" links to:
igl::core
but the target was not found. Possible reasons include:
* There is a typo in the target name.
* A find_package call is missing for an IMPORTED target.
* An ALIAS target is missing.
Here is my CMakeLists.txt:
cmake_minimum_required(VERSION 3.16)
project(101_GlyphRendering)
add_executable(${PROJECT_NAME}_bin main.cpp)
target_link_libraries(${PROJECT_NAME}_bin PUBLIC igl::core igl::glfw igl::opengl tutorials)
I opened the project and built it, an error occurred:
C1083 Cannot open include file:'directional/directional_viewer.h':No such file or dictory
enter image description here
I'm not sure what exactly is your problem, but speaking of
C1083 Cannot open include file:'directional/directional_viewer.h':No
such file or directory
If you want to manually link libraries, you need to also include headers from that libraries. To do such, use
target_include_directories(<target> PUBLIC <include_folder_dir>)
where <target> is your ${PROJECT_NAME}_bin and <include_folder_dir> is folder with headers of library you are linking to.
I am trying to automate the fetch a few dependencies in CMakeList.txt, using FetchContent_Declare and FetchContent_MakeAvailable.
However I found the following error when running cmake
CMake Error at build/_deps/hermes-src/cmake/modules/Hermes.cmake:123 (add_library):
add_library cannot create target "gtest" because another target with the
same name already exists. The existing target is a static library created
in source directory
"/path/to/build/_deps/googletest-src/googletest". See
documentation for policy CMP0002 for more details.
Call Stack (most recent call first):
build/_deps/hermes-src/external/llvh/utils/unittest/CMakeLists.txt:53 (add_hermes_library)
CMake Error at build/_deps/hermes-src/cmake/modules/Hermes.cmake:123 (add_library):
add_library cannot create target "gtest_main" because another target with
the same name already exists. The existing target is a static library
created in source directory
"path/to/build/_deps/googletest-src/googletest". See
documentation for policy CMP0002 for more details.
Call Stack (most recent call first):
build/_deps/hermes-src/external/llvh/utils/unittest/UnitTestMain/CMakeLists.txt:1 (add_hermes_library)
This is the CMakeLists.txt to reproduce
cmake_minimum_required(VERSION 3.13)
project(pytorch_live_cxx)
set(CMAKE_CXX_STANDARD 14)
include(FetchContent)
FetchContent_Declare(
googletest
URL https://github.com/google/googletest/archive/609281088cfefc76f9d0ce82e1ff6c30cc3591e5.zip
)
FetchContent_MakeAvailable(googletest)
FetchContent_Declare(
hermes
URL https://github.com/facebook/hermes/archive/d63feeb46d26fe0ca7e789fc793f409e5158b27f.zip
)
FetchContent_MakeAvailable(hermes)
My questions:
does that mean hermes has googletest as dependencies? If so, I can just call target_link_libraries(myexec, gtest) without calling fetching googletest?
Is there any better practice to avoid target name conflict like this? This is an example in my imagination: we have package A which builds target a and b, and package B which builds targets b and c. What should I do if I want to links to all a, b and c?
Thanks
I have the latest assimp source code (5.0.1 release), I have built it with CMake and installed using cmake --install. Now I am trying to add it to my CMake project: find_package(Assimp REQUIRED Assimp) - at this moment it configures fine. The problems started when I tried to add
target_link_libraries(
MyProj PRIVATE
Assimp::Assimp
)
And I get the following error:
[cmake] target "MyProj" links to target "Assimp::Assimp" but the target
[cmake] was not found. Perhaps a find_package() call is missing for an IMPORTED
[cmake] target, or an ALIAS target is missing?
After some research, I've tried target_link_libraries(MyProj PRIVATE ${ASSIMP_LIBRARIES}), this time I got a compile error, and when I displayed the value of the ${ASSIMP_LIBRARIES} variable (command: message("${ASSIMP_LIBRARIES}")) I got: assimp-vc142-mt.dll - it contains .dll name, even without full path. Have a lot of troubles with assimp, could anyone suggest a solution?
Without having any knowledge of assimp, I think what you want is this:
target_link_libraries(MyProj PRIVATE assimp::assimp)
As far as I know, CMake target names are case sensitive and the assimp::assimp alias target is created here with lowercase a.
I'm trying to build Mapbox GL Native using cmake .. so I cloned the repository from GitHub:
$ git clone https://github.com/mapbox/mapbox-gl-native.git
$ cd mapbox-gl-native
$ mkdir build && cd build
$ cmake ./
then it returns this with the erros:
CMake Error at node_modules/#mapbox/cmake-node-module/module.cmake:126 (add_library):
Target "mbgl-node.abi-64" links to target "OpenGL::OpenGL" but the target
was not found. Perhaps a find_package() call is missing for an IMPORTED
target, or an ALIAS target is missing?
Call Stack (most recent call first):
platform/node/CMakeLists.txt:9 (add_node_module)
CMake Error at node_modules/#mapbox/cmake-node-module/module.cmake:126 (add_library):
Target "mbgl-node.abi-64" links to target "OpenGL::OpenGL" but the target
was not found. Perhaps a find_package() call is missing for an IMPORTED
target, or an ALIAS target is missing?
Call Stack (most recent call first):
platform/node/CMakeLists.txt:9 (add_node_module)
CMake Error at node_modules/#mapbox/cmake-node-module/module.cmake:126 (add_library):
Target "mbgl-node.abi-57" links to target "OpenGL::OpenGL" but the target
was not found. Perhaps a find_package() call is missing for an IMPORTED
target, or an ALIAS target is missing?
Call Stack (most recent call first):
platform/node/CMakeLists.txt:9 (add_node_module)
I need heeeelp, I've been here trying to fix this but I don't know what could be the problem..
Thanks guys!
If your OpenGL library path installation is defined in your ENV path,
you want to set up your CMAKE_PREFIX_PATH to your OpenGL installation path (you could set it in your top level CMakeList.txt).
The following error occurs when the cmake that was running in a Windows environment is performed on Linux:
Error message is
(CMake GUI generate button click error message):
CMake Error at SDK/A/Util/CMakeLists.txt:132 (add_library):
Target "Util" links to target "VSI::GL" but the target was not found.
Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?
CMake Error at SDK/B/Vis/CMakeLists.txt:424 (add_library):
Target "Util" links to target "VSI::GL" but the target was not found.
Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?
The SDK/A/Util/CMakeLists.txt:132 is:
add_library(Util ${STATIC_OR_SHARED} ${UTIL_PROJECT_FILES})
set_target_properties(Util PROPERTIES
FOLDER "SDK"
PROJECT_LABEL "SDK - Util"
)
ApplySDKVersion(Util)
target_include_directories(Util PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
$<INSTALL_INTERFACE:include>
)
target_link_libraries(Util PUBLIC Vis Data Core)
target_link_libraries(Util PRIVATE VSI::GL)
if(UTIL_SHARED)
target_compile_definitions(Util PRIVATE Util_LIB_EXPORT_SHARED)
else()
target_compile_definitions(Util PUBLIC Util_LIB_EXPORT_STATIC)
endif()
Does anyone know how to fix this?
Thanks for reading!.
solved.
It was a problem with the external program.
In my case it was an OpenGL version issue.
thank you for read!
additional infomation
I was using vmware.
vmware supports only openGL version 2.1 (not pro version)
So, after installing Centos myself, update the opengl version, the program worked fine.
I hope it helps a lot!