CMake Error at C:Users…Desktopimgwarp-opencvimgwarp-opencvsrcCMakeLists.txt:2 (FIND_PACKAGE)cmake is not working in opencv c++ projectCMake still not working with OpenCVError while building CI2CV using cmakeError configuring OpenCV project with CMake on WindowsCMake Error at CMakeLists.txt:3 (find_package)CMake only accepting `find_package(Qt5Widgets REQUIRED)` in add_subdirectory, not in root projectCompilation project with Cmake . I'm getting an errorCMake not providing “Findlibusb-1.0.cmake” errorCmake errors when using LLVM 5.0.0 from brewCMake find_package for FindLibXml2

Do universities maintain secret textbooks?

Why do IR remotes influence AM radios?

Why do motor drives have multiple bus capacitors of small value capacitance instead of a single bus capacitor of large value?

Break down the phrase "shitsurei shinakereba naranaindesu"

Don't look at what I did there

Can UV radiation be safe for the skin?

Necessity of tenure for lifetime academic research

Can two aircraft be allowed to stay on the same runway at the same time?

How to investigate an unknown 1.5GB file named "sudo" in my Linux home directory?

When is it a good idea to capture the fianchettoed bishop?

Find the logic in first 2 statements to give the answer for the third statement

Lob Logical Read and lob read-ahead reads in NCCI

Storing milk for long periods of time

Are sweatpants frowned upon on flights?

Sum and average calculator

Can I leave a large suitcase at TPE during a 4-hour layover, and pick it up 4.5 days later when I come back to TPE on my way to Taipei downtown?

In Endgame, wouldn't Stark have remembered Hulk busting out of the stairwell?

Who declared the Last Alliance to be the "last" and why?

How were US credit cards verified in-store in the 1980's?

'Horseshoes' for Deer?

Is Borg adaptation only temporary?

Can authors email you PDFs of their textbook for free?

Moscow SVO airport, how to avoid scam taxis without pre-booking?

How do I portray irrational anger in first person?



CMake Error at C:Users…Desktopimgwarp-opencvimgwarp-opencvsrcCMakeLists.txt:2 (FIND_PACKAGE)


cmake is not working in opencv c++ projectCMake still not working with OpenCVError while building CI2CV using cmakeError configuring OpenCV project with CMake on WindowsCMake Error at CMakeLists.txt:3 (find_package)CMake only accepting `find_package(Qt5Widgets REQUIRED)` in add_subdirectory, not in root projectCompilation project with Cmake . I'm getting an errorCMake not providing “Findlibusb-1.0.cmake” errorCmake errors when using LLVM 5.0.0 from brewCMake find_package for FindLibXml2






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I am using Window 10, Visual Studio 2017. I have installed OpenCV properly and I can run some basic projects of C++ OpenCV that can be found around the internet.
I have also followed this video which shows How to Build Open Source Projects Using CMake and Visual Studio.



But, I can not run this project on my machine. I try File->Open->CMake to open the CMakeLists.txt which can be found in the downloaded repository, and I get this error:



CMake Error



CMake Error at C:UsersMajidDesktopimgwarp-opencvimgwarp-opencvsrcCMakeLists.txt:2 (FIND_PACKAGE):
By not providing "FindOpenCV.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "OpenCV", but
CMake did not find one.

Could not find a package configuration file provided by "OpenCV" with any
of the following names:

OpenCVConfig.cmake
opencv-config.cmake

Add the installation prefix of "OpenCV" to CMAKE_PREFIX_PATH or set
"OpenCV_DIR" to a directory containing one of the above files. If "OpenCV"
provides a separate development package or SDK, be sure it has been
installed.


I think I must extract the downloaded opencv-4.0.1-vc14_vc15.exe file somewhere in the project folder and link the CMakeLists.txt file (which one?) to the OpenCVConfig.cmake which is in the extracted opencv. Or maybe not.



I have also CMake gui and if I should run it that way I will appreciate that you explain it that way instead of using Visual Studio File->Open->CMake. No matter how, any way that helps me run this project is welcome. Please explain it step by step.



In one line (forget all the above): What should I do to run this project properly?










share|improve this question





















  • 1





    As for searching for OpenCV, you definitely need OpenCV installed with its OpenCVConfig.cmake file. Then find installation directory of OpenCV. When build your project, in CMake GUI create CMAKE_PREFIX_PATH cache entry (of type STRING, or PATH) and set its value to the directory with OpenCV installation. Or find location of OpenCVConfig.cmake file on your machine, and assign this location to the OpenCV_DIR cache entry. BTW, this is what is written in the error message.

    – Tsyvarev
    Mar 28 at 10:34







  • 1





    OpenCV_DIR is a CMake cache entry. Please, re-read my previous comment, it explains how to set this entry.

    – Tsyvarev
    Mar 28 at 11:40






  • 1





    As you build the project directly from Visual Studio, you don't need to use CMake GUI instead - Visual Studio already provides needed user interface. You may find CMake cache entries in menu CMake / Cache / View CMakeCache.

    – Tsyvarev
    Mar 28 at 12:30






  • 1





    OpenCV_DIR should contain directory, not a file. Also, as it is CMake variable, it should use "generic" path separator, not a one used by Windows itself. Assign C:/Users/Majid/Desktop/imgwarp-opencv/imgwarp-opencv/src/opencv/build to that variable.

    – Tsyvarev
    Mar 28 at 13:32






  • 1





    Yes, install QT.

    – Tsyvarev
    Mar 28 at 15:12

















0















I am using Window 10, Visual Studio 2017. I have installed OpenCV properly and I can run some basic projects of C++ OpenCV that can be found around the internet.
I have also followed this video which shows How to Build Open Source Projects Using CMake and Visual Studio.



But, I can not run this project on my machine. I try File->Open->CMake to open the CMakeLists.txt which can be found in the downloaded repository, and I get this error:



CMake Error



CMake Error at C:UsersMajidDesktopimgwarp-opencvimgwarp-opencvsrcCMakeLists.txt:2 (FIND_PACKAGE):
By not providing "FindOpenCV.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "OpenCV", but
CMake did not find one.

Could not find a package configuration file provided by "OpenCV" with any
of the following names:

OpenCVConfig.cmake
opencv-config.cmake

Add the installation prefix of "OpenCV" to CMAKE_PREFIX_PATH or set
"OpenCV_DIR" to a directory containing one of the above files. If "OpenCV"
provides a separate development package or SDK, be sure it has been
installed.


I think I must extract the downloaded opencv-4.0.1-vc14_vc15.exe file somewhere in the project folder and link the CMakeLists.txt file (which one?) to the OpenCVConfig.cmake which is in the extracted opencv. Or maybe not.



I have also CMake gui and if I should run it that way I will appreciate that you explain it that way instead of using Visual Studio File->Open->CMake. No matter how, any way that helps me run this project is welcome. Please explain it step by step.



In one line (forget all the above): What should I do to run this project properly?










share|improve this question





















  • 1





    As for searching for OpenCV, you definitely need OpenCV installed with its OpenCVConfig.cmake file. Then find installation directory of OpenCV. When build your project, in CMake GUI create CMAKE_PREFIX_PATH cache entry (of type STRING, or PATH) and set its value to the directory with OpenCV installation. Or find location of OpenCVConfig.cmake file on your machine, and assign this location to the OpenCV_DIR cache entry. BTW, this is what is written in the error message.

    – Tsyvarev
    Mar 28 at 10:34







  • 1





    OpenCV_DIR is a CMake cache entry. Please, re-read my previous comment, it explains how to set this entry.

    – Tsyvarev
    Mar 28 at 11:40






  • 1





    As you build the project directly from Visual Studio, you don't need to use CMake GUI instead - Visual Studio already provides needed user interface. You may find CMake cache entries in menu CMake / Cache / View CMakeCache.

    – Tsyvarev
    Mar 28 at 12:30






  • 1





    OpenCV_DIR should contain directory, not a file. Also, as it is CMake variable, it should use "generic" path separator, not a one used by Windows itself. Assign C:/Users/Majid/Desktop/imgwarp-opencv/imgwarp-opencv/src/opencv/build to that variable.

    – Tsyvarev
    Mar 28 at 13:32






  • 1





    Yes, install QT.

    – Tsyvarev
    Mar 28 at 15:12













0












0








0








I am using Window 10, Visual Studio 2017. I have installed OpenCV properly and I can run some basic projects of C++ OpenCV that can be found around the internet.
I have also followed this video which shows How to Build Open Source Projects Using CMake and Visual Studio.



But, I can not run this project on my machine. I try File->Open->CMake to open the CMakeLists.txt which can be found in the downloaded repository, and I get this error:



CMake Error



CMake Error at C:UsersMajidDesktopimgwarp-opencvimgwarp-opencvsrcCMakeLists.txt:2 (FIND_PACKAGE):
By not providing "FindOpenCV.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "OpenCV", but
CMake did not find one.

Could not find a package configuration file provided by "OpenCV" with any
of the following names:

OpenCVConfig.cmake
opencv-config.cmake

Add the installation prefix of "OpenCV" to CMAKE_PREFIX_PATH or set
"OpenCV_DIR" to a directory containing one of the above files. If "OpenCV"
provides a separate development package or SDK, be sure it has been
installed.


I think I must extract the downloaded opencv-4.0.1-vc14_vc15.exe file somewhere in the project folder and link the CMakeLists.txt file (which one?) to the OpenCVConfig.cmake which is in the extracted opencv. Or maybe not.



I have also CMake gui and if I should run it that way I will appreciate that you explain it that way instead of using Visual Studio File->Open->CMake. No matter how, any way that helps me run this project is welcome. Please explain it step by step.



In one line (forget all the above): What should I do to run this project properly?










share|improve this question
















I am using Window 10, Visual Studio 2017. I have installed OpenCV properly and I can run some basic projects of C++ OpenCV that can be found around the internet.
I have also followed this video which shows How to Build Open Source Projects Using CMake and Visual Studio.



But, I can not run this project on my machine. I try File->Open->CMake to open the CMakeLists.txt which can be found in the downloaded repository, and I get this error:



CMake Error



CMake Error at C:UsersMajidDesktopimgwarp-opencvimgwarp-opencvsrcCMakeLists.txt:2 (FIND_PACKAGE):
By not providing "FindOpenCV.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "OpenCV", but
CMake did not find one.

Could not find a package configuration file provided by "OpenCV" with any
of the following names:

OpenCVConfig.cmake
opencv-config.cmake

Add the installation prefix of "OpenCV" to CMAKE_PREFIX_PATH or set
"OpenCV_DIR" to a directory containing one of the above files. If "OpenCV"
provides a separate development package or SDK, be sure it has been
installed.


I think I must extract the downloaded opencv-4.0.1-vc14_vc15.exe file somewhere in the project folder and link the CMakeLists.txt file (which one?) to the OpenCVConfig.cmake which is in the extracted opencv. Or maybe not.



I have also CMake gui and if I should run it that way I will appreciate that you explain it that way instead of using Visual Studio File->Open->CMake. No matter how, any way that helps me run this project is welcome. Please explain it step by step.



In one line (forget all the above): What should I do to run this project properly?







c++ opencv image-processing visual-c++ cmake






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 28 at 11:33







Majid Alaeinia

















asked Mar 27 at 22:54









Majid AlaeiniaMajid Alaeinia

3692 silver badges14 bronze badges




3692 silver badges14 bronze badges










  • 1





    As for searching for OpenCV, you definitely need OpenCV installed with its OpenCVConfig.cmake file. Then find installation directory of OpenCV. When build your project, in CMake GUI create CMAKE_PREFIX_PATH cache entry (of type STRING, or PATH) and set its value to the directory with OpenCV installation. Or find location of OpenCVConfig.cmake file on your machine, and assign this location to the OpenCV_DIR cache entry. BTW, this is what is written in the error message.

    – Tsyvarev
    Mar 28 at 10:34







  • 1





    OpenCV_DIR is a CMake cache entry. Please, re-read my previous comment, it explains how to set this entry.

    – Tsyvarev
    Mar 28 at 11:40






  • 1





    As you build the project directly from Visual Studio, you don't need to use CMake GUI instead - Visual Studio already provides needed user interface. You may find CMake cache entries in menu CMake / Cache / View CMakeCache.

    – Tsyvarev
    Mar 28 at 12:30






  • 1





    OpenCV_DIR should contain directory, not a file. Also, as it is CMake variable, it should use "generic" path separator, not a one used by Windows itself. Assign C:/Users/Majid/Desktop/imgwarp-opencv/imgwarp-opencv/src/opencv/build to that variable.

    – Tsyvarev
    Mar 28 at 13:32






  • 1





    Yes, install QT.

    – Tsyvarev
    Mar 28 at 15:12












  • 1





    As for searching for OpenCV, you definitely need OpenCV installed with its OpenCVConfig.cmake file. Then find installation directory of OpenCV. When build your project, in CMake GUI create CMAKE_PREFIX_PATH cache entry (of type STRING, or PATH) and set its value to the directory with OpenCV installation. Or find location of OpenCVConfig.cmake file on your machine, and assign this location to the OpenCV_DIR cache entry. BTW, this is what is written in the error message.

    – Tsyvarev
    Mar 28 at 10:34







  • 1





    OpenCV_DIR is a CMake cache entry. Please, re-read my previous comment, it explains how to set this entry.

    – Tsyvarev
    Mar 28 at 11:40






  • 1





    As you build the project directly from Visual Studio, you don't need to use CMake GUI instead - Visual Studio already provides needed user interface. You may find CMake cache entries in menu CMake / Cache / View CMakeCache.

    – Tsyvarev
    Mar 28 at 12:30






  • 1





    OpenCV_DIR should contain directory, not a file. Also, as it is CMake variable, it should use "generic" path separator, not a one used by Windows itself. Assign C:/Users/Majid/Desktop/imgwarp-opencv/imgwarp-opencv/src/opencv/build to that variable.

    – Tsyvarev
    Mar 28 at 13:32






  • 1





    Yes, install QT.

    – Tsyvarev
    Mar 28 at 15:12







1




1





As for searching for OpenCV, you definitely need OpenCV installed with its OpenCVConfig.cmake file. Then find installation directory of OpenCV. When build your project, in CMake GUI create CMAKE_PREFIX_PATH cache entry (of type STRING, or PATH) and set its value to the directory with OpenCV installation. Or find location of OpenCVConfig.cmake file on your machine, and assign this location to the OpenCV_DIR cache entry. BTW, this is what is written in the error message.

– Tsyvarev
Mar 28 at 10:34






As for searching for OpenCV, you definitely need OpenCV installed with its OpenCVConfig.cmake file. Then find installation directory of OpenCV. When build your project, in CMake GUI create CMAKE_PREFIX_PATH cache entry (of type STRING, or PATH) and set its value to the directory with OpenCV installation. Or find location of OpenCVConfig.cmake file on your machine, and assign this location to the OpenCV_DIR cache entry. BTW, this is what is written in the error message.

– Tsyvarev
Mar 28 at 10:34





1




1





OpenCV_DIR is a CMake cache entry. Please, re-read my previous comment, it explains how to set this entry.

– Tsyvarev
Mar 28 at 11:40





OpenCV_DIR is a CMake cache entry. Please, re-read my previous comment, it explains how to set this entry.

– Tsyvarev
Mar 28 at 11:40




1




1





As you build the project directly from Visual Studio, you don't need to use CMake GUI instead - Visual Studio already provides needed user interface. You may find CMake cache entries in menu CMake / Cache / View CMakeCache.

– Tsyvarev
Mar 28 at 12:30





As you build the project directly from Visual Studio, you don't need to use CMake GUI instead - Visual Studio already provides needed user interface. You may find CMake cache entries in menu CMake / Cache / View CMakeCache.

– Tsyvarev
Mar 28 at 12:30




1




1





OpenCV_DIR should contain directory, not a file. Also, as it is CMake variable, it should use "generic" path separator, not a one used by Windows itself. Assign C:/Users/Majid/Desktop/imgwarp-opencv/imgwarp-opencv/src/opencv/build to that variable.

– Tsyvarev
Mar 28 at 13:32





OpenCV_DIR should contain directory, not a file. Also, as it is CMake variable, it should use "generic" path separator, not a one used by Windows itself. Assign C:/Users/Majid/Desktop/imgwarp-opencv/imgwarp-opencv/src/opencv/build to that variable.

– Tsyvarev
Mar 28 at 13:32




1




1





Yes, install QT.

– Tsyvarev
Mar 28 at 15:12





Yes, install QT.

– Tsyvarev
Mar 28 at 15:12












0






active

oldest

votes










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55387701%2fcmake-error-at-c-users-desktop-imgwarp-opencv-imgwarp-opencv-src-cmakelists%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes




Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.







Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55387701%2fcmake-error-at-c-users-desktop-imgwarp-opencv-imgwarp-opencv-src-cmakelists%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript