Windows 10, VS 2013: Cmake error while configuring OpenCL program - cmake

I'm trying to build this Github project in Windows. Getting the error below. I've installed the AMD SDK and added the path to PATH variable. Please let me know how to overcome this issue.
CMake Error at CMakeLists.txt:94 (find_package):
By not providing "FindOpenCL.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "OpenCL", but
CMake did not find one.
Could not find a package configuration file provided by "OpenCL" with any
of the following names:
OpenCLConfig.cmake
opencl-config.cmake
Add the installation prefix of "OpenCL" to CMAKE_PREFIX_PATH or set
"OpenCL_DIR" to a directory containing one of the above files. If "OpenCL"
provides a separate development package or SDK, be sure it has been
installed.
-- Configuring incomplete, errors occurred!

According to docs, CMake provides FindOpenCL.cmake module since version 3.1. So you need at least CMake 3.1 for build given project.
Actually, it is the project's cmake_minimum_required who should provide correct constraint.

Related

trouble using cgal and cmake

I have to do a project using CMake and the CGAL geometry library but, regardless having tried everything I can find online, I still can't figure out how to configure my project in CMake. I have installed all the libraries CGAL depends on and qt5 but CMake keeps giving me errors when I try to configure and generate. I am almost a beginner so any kind of help would be very useful. I am using windows 10 and visual studio 2019. Following are the errors it's giving me.
CMake Warning at CMakeLists.txt:5 (find_package): By not providing "FindCGAL.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "CGAL", but CMake did not find one.
Could not find a package configuration file provided by "CGAL" with any of the following names:
CGALConfig.cmake
cgal-config.cmake
Add the installation prefix of "CGAL" to CMAKE_PREFIX_PATH or set "CGAL_DIR" to a directory containing one of the above files. If "CGAL" provides a separate development package or SDK, be sure it has been installed.
CMakeLists.txt
cmake_minimum_required(VERSION "3.22.0-rc2")
project("TesiLaurea")
find_package(CGAL)
add_executable("${PROJECT_NAME}" "Main.cpp")
target_link_libraries("${PROJECT_NAME}" CGAL::CGAL)

How to download ignition-cmake2 on ubuntu 16.04

CMake Error at CMakeLists.txt:12 (find_package):
By not providing "Findignition-cmake2.cmake" in CMAKE_MODULE_PATH this
project has asked CMake to find a package configuration file provided by
"ignition-cmake2", but CMake did not find one.
Could not find a package configuration file provided by "ignition-cmake2"
with any of the following names:
ignition-cmake2Config.cmake
ignition-cmake2-config.cmake
Add the installation prefix of "ignition-cmake2" to CMAKE_PREFIX_PATH or
set "ignition-cmake2_DIR" to a directory containing one of the above files.
If "ignition-cmake2" provides a separate development package or SDK, be
sure it has been installed.
-- Configuring incomplete, errors occurred!
See also "/tmp/ign-fuel-tools/build/CMakeFiles/CMakeOutput.log".
I am using ubuntu 16.04 and already download "ignition-cmake0".
I had a similar error and I solve mine writing the path of the directory on the Build/CMakeCache in the line where is written NOT FOUND.

Cmake errors when using LLVM 5.0.0 from brew

I'm trying to use the stock LLVM 5.0.0 provided by Homebrew (MacOS High Sierra 10.13.3). LLVM is installed on my machine under /usr/local/Cellar/llvm/5.0.0/
Now, in my project, I have the following lines in CMakeLists.txt:
# Find the LLVM library
find_package( LLVM 5.0.0 REQUIRED )
include_directories( "${LLVM_INCLUDE_DIRS}" )
link_directories(${LLVM_LIBRARY_DIRS})
message(STATUS "LLVM include dirs: ${LLVM_INCLUDE_DIRS}")
If I run CMake without any parameters, I get:
CMake Error at CMakeLists.txt:74 (find_package):
By not providing "FindLLVM.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "LLVM", but
CMake did not find one.
Could not find a package configuration file provided by "LLVM" (requested
version 5.0.0) with any of the following names:
LLVMConfig.cmake
llvm-config.cmake
Add the installation prefix of "LLVM" to CMAKE_PREFIX_PATH or set
"LLVM_DIR" to a directory containing one of the above files. If "LLVM"
provides a separate development package or SDK, be sure it has been
installed.
It tells me that it couldn't find LLVM. So, I pass the path to the LLVM_DIR, like this:
cmake .. -DLLVM_DIR=/usr/local/Cellar/llvm/5.0.0/share/cmake/modules/
I would expect everything to work. Instead I get the following error:
CMake Error at CMakeLists.txt:74 (find_package):
Could not find a configuration file for package "LLVM" that is compatible
with requested version "5.0.0".
The following configuration files were considered but not accepted:
/usr/local/Cellar/llvm/5.0.0/share/cmake/modules/llvm-config.cmake,
version: unknown
For some reason the version is not present anywhere in the share/cmake/modules directory.
How can I fix this, without changing the brew-installed LLVM?
Found the answer. I was passing a wrong path to LLVM_DIR.
I just have to use another directory (buried in lib, not in share):
cmake .. -DLLVM_DIR=/usr/local/Cellar/llvm/5.0.0/lib/cmake/llvm/
Not sure why brew decided to install 2 versions of CMake helpers for LLVM, one in share and one in lib.

eigen3 missing error during ROS installation

Hi I'm trying to install ROS on my MAC using homebrew.While installation I got this message :
CMake Error at CMakeLists.txt:7 (find_package):
By not providing "FindEigen3.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "Eigen3", but
CMake did not find one
Could not find a package configuration file provided by "Eigen3" with any
of the following names:
Eigen3Config.cmake
eigen3-config.cmake
Add the installation prefix of "Eigen3" to CMAKE_PREFIX_PATH or set
"Eigen3_DIR" to a directory containing one of the above files. If "Eigen3"
provides a separate development package or SDK, be sure it has been
installed.
-- Configuring incomplete, errors occurred!
See also "/Users/Jishnu/ros_catkin_ws/build_isolated/pcl_ros/CMakeFiles/CMakeOutput.log".
<== Failed to process package 'pcl_ros':
Command '['/Users/Jishnu/ros_catkin_ws/install_isolated/env.sh', ' cmake', '/Users/Jishnu/ros_catkin_ws/src/perception_pcl/pcl_ros', '- DCATKIN_DEVEL_PREFIX=/Users/Jishnu/ros_catkin_ws/devel_isolated/pcl_ros', '-DCMAKE_INSTALL_PREFIX=/Users/Jishnu/ros_catkin_ws/install_isolated', '-DCMAKE_BUILD_TYPE=Release', '-G', 'Unix Makefiles']' returned non-zero exit status 1
I'M a beginner in ROS, so could someone please help me out with this. I have checked if Eigen is installed, version 3.2.4 is already installed
This solved the problem for me.
It seems this has been resolved, but I'll share how I got this
working: Elsewhere in the ros build workspace I found a copy of
FindEigen3.cmake:
ros_catkin_ws$ cp
src/orocos_kinematics_dynamics/orocos_kdl/config/FindEigen3.cmake
src/perception_pcl/pcl_ros/cfg/ Then I removed the following from
CMakeLists:
find_package(Eigen 3 Required) Replacing it with these lines from the
orocos CMakeLists
find_package(Eigen 3 QUIET) if(NOT Eigen_FOUND)
include(${PROJ_SOURCE_DIR}/cfg/FindEigen3.cmake)
set(Eigen_INCLUDE_DIR ${EIGEN3_INCLUDE_DIR}) endif()
include_directories(${Eigen_INCLUDE_DIR}) To be perfectly honest, I
didn't change config -> cfg when I did my build, but it seems to have
worked.
What I did to solve such problem was:
Finding the current value of CMAKE_ROOT by print it out using message( WARNING ${CMAKE_ROOT}) in .cmake file
Make sure Modules/FindEigen3.cmake exists in that folder
If not, download a copy from https://github.com/RainerKuemmerle/g2o/blob/master/cmake_modules/FindEigen3.cmake

"OpenCV" is considered to be NOT FOUND

Linux Flavor: Debian (Crunch Bang)
Problem Occurred: When attempting to build cvblobs with the following command
cd ~/cvblob
cmake .
Error:
CMake Error at cvBlob/CMakeLists.txt:20 (find_package):
Found package configuration file:
/usr/local/share/OpenCV/OpenCVConfig.cmake
but it set OpenCV_FOUND to FALSE so package "OpenCV" is considered to be
NOT FOUND.
-- Configuring incomplete, errors occurred!
Well I met a similar problem when I was going with some other open source face detection modules rather than cvblobs.
Actually you will find that before these lines of error-info, there are:
CMake Warning at /usr/local/opencv-2.4.13/cmake/OpenCVConfig.cmake:163 (message):
Found OpenCV Windows Pack but it has not binaries compatible with your configuration.
You should manually point CMake variable OpenCV_DIR to your build of OpenCV library.
Call Stack (most recent call first):
CMakeLists.txt:57 (find_package)
CMake Warning at CMakeLists.txt:57 (find_package):
Found package configuration file:
/usr/local/opencv-2.4.13/cmake/OpenCVConfig.cmake
but it set OpenCV_FOUND to FALSE so package "OpenCV" is considered to be NOT FOUND.
So you may notice that it asks you to manually point out the directory of you build version of OpenCV library.
For me, my source codes are at
/usr/local/opencv-2.4.13/
but I make and install my release build of OpenCV at
/usr/local/opencv-2.4.13/release/
so I use:
cmake -D OpenCV_DIR=/usr/local/opencv-2.4.13/release/ ..
and everything works:)
When I compile a program that use OpenCV lib, vision 2.4.8, occurs the similar error, when I point manually Opencv_DIR path to opencv/build ,visio 3.1.0, error occurred like you.
Then I point Opencv_DIR path to opencv/build whose vision is same to the program used. It works.
One of the reason could be the another OpenCV package in another path, that you had installed before. In my case, I had already installed OpenCV for Python in Anaconda package, and the CMake always wanted to refer me to that package.
I simply added:
set(OpenCV_FOUND 1)
to my CMakeList.txt file, this command simply override the other package you may had installed. The final version of CMakeList file which is working for me would be this:
set( OpenCV_FOUND 1 )
find_package(OpenCV 2.4.13 REQUIRED PATHS "C:/opencv")
set(SOURCE_FILES main.cpp)
add_executable(OpenCV_Test ${SOURCE_FILES})
Note:
1- I am using the CMakeList.txt file for Clion IDE
2- I am using it under windows. Probably you may set the relevant path if you use other OS
3- You need also change the OpenCV version if you use other version