Commit 8675dbd5 authored by Zhiping Jiang (蒋志平)'s avatar Zhiping Jiang (蒋志平) 💬

Standardize the Cmake process. It is now a pure C++ library project.

parent f05aabff
CoreOpenCVExtensions.xcodeproj
build/
\ No newline at end of file
FILE(GLOB ARUCO_SOURCES
OpenCV_ARUCO/*.h OpenCV_ARUCO/*.hpp OpenCV_ARUCO/*.cpp)
ADD_LIBRARY(OpenCV_ARUCO ${LIB_TYPE} ${ARUCO_SOURCES})
TARGET_LINK_LIBRARIES(OpenCV_ARUCO ${OpenCV_LIBS})
IF (WIN32)
SET(ScreenCameraInfo_Source CoreOpenCVExtensions/os_dependent/ScreenCameraInfo_Win.cpp)
ELSEIF (APPLE)
SET(ScreenCameraInfo_Source CoreOpenCVExtensions/os_dependent/ScreenCameraInfo_Mac.cpp)
ENDIF ()
FILE(GLOB CoreOpenCVExtensions_SOURCES
CoreOpenCVExtensions/*.h CoreOpenCVExtensions/*.cpp ${ScreenCameraInfo_Source})
ADD_LIBRARY(CoreOpenCVExtensions ${LIB_TYPE} ${CoreOpenCVExtensions_SOURCES})
TARGET_LINK_LIBRARIES(CoreOpenCVExtensions ${OpenCV_LIBS})
\ No newline at end of file
cmake_minimum_required(VERSION 3.5)
PROJECT(CoreOpenCVExtensions)
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
set (CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_FLAGS_DEBUG "-g")
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
find_package(OpenCV REQUIRED)
add_subdirectory(CoreOpenCVExtensions)
add_subdirectory(OPENCV_ARUCO)
\ No newline at end of file
This diff is collapsed.
IF (WIN32)
SET(ScreenCameraInfo_Source os_dependent/ScreenCameraInfo_Win.cpp)
ELSEIF (APPLE)
SET(ScreenCameraInfo_Source os_dependent/ScreenCameraInfo_Mac.cpp)
ENDIF ()
FILE(GLOB CoreOpenCVExtensions_SOURCES
*.* ${ScreenCameraInfo_Source})
ADD_LIBRARY(CoreOpenCVExtensions SHARED ${CoreOpenCVExtensions_SOURCES})
TARGET_LINK_LIBRARIES(CoreOpenCVExtensions ${OpenCV_LIBS})
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2016 JiangZhping. All rights reserved.</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>
#pragma once
#include <vector>
#include <CoreOpenCVExtensions/CoreOpenCVExtensions.h>
#include <opencv2/opencv.hpp>
class KalmanFilter
{
......
//
// MatxGeometry.cpp
// CoreOpenCVExtensions
//
// Created by JiangZhping on 2017/1/18.
// Copyright © 2017年 JiangZhping. All rights reserved.
//
#include "MatxGeometry.h"
//
// OpencvMatxExtensions.cpp
// CoreOpenCVExtensions
//
// Created by JiangZhping on 2017/1/7.
// Copyright © 2017年 JiangZhping. All rights reserved.
//
#include "OpencvMatxExtensions.h"
//
// CoreOpenCVExtensionsTests.m
// CoreOpenCVExtensionsTests
//
// Created by JiangZhping on 2017/1/31.
// Copyright © 2017年 JiangZhping. All rights reserved.
//
#import <XCTest/XCTest.h>
#import <CoreOpenCVExtensions/CoreOpenCVExtensions.h>
@interface CoreOpenCVExtensionsTests : XCTestCase
@end
@implementation CoreOpenCVExtensionsTests
- (void)setUp {
[super setUp];
// Put setup code here. This method is called before the invocation of each test method in the class.
}
- (void)tearDown {
// Put teardown code here. This method is called after the invocation of each test method in the class.
[super tearDown];
}
- (void)testPreferenceManagerPersistence {
// This is an example of a functional test case.
// Use XCTAssert and related functions to verify your tests produce the correct results.
debugcout(PreferenceManagerSingleton::getInstance().getInternalDataString());
// PreferenceManager::getInstance().persist("dMat", cv::Mat(cv::Matx33d::eye()));
// debugcout(PreferenceManager::getInstance().internalDataString);
// PreferenceManager::getInstance().persist("cMat", cv::Mat(cv::Matx33d::eye()));
// debugcout(PreferenceManager::getInstance().internalDataString);
// PreferenceManager::getInstance().persist("cMat", cv::Mat(cv::Matx33d::eye() * 5));
// debugcout(PreferenceManager::getInstance().internalDataString);
// PreferenceManager::getInstance().flushToDisk();
}
- (void) testExecCommand {
std::string result = crossPlatform_exec("ls");
std::cout<<"result"<<result<<std::endl;
}
- (void) testPreferenceManagerQueue {
PreferenceManagerSingleton::getInstance().persist("aFloatValue", 5.5f);
float aFloatValue = PreferenceManagerSingleton::getInstance().queueFor<float>("aFloatValue");
XCTAssertEqual(aFloatValue, 5.5f);
PreferenceManagerSingleton::getInstance().persist("aRect", cv::Rect2f(0.5, 0.5, 123, 123));
cv::Rect2f aRectValue = PreferenceManagerSingleton::getInstance().queueFor<cv::Rect2f>("aRect");
XCTAssertEqual(aRectValue.tl(), cv::Point2f(0.5, 0.5));
cv::Rect2f bRectValue = PreferenceManagerSingleton::getInstance().queueFor("bRect", cv::Rect2f(0.7, 0.5, 123, 123));
XCTAssertEqual(bRectValue.tl(), cv::Point2f(0.7, 0.5));
// cv::Rect2f cRectValue = PreferenceManager::getInstance().queueFor<cv::Rect2f>("cRect");
debugcout(PreferenceManagerSingleton::getInstance().getInternalDataString());
}
@end
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>
......@@ -2,7 +2,7 @@
#ifndef ArucoMarkerLocator_h
#define ArucoMarkerLocator_h
#include <CoreOpenCVExtensions/CoreOpenCVExtensions.h>
#include "../CoreOpenCVExtensions/OpencvMatxExtensions.h"
#include "aruco.hpp"
using namespace std;
......
FILE(GLOB ARUCO_SOURCES *.*)
ADD_LIBRARY(OpenCV_ARUCO SHARED ${ARUCO_SOURCES})
TARGET_LINK_LIBRARIES(OpenCV_ARUCO ${OpenCV_LIBS})
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2016 JiangZhping. All rights reserved.</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>
//
// PrefixHeader.pch
// GazeEstimationOnCocoa
//
// Created by JiangZhiping on 15/11/4.
// Copyright © 2015年 JiangZhiping. All rights reserved.
//
#ifdef __cplusplus
#import <opencv2/opencv.hpp>
#endif
// Include any system framework and library headers here that should be included in all compilation units.
// You will also need to set the Prefix Header build setting of one or more of your targets to reference this file.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment