Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Currently Snapcraft adds only a few standard paths to LD_LIBRARY_PATH. This commit expands that to include paths used by mesa packages. Also add an opencv example to exercise this. Signed-off-by: Kyle Fazzari <kyle@canonical.com>
- Loading branch information
Showing
6 changed files
with
189 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: opencv-example | ||
version: 1.0 | ||
summary: Use OpenCV and OpenGL | ||
description: A simple OpenCV example | ||
|
||
binaries: | ||
example: | ||
exec: bin/example | ||
|
||
parts: | ||
example: | ||
plugin: cmake | ||
source: src | ||
stage-packages: [libopencv-dev] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
cmake_minimum_required(VERSION 2.6) | ||
project(example) | ||
|
||
find_package(OpenCV REQUIRED) | ||
|
||
add_executable(example main.cpp) | ||
|
||
target_link_libraries(example ${OpenCV_LIBS}) | ||
|
||
install(TARGETS example RUNTIME DESTINATION bin) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#include <iostream> | ||
|
||
#include <opencv2/core/core.hpp> | ||
|
||
int main() | ||
{ | ||
cv::Mat matrix(2, 2, CV_8UC1); | ||
|
||
matrix.at<uint8_t>(cv::Point(0, 0)) = 1; | ||
matrix.at<uint8_t>(cv::Point(0, 1)) = 2; | ||
matrix.at<uint8_t>(cv::Point(1, 0)) = 3; | ||
matrix.at<uint8_t>(cv::Point(1, 1)) = 4; | ||
|
||
std::cout << matrix << std::endl; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters