Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9019775
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T04:51:28+00:00 2026-06-16T04:51:28+00:00

I consider this a fundamental step for creating projects that use OpenCV libraries so

  • 0

I consider this a fundamental step for creating projects that use OpenCV libraries so you don’t need to manually include all the libraries. There is not detailed information on this topic, at least for a newbie that just wants to use OpenCV as soon as posible, so:

Which is the easiest and scalable way to create a multiplatform c++ OpenCV with Cmake?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T04:51:29+00:00Added an answer on June 16, 2026 at 4:51 am

    First: create a folder Project containing two subfolders src and include, and a file called CMakeLists.txt.

    Second: Put your cpp inside the src folder and your headers in the include folders.

    Third: Your CMakeLists.txt should look like this:

    cmake_minimum_required(VERSION 2.8) 
    PROJECT (name)
    find_package(OpenCV REQUIRED )
    set( NAME_SRC
        src/main.cpp    
    )
    
    set( NAME_HEADERS
        include/header.h
    )
    
    INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}/include )
    link_directories( ${CMAKE_BINARY_DIR}/bin)
    set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
    add_executable( name ${NAME_SRC} ${NAME_HEADERS} )
    
    target_link_libraries( sample_pcTest ${OpenCV_LIBS} )
    

    Fourth: Open CMake GUI and select the root folder as input and create a build folder for the output. Click configure, then generate, and choose the generator (VisualStudio, Eclipse, …)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider this small program: #include <stdio.h> #include <stdlib.h> // Change 60000 to 70000 and
Ok this looks like a major fundamental bug in .NET: Consider the following simple
Consider this condition that exists in a template that is called recursively: <xsl:if test=$i
consider this simple and pointless code. #include <iostream> struct A { template<int N> void
Consider this simple controller: Porduct product = new Product(){ // Creating a product object;
Consider this example - I have a class called Report that has a field
Consider this folder structure in repository Root |----Plugins |----|-----Plugin1 |----Themes |-----|----Theme1 I have all
Consider this scenario. We have an internal Rails 2 app that connects to a
Consider this scenario that two WCF clients connect to one WCF service(server), this service
Consider this use case scenario: I wish to auto complete and provide the skeleton

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.