Skip to content

Instantly share code, notes, and snippets.

@ollewelin
Created September 14, 2016 04:37
Show Gist options
  • Save ollewelin/051242b10d1927c59256bc88aed1cd2a to your computer and use it in GitHub Desktop.
Save ollewelin/051242b10d1927c59256bc88aed1cd2a to your computer and use it in GitHub Desktop.
#File CMakeLists.txt
#type
#sudo cmake ./CMakeLists.txt
#in /home/pi/OlleOpenCV2_3 foleder to make a makefile
#type then
#sudo make
#to compile
#####################################
cmake_minimum_required (VERSION 2.8)
project (raspicam_test)
set(CMAKE_MODULE_PATH "/usr/local/lib/cmake/${CMAKE_MODULE_PATH}")
find_package(raspicam REQUIRED)
find_package(OpenCV)
IF ( OpenCV_FOUND AND raspicam_CV_FOUND)
MESSAGE(STATUS "COMPILING OPENCV TESTS")
SET_SOURCE_FILES_PROPERTIES( gpio_test.c PROPERTIES LANGUAGE CXX )#This was neccesary to combine .c files with .cpp files otherwise there mess up the link
include_directories( "/home/pi/OlleOpenCV2_3")
set(SOURCES simpletest_raspicam_cv.cpp gpio_test.c)
add_executable (simpletest_raspicam_cv ${SOURCES})
target_link_libraries (simpletest_raspicam_cv ${raspicam_CV_LIBS} bcm2835 ${/usr/local/include} rt ${/usr/local/include})
ELSE()
MESSAGE(FATAL_ERROR "OPENCV NOT FOUND IN YOUR SYSTEM")
ENDIF()
#####################################
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment