CanvasCV: A c++ cmake using the installation
CanvasCV  1.0.0
A c++ cmake using the installation

Common cmake

The tutorials in this documentation were built on Linux and Window with this CMakeLists.txt file:

(assuming a sub directory named tutorials with a target per cpp file)

1 cmake_minimum_required(VERSION 3.0.2)
2 
3 project (canvascv-tutorials)
4 
5 find_package(OpenCV 3.1.0 REQUIRED)
6 
7 set(CMAKE_CXX_STANDARD_REQUIRED ON)
8 set(CMAKE_CXX_STANDARD 11)
9 
10 # add include directories to the project
11 include_directories(
12  ${PROJECT_SOURCE_DIR}/tutorials
13  ${OpenCV_INCLUDE_DIRS}
14 )
15 
16 file(GLOB_RECURSE TUTORIAL_SRCS
17  "tutorials/*.cpp"
18 )
19 
20 if(WIN32)
21  find_library(CanvasCV_LIB canvascv "C:/Program Files/canvascv 1.0.0/lib")
22  include_directories("C:/Program Files/canvascv 1.0.0/include")
23 else()
24  find_library(CanvasCV_LIB canvascv "/usr/local/lib")
25  include_directories(/usr/local/include)
26 endif()
27 
28 message ("Building these tutorials:")
29 foreach ( file ${TUTORIAL_SRCS} )
30  get_filename_component( target_name ${file} NAME_WE )
31  message ( "Example '${target_name}' will be created")
32  add_executable(${target_name} ${file})
33  target_link_libraries (${target_name} ${CanvasCV_LIB} ${OpenCV_LIBS})
34 endforeach()


Linux command line

cd projectDir
mkdir build
cd build
cmake ..
make
ls


Windows command line

This should be done from a Developer Command Prompt for VS2015 (Open it from the Start menu):

cd projectDir
mkdir build
cd build
cmake -G "Visual Studio 14 2015 Win64" ..

Now depending if you're linking with a Debug or Release version (usually Release):

msbuild ALL_BUILD.vcxproj /p:Configuration=Release
dir Release\*.exe

OR

msbuild ALL_BUILD.vcxproj /p:Configuration=Debug
dir Debug\*.exe