-
Notifications
You must be signed in to change notification settings - Fork 344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CImg: cv.h not found #422
Comments
After upgrading CMake from |
I'm having the same issue while trying to add FetchContent_Declare(
matplotplusplus
GIT_REPOSITORY https://github.com/alandefreitas/matplotplusplus.git
GIT_TAG v1.2.0
)
FetchContent_MakeAvailable(matplotplusplus)
target_link_libraries(tests PRIVATE matplot) I'm using CMake |
I also have this issue on Ubuntu 22. |
A colleague of mine has helped to find a workaround for this issue. It helps to disable line I have added a CMake option In a CMake project you can now just add another parameter to the cmake command. For example: cmake -B build -DMATPLOTPP_WITH_OPENCV=OFF If you would like to disable it programatically in a CMake script, e.g., if you've added it via CPM, you can set the option to set(MATPLOTPP_WITH_OPENCV OFF CACHE BOOL "Disable use of OpenCV in CImg of Matplot++" FORCE) In case you've added Matplot++ via CPM, make sure to set the option before calling CPM. Otherwise the option is not effective, as CPM already triggers a configuration of the package. Example: # Set Matplot++ compile options.
set(MATPLOTPP_WITH_OPENCV OFF CACHE BOOL "Disable use of OpenCV in CImg of Matplot++" FORCE)
CPMAddPackage(
NAME matplotplusplus
GITHUB_REPOSITORY Zacrain/matplotplusplus
GIT_TAG cimg-optional-compilation
) Note, that this is not a fix, just a workaround. |
Bug category
Matplot++ Version
1.2.0
Describe the bug
I've added Matplot++ via CPM on two Ubuntu machines. I have no issues on one of them. The other, however, can not compile due to
cv.h
not being found which is required by the 3rd party libraryCImg
.In
CImg.h
I've tried changing the included headers toopencv2/opencv.hpp
andopencv2/highgui.hpp
as OpenCV 4.8.1 is installed. This, understandably, led to a bunch of errors. And removing the CImg library seems not to be a solution either as Matplot++ obviously relies on it in several ways.Steps to Reproduce
(
ENABLE_MATPLOT
is an option I set in my project's CMake configuration to enable/disable some components which rely on Matplot. I can build my project without Matplot++ features if I want to, so you don't need to worry about that option.)Output
Platform
Environment Details:
Additional context
CPM command used to add Matplot++ and the corresponding section in the specific CMake file:
The text was updated successfully, but these errors were encountered: