From 893a39e65490b9e8c342064f4faabb8a09536f08 Mon Sep 17 00:00:00 2001 From: Ashley Gillman Date: Fri, 21 Aug 2015 11:02:05 +1000 Subject: [PATCH] Fix #30, Apple is Unix, so check for Apple first In the examples CMakeLists.txt, explicit setting CV libs caused compilation errors on OS X. --- examples/CMakeLists.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 7e93091..e221f76 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -6,23 +6,23 @@ find_package( OpenCV REQUIRED ) include_directories(${OPENCV_INCLUDE_DIR}) if (${OpenCV_VERSION_MINOR} LESS 3) - if (UNIX) + if (APPLE) + elseif (UNIX) set(CV_LIBS_1 highgui) set(CV_LIBS_2 cxcore cv cvaux) elseif (WIN32) set(CV_LIBS_1 highgui${OpenCV_VERSION_MAJOR}${OpenCV_VERSION_MINOR}${OpenCV_VERSION_PATCH}) set(CV_LIBS_2 cxcore${OpenCV_VERSION_MAJOR}${OpenCV_VERSION_MINOR}${OpenCV_VERSION_PATCH} cv${OpenCV_VERSION_MAJOR}${OpenCV_VERSION_MINOR}${OpenCV_VERSION_PATCH} cvaux${OpenCV_VERSION_MAJOR}${OpenCV_VERSION_MINOR}${OpenCV_VERSION_PATCH}) - elseif (APPLE) - endif (UNIX) + endif (APPLE) else(${OpenCV_VERSION_MINOR} LESS 3) - if (UNIX) + if (APPLE) + elseif (UNIX) set(CV_LIBS_1 opencv_highgui) set(CV_LIBS_2 opencv_core opencv_objdetect) elseif (WIN32) set(CV_LIBS_1 opencv_highgui${OpenCV_VERSION_MAJOR}${OpenCV_VERSION_MINOR}${OpenCV_VERSION_PATCH}) set(CV_LIBS_2 opencv_core${OpenCV_VERSION_MAJOR}${OpenCV_VERSION_MINOR}${OpenCV_VERSION_PATCH} opencv_objdetect${OpenCV_VERSION_MAJOR}${OpenCV_VERSION_MINOR}${OpenCV_VERSION_PATCH}) - elseif (APPLE) - endif (UNIX) + endif (APPLE) endif(${OpenCV_VERSION_MINOR} LESS 3) set(${PROJECT_NAME}_simple_example_srcs simple_example.cpp)