From d0bbef9432bbea59792310b6f0db0aae83cfdd99 Mon Sep 17 00:00:00 2001 From: Walter Perdan Date: Fri, 21 Jul 2023 15:44:49 +0200 Subject: [PATCH 01/29] testing cmake configuration --- .gitignore | 3 ++- WebARKit/CMakeLists.txt | 51 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 WebARKit/CMakeLists.txt diff --git a/.gitignore b/.gitignore index e06027a..b6fc9cf 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ include/AR/config.h -tests/build \ No newline at end of file +tests/build +build \ No newline at end of file diff --git a/WebARKit/CMakeLists.txt b/WebARKit/CMakeLists.txt new file mode 100644 index 0000000..75dbd04 --- /dev/null +++ b/WebARKit/CMakeLists.txt @@ -0,0 +1,51 @@ +cmake_minimum_required(VERSION 3.20) + +project(WebARKitLib) + +set(CMAKE_CXX_STANDARD 14) + +message(STATUS "CMAKE_CURRENT_LIST_DIR: ${CMAKE_CURRENT_LIST_DIR}") +message(STATUS "CMAKE_CURRENT_SOURCE_DIR: ${CMAKE_CURRENT_SOURCE_DIR}") + +get_filename_component(PARENT_DIR ./ ABSOLUTE) +get_filename_component(OPENCV_DIR ../../../opencv/ ABSOLUTE) +get_filename_component(OPENCV_JS_DIR ../../../opencv_js/ ABSOLUTE) +get_filename_component(OPENCV_CONTRIB_DIR ../../../opencv_contrib/ ABSOLUTE) + + +set(WEBARKIT_HEADERS +${PARENT_DIR}/WebARKitTrackers/WebARKitOpticalTracking/include/WebARKitTrackers/WebARKitOpticalTracking/WebARKitConfig.h +${PARENT_DIR}/WebARKitTrackers/WebARKitOpticalTracking/include/WebARKitTrackers/WebARKitOpticalTracking//WebARKitEnums.h +${PARENT_DIR}/WebARKitTrackers/WebARKitOpticalTracking/include/WebARKitTrackers/WebARKitOpticalTracking/WebARKitTracker.h +${PARENT_DIR}/WebARKitTrackers/WebARKitOpticalTracking/include/WebARKitTrackers/WebARKitOpticalTracking/WebARKitUtils.h +${PARENT_DIR}/include/WebARKitLog.h +${PARENT_DIR}/include/WebARKitManager.h +) + +set(SOURCE +${PARENT_DIR}/WebARKitTrackers/WebARKitOpticalTracking/WebARKitConfig.cpp +${PARENT_DIR}/WebARKitTrackers/WebARKitOpticalTracking/WebARKitTracker.cpp +${PARENT_DIR}/WebARKitLog.cpp +${PARENT_DIR}/WebARKitManager.cpp +) + +add_library( + WebARKitLib STATIC + ${WEBARKIT_HEADERS} + ${SOURCE} +) + +target_include_directories(WebARKitLib PRIVATE "${PARENT_DIR}/include") +target_include_directories(WebARKitLib PRIVATE "${PARENT_DIR}/WebARKitTrackers/WebARKitOpticalTracking/include") +target_include_directories(WebARKitLib PRIVATE "${OPENCV_CONTRIB_DIR}/modules/xfeatures2d/include") +target_include_directories(WebARKitLib PRIVATE "${OPENCV_JS_DIR}") +target_include_directories(WebARKitLib PRIVATE "${OPENCV_DIR}/include") +target_include_directories(WebARKitLib PRIVATE "${OPENCV_DIR}/modules/calib3d/include") +target_include_directories(WebARKitLib PRIVATE "${OPENCV_DIR}/modules/core/include") +target_include_directories(WebARKitLib PRIVATE "${OPENCV_DIR}/modules/features2d/include") +target_include_directories(WebARKitLib PRIVATE "${OPENCV_DIR}/modules/flann/include") +target_include_directories(WebARKitLib PRIVATE "${OPENCV_DIR}/modules/imgproc/include") +target_include_directories(WebARKitLib PRIVATE "${OPENCV_DIR}/modules/imgcodecs/include") +target_include_directories(WebARKitLib PRIVATE "${OPENCV_DIR}/modules/video/include") + +target_link_libraries(WebARKitLib "${OPENCV_JS_DIR}/lib/*.a") \ No newline at end of file From a6a7cd0e01620e1f847dbf218366228fc73fe6a6 Mon Sep 17 00:00:00 2001 From: Walter Perdan Date: Tue, 25 Jul 2023 21:02:37 +0200 Subject: [PATCH 02/29] trying to compile opencv with fetchContent - build only shared libs --- WebARKit/CMakeLists.txt | 53 +++++++++++++++++++++++++++++++++-------- 1 file changed, 43 insertions(+), 10 deletions(-) diff --git a/WebARKit/CMakeLists.txt b/WebARKit/CMakeLists.txt index 75dbd04..074e189 100644 --- a/WebARKit/CMakeLists.txt +++ b/WebARKit/CMakeLists.txt @@ -7,6 +7,21 @@ set(CMAKE_CXX_STANDARD 14) message(STATUS "CMAKE_CURRENT_LIST_DIR: ${CMAKE_CURRENT_LIST_DIR}") message(STATUS "CMAKE_CURRENT_SOURCE_DIR: ${CMAKE_CURRENT_SOURCE_DIR}") +include(FetchContent) + +FetchContent_Declare( + opencv + GIT_REPOSITORY https://github.com/webarkit/opencv.git + GIT_TAG 889dfa15f1cd60e571d33b23b87a1d506d381ea9 + GIT_SHALLOW TRUE + GIT_PROGRESS TRUE +) + +set(BUILD_SHARED_LIBS OFF CACHE BOOL "" INTERNAL) +message("BUILD_SHARED_LIBS: ${BUILD_SHARED_LIBS}") + +FetchContent_MakeAvailable(opencv) + get_filename_component(PARENT_DIR ./ ABSOLUTE) get_filename_component(OPENCV_DIR ../../../opencv/ ABSOLUTE) get_filename_component(OPENCV_JS_DIR ../../../opencv_js/ ABSOLUTE) @@ -39,13 +54,31 @@ target_include_directories(WebARKitLib PRIVATE "${PARENT_DIR}/include") target_include_directories(WebARKitLib PRIVATE "${PARENT_DIR}/WebARKitTrackers/WebARKitOpticalTracking/include") target_include_directories(WebARKitLib PRIVATE "${OPENCV_CONTRIB_DIR}/modules/xfeatures2d/include") target_include_directories(WebARKitLib PRIVATE "${OPENCV_JS_DIR}") -target_include_directories(WebARKitLib PRIVATE "${OPENCV_DIR}/include") -target_include_directories(WebARKitLib PRIVATE "${OPENCV_DIR}/modules/calib3d/include") -target_include_directories(WebARKitLib PRIVATE "${OPENCV_DIR}/modules/core/include") -target_include_directories(WebARKitLib PRIVATE "${OPENCV_DIR}/modules/features2d/include") -target_include_directories(WebARKitLib PRIVATE "${OPENCV_DIR}/modules/flann/include") -target_include_directories(WebARKitLib PRIVATE "${OPENCV_DIR}/modules/imgproc/include") -target_include_directories(WebARKitLib PRIVATE "${OPENCV_DIR}/modules/imgcodecs/include") -target_include_directories(WebARKitLib PRIVATE "${OPENCV_DIR}/modules/video/include") - -target_link_libraries(WebARKitLib "${OPENCV_JS_DIR}/lib/*.a") \ No newline at end of file + +message(STATUS "OPENCV_CONFIG_FILE_INCLUDE_DIR: ${OPENCV_CONFIG_FILE_INCLUDE_DIR}") +message(STATUS "OPENCV_INCLUDE_DIR: ${OPENCV_INCLUDE_DIR}") + +target_include_directories(WebARKitLib PRIVATE + ${OPENCV_CONFIG_FILE_INCLUDE_DIR} + ${OPENCV_INCLUDE_DIR} + ${OPENCV_MODULE_opencv_calib3d_LOCATION}/include + ${OPENCV_MODULE_opencv_core_LOCATION}/include + ${OPENCV_MODULE_opencv_features2d_LOCATION}/include + ${OPENCV_MODULE_opencv_flann_LOCATION}/include + ${OPENCV_MODULE_opencv_imgproc_LOCATION}/include + ${OPENCV_MODULE_opencv_imgcodecs_LOCATION}/include + ${OPENCV_MODULE_opencv_video_LOCATION}/include + ) + +#target_include_directories(WebARKitLib PRIVATE "${OPENCV_DIR}/include") +#target_include_directories(WebARKitLib PRIVATE "${OPENCV_DIR}/modules/calib3d/include") +#target_include_directories(WebARKitLib PRIVATE "${OPENCV_DIR}/modules/core/include") +#target_include_directories(WebARKitLib PRIVATE "${OPENCV_DIR}/modules/features2d/include") +#target_include_directories(WebARKitLib PRIVATE "${OPENCV_DIR}/modules/flann/include") +#target_include_directories(WebARKitLib PRIVATE "${OPENCV_DIR}/modules/imgproc/include") +#target_include_directories(WebARKitLib PRIVATE "${OPENCV_DIR}/modules/imgcodecs/include") +#target_include_directories(WebARKitLib PRIVATE "${OPENCV_DIR}/modules/video/include") + +target_link_libraries(WebARKitLib STATIC opencv_calib3d opencv_core opencv_features2d opencv_flann opencv_imgproc opencv_imgcodecs opencv_video) + +#target_link_libraries(WebARKitLib "${OPENCV_JS_DIR}/lib/*.a") \ No newline at end of file From 442712d407ea25447993d941274509e20408db0f Mon Sep 17 00:00:00 2001 From: Walter Perdan Date: Thu, 27 Jul 2023 16:41:08 +0200 Subject: [PATCH 03/29] succesful compilation of opencv with FetchContent - avoid including all opencv stuff --- WebARKit/CMakeLists.txt | 35 ++++++++----------- .../WebARKitOpticalTracking/WebARKitConfig.h | 2 +- 2 files changed, 15 insertions(+), 22 deletions(-) diff --git a/WebARKit/CMakeLists.txt b/WebARKit/CMakeLists.txt index 074e189..c446200 100644 --- a/WebARKit/CMakeLists.txt +++ b/WebARKit/CMakeLists.txt @@ -4,11 +4,21 @@ project(WebARKitLib) set(CMAKE_CXX_STANDARD 14) -message(STATUS "CMAKE_CURRENT_LIST_DIR: ${CMAKE_CURRENT_LIST_DIR}") -message(STATUS "CMAKE_CURRENT_SOURCE_DIR: ${CMAKE_CURRENT_SOURCE_DIR}") - include(FetchContent) +set(BUILD_SHARED_LIBS OFF) +set(BUILD_opencv_dnn OFF) +set(BUILD_opencv_highgui OFF) +set(BUILD_opencv_ml OFF) +set(BUILD_opencv_objdetect OFF) +set(BUILD_opencv_gapi OFF) +set(BUILD_opencv_photo OFF) +set(BUILD_opencv_stitching OFF) +set(BUILD_opencv_ts OFF) +set(BUILD_opencv_videoio OFF) +set(BUILD_opencv_python2 OFF) +set(BUILD_opencv_python3 OFF) + FetchContent_Declare( opencv GIT_REPOSITORY https://github.com/webarkit/opencv.git @@ -17,9 +27,6 @@ FetchContent_Declare( GIT_PROGRESS TRUE ) -set(BUILD_SHARED_LIBS OFF CACHE BOOL "" INTERNAL) -message("BUILD_SHARED_LIBS: ${BUILD_SHARED_LIBS}") - FetchContent_MakeAvailable(opencv) get_filename_component(PARENT_DIR ./ ABSOLUTE) @@ -55,9 +62,6 @@ target_include_directories(WebARKitLib PRIVATE "${PARENT_DIR}/WebARKitTrackers/W target_include_directories(WebARKitLib PRIVATE "${OPENCV_CONTRIB_DIR}/modules/xfeatures2d/include") target_include_directories(WebARKitLib PRIVATE "${OPENCV_JS_DIR}") -message(STATUS "OPENCV_CONFIG_FILE_INCLUDE_DIR: ${OPENCV_CONFIG_FILE_INCLUDE_DIR}") -message(STATUS "OPENCV_INCLUDE_DIR: ${OPENCV_INCLUDE_DIR}") - target_include_directories(WebARKitLib PRIVATE ${OPENCV_CONFIG_FILE_INCLUDE_DIR} ${OPENCV_INCLUDE_DIR} @@ -70,15 +74,4 @@ target_include_directories(WebARKitLib PRIVATE ${OPENCV_MODULE_opencv_video_LOCATION}/include ) -#target_include_directories(WebARKitLib PRIVATE "${OPENCV_DIR}/include") -#target_include_directories(WebARKitLib PRIVATE "${OPENCV_DIR}/modules/calib3d/include") -#target_include_directories(WebARKitLib PRIVATE "${OPENCV_DIR}/modules/core/include") -#target_include_directories(WebARKitLib PRIVATE "${OPENCV_DIR}/modules/features2d/include") -#target_include_directories(WebARKitLib PRIVATE "${OPENCV_DIR}/modules/flann/include") -#target_include_directories(WebARKitLib PRIVATE "${OPENCV_DIR}/modules/imgproc/include") -#target_include_directories(WebARKitLib PRIVATE "${OPENCV_DIR}/modules/imgcodecs/include") -#target_include_directories(WebARKitLib PRIVATE "${OPENCV_DIR}/modules/video/include") - -target_link_libraries(WebARKitLib STATIC opencv_calib3d opencv_core opencv_features2d opencv_flann opencv_imgproc opencv_imgcodecs opencv_video) - -#target_link_libraries(WebARKitLib "${OPENCV_JS_DIR}/lib/*.a") \ No newline at end of file +target_link_libraries(WebARKitLib STATIC opencv_calib3d opencv_core opencv_features2d opencv_flann opencv_imgproc opencv_imgcodecs opencv_video) \ No newline at end of file diff --git a/WebARKit/WebARKitTrackers/WebARKitOpticalTracking/include/WebARKitTrackers/WebARKitOpticalTracking/WebARKitConfig.h b/WebARKit/WebARKitTrackers/WebARKitOpticalTracking/include/WebARKitTrackers/WebARKitOpticalTracking/WebARKitConfig.h index aee6b79..dacfe6a 100644 --- a/WebARKit/WebARKitTrackers/WebARKitOpticalTracking/include/WebARKitTrackers/WebARKitOpticalTracking/WebARKitConfig.h +++ b/WebARKit/WebARKitTrackers/WebARKitOpticalTracking/include/WebARKitTrackers/WebARKitOpticalTracking/WebARKitConfig.h @@ -6,7 +6,7 @@ #include #include #include -#include +#include extern const double DEFAULT_NN_MATCH_RATIO; extern const double TEBLID_NN_MATCH_RATIO; From 8fb3abbc7bdd881f4b7489c25e9b69dc86ce6dae Mon Sep 17 00:00:00 2001 From: Walter Perdan Date: Fri, 28 Jul 2023 16:29:44 +0200 Subject: [PATCH 04/29] build opencv_contrib also with FetchContent --- WebARKit/CMakeLists.txt | 46 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 43 insertions(+), 3 deletions(-) diff --git a/WebARKit/CMakeLists.txt b/WebARKit/CMakeLists.txt index c446200..edb5d40 100644 --- a/WebARKit/CMakeLists.txt +++ b/WebARKit/CMakeLists.txt @@ -19,6 +19,38 @@ set(BUILD_opencv_videoio OFF) set(BUILD_opencv_python2 OFF) set(BUILD_opencv_python3 OFF) +set(BUILD_opencv_dnn_plugins OFF) +set(BUILD_opencv_highgui_plugins OFF) +set(BUILD_opencv_videoio_plugins OFF) +set(BUILD_opencv_intensity_transform OFF) +set(BUILD_opencv_phase_unwrapping OFF) +set(BUILD_opencv_plot OFF) +set(BUILD_opencv_reg OFF) +set(BUILD_opencv_surface_matching OFF) +set(BUILD_opencv_bioinspired OFF) +set(BUILD_opencv_fuzzy OFF) +set(BUILD_opencv_hfs OFF) +set(BUILD_opencv_img_hash OFF) +set(BUILD_opencv_line_descriptor OFF) +set(BUILD_opencv_saliency OFF) +set(BUILD_opencv_rapid OFF) +set(BUILD_opencv_rgbd OFF) +set(BUILD_opencv_shape OFF) +set(BUILD_opencv_rapid OFF) +set(BUILD_opencv_structured_light OFF) + +set(BUILD_opencv_xfeatures2d ON) + +set(BUILD_opencv_ximgproc OFF) +set(BUILD_opencv_bgsegm OFF) +set(BUILD_opencv_optflow OFF) +set(BUILD_opencv_opencv_superres OFF) +set(BUILD_opencv_tracking OFF) +set(BUILD_opencv_stereo OFF) +set(BUILD_opencv_version OFF) + +set(OPENCV_EXTRA_MODULES_PATH ../opencv_contrib-src/modules/) + FetchContent_Declare( opencv GIT_REPOSITORY https://github.com/webarkit/opencv.git @@ -27,7 +59,15 @@ FetchContent_Declare( GIT_PROGRESS TRUE ) -FetchContent_MakeAvailable(opencv) +FetchContent_Declare( + opencv_contrib + GIT_REPOSITORY https://github.com/webarkit/opencv_contrib.git + GIT_TAG 5438f53d81e1c1137258e18308ebf3f4daa2f2ff + GIT_SHALLOW TRUE + GIT_PROGRESS TRUE +) + +FetchContent_MakeAvailable(opencv opencv_contrib) get_filename_component(PARENT_DIR ./ ABSOLUTE) get_filename_component(OPENCV_DIR ../../../opencv/ ABSOLUTE) @@ -59,7 +99,6 @@ add_library( target_include_directories(WebARKitLib PRIVATE "${PARENT_DIR}/include") target_include_directories(WebARKitLib PRIVATE "${PARENT_DIR}/WebARKitTrackers/WebARKitOpticalTracking/include") -target_include_directories(WebARKitLib PRIVATE "${OPENCV_CONTRIB_DIR}/modules/xfeatures2d/include") target_include_directories(WebARKitLib PRIVATE "${OPENCV_JS_DIR}") target_include_directories(WebARKitLib PRIVATE @@ -72,6 +111,7 @@ target_include_directories(WebARKitLib PRIVATE ${OPENCV_MODULE_opencv_imgproc_LOCATION}/include ${OPENCV_MODULE_opencv_imgcodecs_LOCATION}/include ${OPENCV_MODULE_opencv_video_LOCATION}/include + ${OPENCV_MODULE_opencv_xfeatures2d_LOCATION}/include ) -target_link_libraries(WebARKitLib STATIC opencv_calib3d opencv_core opencv_features2d opencv_flann opencv_imgproc opencv_imgcodecs opencv_video) \ No newline at end of file +target_link_libraries(WebARKitLib STATIC opencv_calib3d opencv_core opencv_features2d opencv_flann opencv_imgproc opencv_imgcodecs opencv_video opencv_xfeatures2d) \ No newline at end of file From 72f75240c0249ec3cd2af5c38f4e1cffcc02f062 Mon Sep 17 00:00:00 2001 From: Walter Perdan Date: Sat, 29 Jul 2023 16:06:25 +0200 Subject: [PATCH 05/29] almost done for a first test --- tests/CMakeLists.txt | 34 ++++------------------------------ tests/hello_test.cc | 2 +- 2 files changed, 5 insertions(+), 31 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index cbdc3a0..d1647a7 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -16,6 +16,8 @@ FetchContent_MakeAvailable(googletest) enable_testing() +add_subdirectory(../WebARKit ../WebARKit/build) + add_executable( hello_test hello_test.cc @@ -42,41 +44,13 @@ target_include_directories(hello_test PRIVATE "${OPENCV_DIR}/modules/imgproc/inc target_include_directories(hello_test PRIVATE "${OPENCV_DIR}/modules/imgcodecs/include") target_include_directories(hello_test PRIVATE "${OPENCV_DIR}/modules/video/include") -set(WEBARKIT_HEADERS -${PARENT_DIR}/WebARKit/include/WebARKitManager.h) - -set(SOURCE +set(hello_test ${PARENT_DIR}/WebARKit/WebARKitManager.cpp ) -add_library( - WEBARKIT STATIC - ${WEBARKIT_HEADERS} - ${SOURCE} -) - -target_include_directories(WEBARKIT PRIVATE "${PARENT_DIR}/WebARKit/include") -target_include_directories(WEBARKIT PRIVATE "${PARENT_DIR}/WebARKit/WebARKitTrackers/WebARKitOpticalTracking/include") -target_include_directories(WEBARKIT PRIVATE "${OPENCV_CONTRIB_DIR}/modules/xfeatures2d/include") -target_include_directories(WEBARKIT PRIVATE "${OPENCV_JS_DIR}") -target_include_directories(WEBARKIT PRIVATE "${OPENCV_DIR}/include") -target_include_directories(WEBARKIT PRIVATE "${OPENCV_DIR}/modules/calib3d/include") -target_include_directories(WEBARKIT PRIVATE "${OPENCV_DIR}/modules/core/include") -target_include_directories(WEBARKIT PRIVATE "${OPENCV_DIR}/modules/features2d/include") -target_include_directories(WEBARKIT PRIVATE "${OPENCV_DIR}/modules/flann/include") -target_include_directories(WEBARKIT PRIVATE "${OPENCV_DIR}/modules/imgproc/include") -target_include_directories(WEBARKIT PRIVATE "${OPENCV_DIR}/modules/imgcodecs/include") -target_include_directories(WEBARKIT PRIVATE "${OPENCV_DIR}/modules/video/include") - - -target_link_libraries(WEBARKIT - INTERFACE -) - target_link_libraries( hello_test - ${WEBARKIT} - libWEBARKIT + WebARKitLib GTest::gtest_main ) diff --git a/tests/hello_test.cc b/tests/hello_test.cc index bc77ab1..506c07f 100644 --- a/tests/hello_test.cc +++ b/tests/hello_test.cc @@ -3,7 +3,7 @@ // Demonstrate some basic assertions. TEST(HelloTest, BasicAssertions) { - WebARKitManager manager; + webarkit::WebARKitManager manager; // Expect two strings not to be equal. EXPECT_STRNE("hello", "world"); // Expect equality. From d55003639dcadd46b7665736f3c1c962735f4bd5 Mon Sep 17 00:00:00 2001 From: Walter Perdan Date: Sun, 30 Jul 2023 22:51:11 +0200 Subject: [PATCH 06/29] now test starts but there is a bug to fix --- WebARKit/CMakeLists.txt | 2 +- tests/hello_test.cc | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/WebARKit/CMakeLists.txt b/WebARKit/CMakeLists.txt index edb5d40..eebe388 100644 --- a/WebARKit/CMakeLists.txt +++ b/WebARKit/CMakeLists.txt @@ -114,4 +114,4 @@ target_include_directories(WebARKitLib PRIVATE ${OPENCV_MODULE_opencv_xfeatures2d_LOCATION}/include ) -target_link_libraries(WebARKitLib STATIC opencv_calib3d opencv_core opencv_features2d opencv_flann opencv_imgproc opencv_imgcodecs opencv_video opencv_xfeatures2d) \ No newline at end of file +target_link_libraries(WebARKitLib opencv_calib3d opencv_core opencv_features2d opencv_flann opencv_imgproc opencv_imgcodecs opencv_video opencv_xfeatures2d) \ No newline at end of file diff --git a/tests/hello_test.cc b/tests/hello_test.cc index 506c07f..bd8a520 100644 --- a/tests/hello_test.cc +++ b/tests/hello_test.cc @@ -4,8 +4,11 @@ // Demonstrate some basic assertions. TEST(HelloTest, BasicAssertions) { webarkit::WebARKitManager manager; + manager.initialiseBase(webarkit::TRACKER_TYPE::AKAZE_TRACKER); // Expect two strings not to be equal. EXPECT_STRNE("hello", "world"); // Expect equality. EXPECT_EQ(7 * 6, 42); + + EXPECT_STREQ(manager.getWebARKitVersion(), "1.0.0"); } \ No newline at end of file From bf852cceca35ae70f208652cfc9b6a321a0abded Mon Sep 17 00:00:00 2001 From: Walter Perdan Date: Tue, 1 Aug 2023 16:11:14 +0200 Subject: [PATCH 07/29] solve destructor issue ad first working gtest! --- WebARKit/WebARKitManager.cpp | 23 +++++++++---------- .../WebARKitOpticalTracking/WebARKitUtils.h | 6 ++++- WebARKit/include/WebARKitManager.h | 6 ++--- tests/hello_test.cc | 14 ++++------- 4 files changed, 24 insertions(+), 25 deletions(-) diff --git a/WebARKit/WebARKitManager.cpp b/WebARKit/WebARKitManager.cpp index 0e3252e..25f77ad 100644 --- a/WebARKit/WebARKitManager.cpp +++ b/WebARKit/WebARKitManager.cpp @@ -2,18 +2,19 @@ namespace webarkit { -WebARKitManager::WebARKitManager() : state(NOTHING_INITIALISED), versionString(NULL) {} +WebARKitManager::WebARKitManager() : state(NOTHING_INITIALISED), versionString("?"), m_trackerType(webarkit::AKAZE_TRACKER) {} WebARKitManager::~WebARKitManager() { - if (versionString) { - free(versionString); - versionString = NULL; + if (!versionString.empty()) { + versionString.clear(); } } -const char* WebARKitManager::getWebARKitVersion() { - if (!versionString) - webarkit::webarkitGetVersion(&versionString); +std::string WebARKitManager::getWebARKitVersion() { + if (versionString.empty()) { + versionString = webarkitGetVersion(); + WEBARKIT_LOGi("Webarkit C++ lib version: %s.\n", versionString); + } return versionString; } @@ -26,14 +27,12 @@ bool WebARKitManager::initialiseBase(webarkit::TRACKER_TYPE trackerType) { } } - char* versionString = NULL; - webarkitGetVersion(&versionString); - WEBARKIT_LOGi("Webarkit C++ lib v%s initalised.\n", versionString); - free(versionString); + versionString = webarkitGetVersion(); + WEBARKIT_LOGi("Webarkit C++ lib v%s initalised.\n", versionString.c_str()); m_trackerType = trackerType; - m_tracker = std::shared_ptr(new webarkit::WebARKitTracker); + m_tracker = std::make_shared(); m_tracker->initialize(m_trackerType); state = BASE_INITIALISED; diff --git a/WebARKit/WebARKitTrackers/WebARKitOpticalTracking/include/WebARKitTrackers/WebARKitOpticalTracking/WebARKitUtils.h b/WebARKit/WebARKitTrackers/WebARKitOpticalTracking/include/WebARKitTrackers/WebARKitOpticalTracking/WebARKitUtils.h index 794b59c..f1bc956 100644 --- a/WebARKit/WebARKitTrackers/WebARKitOpticalTracking/include/WebARKitTrackers/WebARKitOpticalTracking/WebARKitUtils.h +++ b/WebARKit/WebARKitTrackers/WebARKitOpticalTracking/include/WebARKitTrackers/WebARKitOpticalTracking/WebARKitUtils.h @@ -60,11 +60,15 @@ static cv::Mat grayscale(uchar data[], size_t cols, size_t rows, ColorSpace colo return cv::Mat(cols, rows, CV_8UC1, gray.data()); } +std::string inline webarkitGetVersion() { + return WEBARKIT_HEADER_VERSION_STRING; +} + unsigned int inline webarkitGetVersion(char** versionStringRef) { std::string version = WEBARKIT_HEADER_VERSION_STRING; if (versionStringRef) { - *versionStringRef = (char*)version.data(); + *versionStringRef = const_cast(version.data()); } // Represent full version number (major, minor, tiny, build) in diff --git a/WebARKit/include/WebARKitManager.h b/WebARKit/include/WebARKitManager.h index 225b23b..72603b9 100644 --- a/WebARKit/include/WebARKitManager.h +++ b/WebARKit/include/WebARKitManager.h @@ -54,7 +54,7 @@ class WebARKitManager { } WebARKitState; WebARKitState state; ///< Current state of operation, progress through initialisation - char* versionString; + std::string versionString; std::shared_ptr m_tracker; webarkit::TRACKER_TYPE m_trackerType; @@ -71,9 +71,9 @@ class WebARKitManager { /** * Returns a string containing the WebARKit version, such as "1.0.0". - * @return The WebARKit version + * @return The WebARKit version as a std::string */ - const char* getWebARKitVersion(); + std::string getWebARKitVersion(); /** * Start trackable management so trackables can be added and removed. diff --git a/tests/hello_test.cc b/tests/hello_test.cc index bd8a520..eb1fcaa 100644 --- a/tests/hello_test.cc +++ b/tests/hello_test.cc @@ -1,14 +1,10 @@ #include #include -// Demonstrate some basic assertions. -TEST(HelloTest, BasicAssertions) { +// Check WebARKitManager initialisation. +TEST(InitTest, InitialiseBaseTest) { + // Create a WebARKitManager object webarkit::WebARKitManager manager; - manager.initialiseBase(webarkit::TRACKER_TYPE::AKAZE_TRACKER); - // Expect two strings not to be equal. - EXPECT_STRNE("hello", "world"); - // Expect equality. - EXPECT_EQ(7 * 6, 42); - - EXPECT_STREQ(manager.getWebARKitVersion(), "1.0.0"); + // Check if the WebARKitManager initialisation is successful + EXPECT_TRUE(manager.initialiseBase(webarkit::TRACKER_TYPE::AKAZE_TRACKER)); } \ No newline at end of file From 6a83f6749800e14d7e27b41e87cf734a13040e3e Mon Sep 17 00:00:00 2001 From: Walter Perdan Date: Tue, 1 Aug 2023 16:32:50 +0200 Subject: [PATCH 08/29] fix for target_include_directories --- tests/CMakeLists.txt | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index d1647a7..9d92b63 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -33,16 +33,18 @@ get_filename_component(OPENCV_CONTRIB_DIR ../../../opencv_contrib/ ABSOLUTE) target_include_directories(hello_test PRIVATE "${PARENT_DIR}/WebARKit/include") target_include_directories(hello_test PRIVATE "${PARENT_DIR}/WebARKit/WebARKitTrackers/WebARKitOpticalTracking/include") -target_include_directories(hello_test PRIVATE "${OPENCV_CONTRIB_DIR}/modules/xfeatures2d/include") -target_include_directories(hello_test PRIVATE "${OPENCV_JS_DIR}") -target_include_directories(hello_test PRIVATE "${OPENCV_DIR}/include") -target_include_directories(hello_test PRIVATE "${OPENCV_DIR}/modules/calib3d/include") -target_include_directories(hello_test PRIVATE "${OPENCV_DIR}/modules/core/include") -target_include_directories(hello_test PRIVATE "${OPENCV_DIR}/modules/features2d/include") -target_include_directories(hello_test PRIVATE "${OPENCV_DIR}/modules/flann/include") -target_include_directories(hello_test PRIVATE "${OPENCV_DIR}/modules/imgproc/include") -target_include_directories(hello_test PRIVATE "${OPENCV_DIR}/modules/imgcodecs/include") -target_include_directories(hello_test PRIVATE "${OPENCV_DIR}/modules/video/include") +target_include_directories(hello_test PRIVATE + ${OPENCV_CONFIG_FILE_INCLUDE_DIR} + ${OPENCV_INCLUDE_DIR} + ${OPENCV_MODULE_opencv_calib3d_LOCATION}/include + ${OPENCV_MODULE_opencv_core_LOCATION}/include + ${OPENCV_MODULE_opencv_features2d_LOCATION}/include + ${OPENCV_MODULE_opencv_flann_LOCATION}/include + ${OPENCV_MODULE_opencv_imgproc_LOCATION}/include + ${OPENCV_MODULE_opencv_imgcodecs_LOCATION}/include + ${OPENCV_MODULE_opencv_video_LOCATION}/include + ${OPENCV_MODULE_opencv_xfeatures2d_LOCATION}/include + ) set(hello_test ${PARENT_DIR}/WebARKit/WebARKitManager.cpp From 26dc73303222012b9161f6de18d6e6bf5d171ee3 Mon Sep 17 00:00:00 2001 From: Walter Perdan Date: Tue, 1 Aug 2023 20:44:36 +0200 Subject: [PATCH 09/29] add one more test and change name of tests --- tests/CMakeLists.txt | 16 ++++++++-------- tests/hello_test.cc | 10 ---------- tests/webarkit_test.cc | 20 ++++++++++++++++++++ 3 files changed, 28 insertions(+), 18 deletions(-) delete mode 100644 tests/hello_test.cc create mode 100644 tests/webarkit_test.cc diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 9d92b63..7e0db74 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -19,8 +19,8 @@ enable_testing() add_subdirectory(../WebARKit ../WebARKit/build) add_executable( - hello_test - hello_test.cc + webarkit_test + webarkit_test.cc ) message(STATUS "CMAKE_CURRENT_LIST_DIR: ${CMAKE_CURRENT_LIST_DIR}") @@ -31,9 +31,9 @@ get_filename_component(OPENCV_DIR ../../../opencv/ ABSOLUTE) get_filename_component(OPENCV_JS_DIR ../../../opencv_js/ ABSOLUTE) get_filename_component(OPENCV_CONTRIB_DIR ../../../opencv_contrib/ ABSOLUTE) -target_include_directories(hello_test PRIVATE "${PARENT_DIR}/WebARKit/include") -target_include_directories(hello_test PRIVATE "${PARENT_DIR}/WebARKit/WebARKitTrackers/WebARKitOpticalTracking/include") -target_include_directories(hello_test PRIVATE +target_include_directories(webarkit_test PRIVATE "${PARENT_DIR}/WebARKit/include") +target_include_directories(webarkit_test PRIVATE "${PARENT_DIR}/WebARKit/WebARKitTrackers/WebARKitOpticalTracking/include") +target_include_directories(webarkit_test PRIVATE ${OPENCV_CONFIG_FILE_INCLUDE_DIR} ${OPENCV_INCLUDE_DIR} ${OPENCV_MODULE_opencv_calib3d_LOCATION}/include @@ -46,15 +46,15 @@ target_include_directories(hello_test PRIVATE ${OPENCV_MODULE_opencv_xfeatures2d_LOCATION}/include ) -set(hello_test +set(webarkit_test ${PARENT_DIR}/WebARKit/WebARKitManager.cpp ) target_link_libraries( - hello_test + webarkit_test WebARKitLib GTest::gtest_main ) include(GoogleTest) -gtest_discover_tests(hello_test) \ No newline at end of file +gtest_discover_tests(webarkit_test) \ No newline at end of file diff --git a/tests/hello_test.cc b/tests/hello_test.cc deleted file mode 100644 index eb1fcaa..0000000 --- a/tests/hello_test.cc +++ /dev/null @@ -1,10 +0,0 @@ -#include -#include - -// Check WebARKitManager initialisation. -TEST(InitTest, InitialiseBaseTest) { - // Create a WebARKitManager object - webarkit::WebARKitManager manager; - // Check if the WebARKitManager initialisation is successful - EXPECT_TRUE(manager.initialiseBase(webarkit::TRACKER_TYPE::AKAZE_TRACKER)); -} \ No newline at end of file diff --git a/tests/webarkit_test.cc b/tests/webarkit_test.cc new file mode 100644 index 0000000..7200f9a --- /dev/null +++ b/tests/webarkit_test.cc @@ -0,0 +1,20 @@ +#include +#include + +// Check WebARKitManager initialisation. +TEST(WebARKitTest, InitialiseBaseTest) { + // Create a WebARKitManager object + webarkit::WebARKitManager manager; + // Check if the WebARKitManager initialisation is successful + EXPECT_TRUE(manager.initialiseBase(webarkit::TRACKER_TYPE::AKAZE_TRACKER)); +} + +// Check WebARKit version +TEST(WebARKitTest, CheckWebARKitVersion) { + // Create a WebARKitManager object + webarkit::WebARKitManager manager; + // Init the manager with the Akaze tracker + manager.initialiseBase(webarkit::TRACKER_TYPE::AKAZE_TRACKER); + // Check if the WebARKit version is correct + EXPECT_STREQ(manager.getWebARKitVersion().c_str(), "1.0.0"); +} \ No newline at end of file From f1600663881c1191bba255d4f1fd5520575ae282 Mon Sep 17 00:00:00 2001 From: Walter Perdan Date: Thu, 14 Sep 2023 19:42:47 +0200 Subject: [PATCH 10/29] version 0.4.3 --- WebARKit/CMakeLists.txt | 9 ++++----- .../WebARKitOpticalTracking/WebARKitTracker.h | 2 +- tests/CMakeLists.txt | 6 ------ 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/WebARKit/CMakeLists.txt b/WebARKit/CMakeLists.txt index eebe388..bb6150a 100644 --- a/WebARKit/CMakeLists.txt +++ b/WebARKit/CMakeLists.txt @@ -69,11 +69,11 @@ FetchContent_Declare( FetchContent_MakeAvailable(opencv opencv_contrib) -get_filename_component(PARENT_DIR ./ ABSOLUTE) -get_filename_component(OPENCV_DIR ../../../opencv/ ABSOLUTE) -get_filename_component(OPENCV_JS_DIR ../../../opencv_js/ ABSOLUTE) -get_filename_component(OPENCV_CONTRIB_DIR ../../../opencv_contrib/ ABSOLUTE) +set(OPENCV_EXTRA_MODULES_PATH ../${opencv_contrib_SOURCE_DIR}/modules/) + +set(BUILD_opencv_xfeatures2d ON) +get_filename_component(PARENT_DIR ./ ABSOLUTE) set(WEBARKIT_HEADERS ${PARENT_DIR}/WebARKitTrackers/WebARKitOpticalTracking/include/WebARKitTrackers/WebARKitOpticalTracking/WebARKitConfig.h @@ -99,7 +99,6 @@ add_library( target_include_directories(WebARKitLib PRIVATE "${PARENT_DIR}/include") target_include_directories(WebARKitLib PRIVATE "${PARENT_DIR}/WebARKitTrackers/WebARKitOpticalTracking/include") -target_include_directories(WebARKitLib PRIVATE "${OPENCV_JS_DIR}") target_include_directories(WebARKitLib PRIVATE ${OPENCV_CONFIG_FILE_INCLUDE_DIR} diff --git a/WebARKit/WebARKitTrackers/WebARKitOpticalTracking/include/WebARKitTrackers/WebARKitOpticalTracking/WebARKitTracker.h b/WebARKit/WebARKitTrackers/WebARKitOpticalTracking/include/WebARKitTrackers/WebARKitOpticalTracking/WebARKitTracker.h index af68186..95a25ee 100644 --- a/WebARKit/WebARKitTrackers/WebARKitOpticalTracking/include/WebARKitTrackers/WebARKitOpticalTracking/WebARKitTracker.h +++ b/WebARKit/WebARKitTrackers/WebARKitOpticalTracking/include/WebARKitTrackers/WebARKitOpticalTracking/WebARKitTracker.h @@ -3,7 +3,7 @@ #include "WebARKitEnums.h" #include -#include +#include namespace webarkit { diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 7e0db74..301bbff 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -23,13 +23,7 @@ add_executable( webarkit_test.cc ) -message(STATUS "CMAKE_CURRENT_LIST_DIR: ${CMAKE_CURRENT_LIST_DIR}") -message(STATUS "CMAKE_CURRENT_SOURCE_DIR: ${CMAKE_CURRENT_SOURCE_DIR}") - get_filename_component(PARENT_DIR ../ ABSOLUTE) -get_filename_component(OPENCV_DIR ../../../opencv/ ABSOLUTE) -get_filename_component(OPENCV_JS_DIR ../../../opencv_js/ ABSOLUTE) -get_filename_component(OPENCV_CONTRIB_DIR ../../../opencv_contrib/ ABSOLUTE) target_include_directories(webarkit_test PRIVATE "${PARENT_DIR}/WebARKit/include") target_include_directories(webarkit_test PRIVATE "${PARENT_DIR}/WebARKit/WebARKitTrackers/WebARKitOpticalTracking/include") From 8b424a0c13c3a8c13b84b38ba3a5681bcaec14f6 Mon Sep 17 00:00:00 2001 From: Walter Perdan Date: Thu, 14 Sep 2023 20:05:38 +0200 Subject: [PATCH 11/29] creating test with github action --- .github/workflows/test.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..99d902e --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,18 @@ +name: WebARKitLib test + +on: push +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: '16.x' + - name: enter in the build directotry + run: cd tests/build + - name: Build + run: cmake .. + - name: Test + run: cd build/bin/Debug && ./webarkit_test.exe \ No newline at end of file From e66bebebc80d2936c2ed36e6232010ccec12e4e7 Mon Sep 17 00:00:00 2001 From: Walter Perdan Date: Thu, 14 Sep 2023 20:08:05 +0200 Subject: [PATCH 12/29] fix path and typo in the action script --- .github/workflows/test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 99d902e..9743c69 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,9 +10,9 @@ jobs: uses: actions/setup-node@v3 with: node-version: '16.x' - - name: enter in the build directotry - run: cd tests/build + - name: create and enter in the build directory + run: cd tests && mkdir build && cd build - name: Build run: cmake .. - name: Test - run: cd build/bin/Debug && ./webarkit_test.exe \ No newline at end of file + run: cd bin/Debug && ./webarkit_test.exe \ No newline at end of file From 36f1502c025680270f3b6065c1592f2c79e3091e Mon Sep 17 00:00:00 2001 From: Walter Perdan Date: Thu, 14 Sep 2023 20:17:29 +0200 Subject: [PATCH 13/29] the script do not enter in the folder - trying tp fix for the error --- .github/workflows/test.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9743c69..3733e13 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,8 +11,10 @@ jobs: with: node-version: '16.x' - name: create and enter in the build directory - run: cd tests && mkdir build && cd build + run: | + cd tests && mkdir build && cd build - name: Build run: cmake .. - name: Test - run: cd bin/Debug && ./webarkit_test.exe \ No newline at end of file + run: | + cd bin/Debug && ./webarkit_test.exe \ No newline at end of file From 09a4ea0c509f8fcb8ace416bfbe0302c59acfa03 Mon Sep 17 00:00:00 2001 From: Walter Perdan Date: Thu, 14 Sep 2023 20:19:46 +0200 Subject: [PATCH 14/29] the commands should stay in the same run --- .github/workflows/test.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3733e13..56318b2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,11 +10,8 @@ jobs: uses: actions/setup-node@v3 with: node-version: '16.x' - - name: create and enter in the build directory - run: | - cd tests && mkdir build && cd build - - name: Build - run: cmake .. - - name: Test + - name: Build and test WebARKitLib run: | + cd tests && mkdir build && cd build \ + cmake .. \ cd bin/Debug && ./webarkit_test.exe \ No newline at end of file From 442e9cea25deaf9c648abf2c5ea82c45b5840ccd Mon Sep 17 00:00:00 2001 From: Walter Perdan Date: Thu, 14 Sep 2023 20:22:09 +0200 Subject: [PATCH 15/29] avoiding multilines command --- .github/workflows/test.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 56318b2..a0a6e54 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,6 +12,4 @@ jobs: node-version: '16.x' - name: Build and test WebARKitLib run: | - cd tests && mkdir build && cd build \ - cmake .. \ - cd bin/Debug && ./webarkit_test.exe \ No newline at end of file + cd tests && mkdir build && cd build && cmake .. && cd bin/Debug && ./webarkit_test.exe \ No newline at end of file From 3f3b4fdb7ec749edc19f6210905d192f3db8e41f Mon Sep 17 00:00:00 2001 From: Walter Perdan Date: Thu, 14 Sep 2023 20:24:51 +0200 Subject: [PATCH 16/29] missed make command to compile the project --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a0a6e54..e731382 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,4 +12,4 @@ jobs: node-version: '16.x' - name: Build and test WebARKitLib run: | - cd tests && mkdir build && cd build && cmake .. && cd bin/Debug && ./webarkit_test.exe \ No newline at end of file + cd tests && mkdir build && cd build && cmake .. && make && cd bin/Debug && ./webarkit_test.exe \ No newline at end of file From e43b8620c8d755882977e43a5e0376a239608bab Mon Sep 17 00:00:00 2001 From: Walter Perdan Date: Thu, 14 Sep 2023 22:02:44 +0200 Subject: [PATCH 17/29] testing with a different OPENCV_EXTRA_MODULES_PATH --- WebARKit/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WebARKit/CMakeLists.txt b/WebARKit/CMakeLists.txt index bb6150a..dab440d 100644 --- a/WebARKit/CMakeLists.txt +++ b/WebARKit/CMakeLists.txt @@ -49,7 +49,7 @@ set(BUILD_opencv_tracking OFF) set(BUILD_opencv_stereo OFF) set(BUILD_opencv_version OFF) -set(OPENCV_EXTRA_MODULES_PATH ../opencv_contrib-src/modules/) +set(OPENCV_EXTRA_MODULES_PATH ../${opencv_contrib_SOURCE_DIR}/modules/) FetchContent_Declare( opencv From 13d8049c3ade6163eb54cf649cffc2c6ec95dcea Mon Sep 17 00:00:00 2001 From: Walter Perdan Date: Thu, 14 Sep 2023 22:22:55 +0200 Subject: [PATCH 18/29] fix for extra modules path --- WebARKit/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/WebARKit/CMakeLists.txt b/WebARKit/CMakeLists.txt index dab440d..7945f94 100644 --- a/WebARKit/CMakeLists.txt +++ b/WebARKit/CMakeLists.txt @@ -49,7 +49,7 @@ set(BUILD_opencv_tracking OFF) set(BUILD_opencv_stereo OFF) set(BUILD_opencv_version OFF) -set(OPENCV_EXTRA_MODULES_PATH ../${opencv_contrib_SOURCE_DIR}/modules/) +set(OPENCV_EXTRA_MODULES_PATH ${opencv_contrib_SOURCE_DIR}/modules/) FetchContent_Declare( opencv @@ -69,7 +69,7 @@ FetchContent_Declare( FetchContent_MakeAvailable(opencv opencv_contrib) -set(OPENCV_EXTRA_MODULES_PATH ../${opencv_contrib_SOURCE_DIR}/modules/) +set(OPENCV_EXTRA_MODULES_PATH ${opencv_contrib_SOURCE_DIR}/modules/) set(BUILD_opencv_xfeatures2d ON) From 83ef2bdb6eb0fe44a4214d09a1413ed980a9abf1 Mon Sep 17 00:00:00 2001 From: Walter Perdan Date: Fri, 15 Sep 2023 14:56:37 +0200 Subject: [PATCH 19/29] this should compile WebARKitLib --- WebARKit/CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/WebARKit/CMakeLists.txt b/WebARKit/CMakeLists.txt index 7945f94..e1f62f2 100644 --- a/WebARKit/CMakeLists.txt +++ b/WebARKit/CMakeLists.txt @@ -38,8 +38,11 @@ set(BUILD_opencv_rgbd OFF) set(BUILD_opencv_shape OFF) set(BUILD_opencv_rapid OFF) set(BUILD_opencv_structured_light OFF) +set(BUILD_opencv_java OFF) set(BUILD_opencv_xfeatures2d ON) +set(BUILD_opencv_contrib ON) +set(OPENCV_ENABLE_NONFREE ON) set(BUILD_opencv_ximgproc OFF) set(BUILD_opencv_bgsegm OFF) @@ -69,9 +72,9 @@ FetchContent_Declare( FetchContent_MakeAvailable(opencv opencv_contrib) -set(OPENCV_EXTRA_MODULES_PATH ${opencv_contrib_SOURCE_DIR}/modules/) +#set(OPENCV_EXTRA_MODULES_PATH ${opencv_contrib_SOURCE_DIR}/modules/) -set(BUILD_opencv_xfeatures2d ON) +#set(BUILD_opencv_xfeatures2d ON) get_filename_component(PARENT_DIR ./ ABSOLUTE) @@ -111,6 +114,7 @@ target_include_directories(WebARKitLib PRIVATE ${OPENCV_MODULE_opencv_imgcodecs_LOCATION}/include ${OPENCV_MODULE_opencv_video_LOCATION}/include ${OPENCV_MODULE_opencv_xfeatures2d_LOCATION}/include + ${opencv_contrib_SOURCE_DIR}/modules/xfeatures2d/include ) target_link_libraries(WebARKitLib opencv_calib3d opencv_core opencv_features2d opencv_flann opencv_imgproc opencv_imgcodecs opencv_video opencv_xfeatures2d) \ No newline at end of file From f9b02618e024410edba31442265302492bd9cbad Mon Sep 17 00:00:00 2001 From: Walter Perdan Date: Fri, 15 Sep 2023 15:10:17 +0200 Subject: [PATCH 20/29] correct xfeatures2d include for tests --- tests/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 301bbff..90497c3 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -38,6 +38,7 @@ target_include_directories(webarkit_test PRIVATE ${OPENCV_MODULE_opencv_imgcodecs_LOCATION}/include ${OPENCV_MODULE_opencv_video_LOCATION}/include ${OPENCV_MODULE_opencv_xfeatures2d_LOCATION}/include + ${opencv_contrib_SOURCE_DIR}/modules/xfeatures2d/include ) set(webarkit_test From 4a2c71569e64e82066f52335c0536e22a3c4ebf8 Mon Sep 17 00:00:00 2001 From: Walter Perdan Date: Fri, 15 Sep 2023 16:58:44 +0200 Subject: [PATCH 21/29] correct path for xfeatures2d include for tests --- tests/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 90497c3..d91ba6c 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -24,6 +24,7 @@ add_executable( ) get_filename_component(PARENT_DIR ../ ABSOLUTE) +message("opencv contrib source dir: ${PARENT_DIR}/WebARKit/build/_deps/opencv_contrib-src/modules/xfeatures2d/include") target_include_directories(webarkit_test PRIVATE "${PARENT_DIR}/WebARKit/include") target_include_directories(webarkit_test PRIVATE "${PARENT_DIR}/WebARKit/WebARKitTrackers/WebARKitOpticalTracking/include") @@ -38,7 +39,7 @@ target_include_directories(webarkit_test PRIVATE ${OPENCV_MODULE_opencv_imgcodecs_LOCATION}/include ${OPENCV_MODULE_opencv_video_LOCATION}/include ${OPENCV_MODULE_opencv_xfeatures2d_LOCATION}/include - ${opencv_contrib_SOURCE_DIR}/modules/xfeatures2d/include + ${PARENT_DIR}/WebARKit/build/_deps/opencv_contrib-src/modules/xfeatures2d/include ) set(webarkit_test From 3c32591f7aff7cfe5c1e44e0055c8d05e450a97a Mon Sep 17 00:00:00 2001 From: Walter Perdan Date: Fri, 15 Sep 2023 17:21:38 +0200 Subject: [PATCH 22/29] correct path for xfeatures2d include for tests --- tests/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index d91ba6c..0f866c9 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -25,6 +25,7 @@ add_executable( get_filename_component(PARENT_DIR ../ ABSOLUTE) message("opencv contrib source dir: ${PARENT_DIR}/WebARKit/build/_deps/opencv_contrib-src/modules/xfeatures2d/include") +message("opencv contrib source dir inside tests: ${PARENT_DIR}/WebARKit/tests/build/_deps/opencv_contrib-src/modules/xfeatures2d/include") target_include_directories(webarkit_test PRIVATE "${PARENT_DIR}/WebARKit/include") target_include_directories(webarkit_test PRIVATE "${PARENT_DIR}/WebARKit/WebARKitTrackers/WebARKitOpticalTracking/include") @@ -39,7 +40,7 @@ target_include_directories(webarkit_test PRIVATE ${OPENCV_MODULE_opencv_imgcodecs_LOCATION}/include ${OPENCV_MODULE_opencv_video_LOCATION}/include ${OPENCV_MODULE_opencv_xfeatures2d_LOCATION}/include - ${PARENT_DIR}/WebARKit/build/_deps/opencv_contrib-src/modules/xfeatures2d/include + ${PARENT_DIR}/WebARKit/tests/build/_deps/opencv_contrib-src/modules/xfeatures2d/include ) set(webarkit_test From 2a855a1e26b8499fc8da7ad5197cf538e497e486 Mon Sep 17 00:00:00 2001 From: Walter Perdan Date: Fri, 15 Sep 2023 17:34:56 +0200 Subject: [PATCH 23/29] maybe this is correct --- tests/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 0f866c9..56fd8d8 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -25,7 +25,7 @@ add_executable( get_filename_component(PARENT_DIR ../ ABSOLUTE) message("opencv contrib source dir: ${PARENT_DIR}/WebARKit/build/_deps/opencv_contrib-src/modules/xfeatures2d/include") -message("opencv contrib source dir inside tests: ${PARENT_DIR}/WebARKit/tests/build/_deps/opencv_contrib-src/modules/xfeatures2d/include") +message("opencv contrib source dir inside tests: ${PARENT_DIR}/tests/build/_deps/opencv_contrib-src/modules/xfeatures2d/include") target_include_directories(webarkit_test PRIVATE "${PARENT_DIR}/WebARKit/include") target_include_directories(webarkit_test PRIVATE "${PARENT_DIR}/WebARKit/WebARKitTrackers/WebARKitOpticalTracking/include") @@ -40,7 +40,7 @@ target_include_directories(webarkit_test PRIVATE ${OPENCV_MODULE_opencv_imgcodecs_LOCATION}/include ${OPENCV_MODULE_opencv_video_LOCATION}/include ${OPENCV_MODULE_opencv_xfeatures2d_LOCATION}/include - ${PARENT_DIR}/WebARKit/tests/build/_deps/opencv_contrib-src/modules/xfeatures2d/include + ${PARENT_DIR}/tests/build/_deps/opencv_contrib-src/modules/xfeatures2d/include") ) set(webarkit_test From 6e883c0dceaf6fa81c0faba0d06e181cf3767282 Mon Sep 17 00:00:00 2001 From: Walter Perdan Date: Fri, 15 Sep 2023 17:38:00 +0200 Subject: [PATCH 24/29] fix a typo --- tests/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 56fd8d8..b14510e 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -40,7 +40,7 @@ target_include_directories(webarkit_test PRIVATE ${OPENCV_MODULE_opencv_imgcodecs_LOCATION}/include ${OPENCV_MODULE_opencv_video_LOCATION}/include ${OPENCV_MODULE_opencv_xfeatures2d_LOCATION}/include - ${PARENT_DIR}/tests/build/_deps/opencv_contrib-src/modules/xfeatures2d/include") + ${PARENT_DIR}/tests/build/_deps/opencv_contrib-src/modules/xfeatures2d/include ) set(webarkit_test From 5b235a95895c9f95edd3c757a625404dcf943698 Mon Sep 17 00:00:00 2001 From: Walter Perdan Date: Sun, 17 Sep 2023 20:51:15 +0200 Subject: [PATCH 25/29] minor changes but not solve anything --- WebARKit/CMakeLists.txt | 15 +++++++-------- tests/CMakeLists.txt | 2 +- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/WebARKit/CMakeLists.txt b/WebARKit/CMakeLists.txt index e1f62f2..6550c5f 100644 --- a/WebARKit/CMakeLists.txt +++ b/WebARKit/CMakeLists.txt @@ -40,9 +40,9 @@ set(BUILD_opencv_rapid OFF) set(BUILD_opencv_structured_light OFF) set(BUILD_opencv_java OFF) -set(BUILD_opencv_xfeatures2d ON) -set(BUILD_opencv_contrib ON) -set(OPENCV_ENABLE_NONFREE ON) +#set(BUILD_opencv_xfeatures2d ON) +#set(BUILD_opencv_contrib ON) +#set(OPENCV_ENABLE_NONFREE ON) set(BUILD_opencv_ximgproc OFF) set(BUILD_opencv_bgsegm OFF) @@ -52,7 +52,7 @@ set(BUILD_opencv_tracking OFF) set(BUILD_opencv_stereo OFF) set(BUILD_opencv_version OFF) -set(OPENCV_EXTRA_MODULES_PATH ${opencv_contrib_SOURCE_DIR}/modules/) +set(OPENCV_EXTRA_MODULES_PATH ${opencv_contrib_SOURCE_DIR}/modules) FetchContent_Declare( opencv @@ -71,8 +71,7 @@ FetchContent_Declare( ) FetchContent_MakeAvailable(opencv opencv_contrib) - -#set(OPENCV_EXTRA_MODULES_PATH ${opencv_contrib_SOURCE_DIR}/modules/) +set(OPENCV_EXTRA_MODULES_PATH ${opencv_contrib_SOURCE_DIR}/modules) #set(BUILD_opencv_xfeatures2d ON) @@ -113,8 +112,8 @@ target_include_directories(WebARKitLib PRIVATE ${OPENCV_MODULE_opencv_imgproc_LOCATION}/include ${OPENCV_MODULE_opencv_imgcodecs_LOCATION}/include ${OPENCV_MODULE_opencv_video_LOCATION}/include - ${OPENCV_MODULE_opencv_xfeatures2d_LOCATION}/include + #${OPENCV_MODULE_opencv_xfeatures2d_LOCATION}/include ${opencv_contrib_SOURCE_DIR}/modules/xfeatures2d/include ) -target_link_libraries(WebARKitLib opencv_calib3d opencv_core opencv_features2d opencv_flann opencv_imgproc opencv_imgcodecs opencv_video opencv_xfeatures2d) \ No newline at end of file +target_link_libraries(WebARKitLib opencv_calib3d opencv_core opencv_features2d opencv_flann opencv_imgproc opencv_imgcodecs opencv_video) \ No newline at end of file diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index b14510e..f62345d 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -39,7 +39,7 @@ target_include_directories(webarkit_test PRIVATE ${OPENCV_MODULE_opencv_imgproc_LOCATION}/include ${OPENCV_MODULE_opencv_imgcodecs_LOCATION}/include ${OPENCV_MODULE_opencv_video_LOCATION}/include - ${OPENCV_MODULE_opencv_xfeatures2d_LOCATION}/include + #${OPENCV_MODULE_opencv_xfeatures2d_LOCATION}/include ${PARENT_DIR}/tests/build/_deps/opencv_contrib-src/modules/xfeatures2d/include ) From 3740075d47f4012a5b6378f4685940486f141edc Mon Sep 17 00:00:00 2001 From: Walter Perdan Date: Sun, 24 Sep 2023 20:04:48 +0200 Subject: [PATCH 26/29] fetching content from opencv-em build the project! --- WebARKit/CMakeLists.txt | 94 +++++++---------------------------------- tests/CMakeLists.txt | 45 ++++++++++++++------ 2 files changed, 46 insertions(+), 93 deletions(-) diff --git a/WebARKit/CMakeLists.txt b/WebARKit/CMakeLists.txt index 6550c5f..f4b6f5c 100644 --- a/WebARKit/CMakeLists.txt +++ b/WebARKit/CMakeLists.txt @@ -6,77 +6,17 @@ set(CMAKE_CXX_STANDARD 14) include(FetchContent) -set(BUILD_SHARED_LIBS OFF) -set(BUILD_opencv_dnn OFF) -set(BUILD_opencv_highgui OFF) -set(BUILD_opencv_ml OFF) -set(BUILD_opencv_objdetect OFF) -set(BUILD_opencv_gapi OFF) -set(BUILD_opencv_photo OFF) -set(BUILD_opencv_stitching OFF) -set(BUILD_opencv_ts OFF) -set(BUILD_opencv_videoio OFF) -set(BUILD_opencv_python2 OFF) -set(BUILD_opencv_python3 OFF) - -set(BUILD_opencv_dnn_plugins OFF) -set(BUILD_opencv_highgui_plugins OFF) -set(BUILD_opencv_videoio_plugins OFF) -set(BUILD_opencv_intensity_transform OFF) -set(BUILD_opencv_phase_unwrapping OFF) -set(BUILD_opencv_plot OFF) -set(BUILD_opencv_reg OFF) -set(BUILD_opencv_surface_matching OFF) -set(BUILD_opencv_bioinspired OFF) -set(BUILD_opencv_fuzzy OFF) -set(BUILD_opencv_hfs OFF) -set(BUILD_opencv_img_hash OFF) -set(BUILD_opencv_line_descriptor OFF) -set(BUILD_opencv_saliency OFF) -set(BUILD_opencv_rapid OFF) -set(BUILD_opencv_rgbd OFF) -set(BUILD_opencv_shape OFF) -set(BUILD_opencv_rapid OFF) -set(BUILD_opencv_structured_light OFF) -set(BUILD_opencv_java OFF) - -#set(BUILD_opencv_xfeatures2d ON) -#set(BUILD_opencv_contrib ON) -#set(OPENCV_ENABLE_NONFREE ON) - -set(BUILD_opencv_ximgproc OFF) -set(BUILD_opencv_bgsegm OFF) -set(BUILD_opencv_optflow OFF) -set(BUILD_opencv_opencv_superres OFF) -set(BUILD_opencv_tracking OFF) -set(BUILD_opencv_stereo OFF) -set(BUILD_opencv_version OFF) - -set(OPENCV_EXTRA_MODULES_PATH ${opencv_contrib_SOURCE_DIR}/modules) - FetchContent_Declare( - opencv - GIT_REPOSITORY https://github.com/webarkit/opencv.git - GIT_TAG 889dfa15f1cd60e571d33b23b87a1d506d381ea9 - GIT_SHALLOW TRUE - GIT_PROGRESS TRUE + build_opencv + URL https://github.com/webarkit/opencv-em/releases/download/0.1.0/opencv-4.7.0.zip ) -FetchContent_Declare( - opencv_contrib - GIT_REPOSITORY https://github.com/webarkit/opencv_contrib.git - GIT_TAG 5438f53d81e1c1137258e18308ebf3f4daa2f2ff - GIT_SHALLOW TRUE - GIT_PROGRESS TRUE -) - -FetchContent_MakeAvailable(opencv opencv_contrib) -set(OPENCV_EXTRA_MODULES_PATH ${opencv_contrib_SOURCE_DIR}/modules) - -#set(BUILD_opencv_xfeatures2d ON) +FetchContent_MakeAvailable(build_opencv) get_filename_component(PARENT_DIR ./ ABSOLUTE) +#set( BUILD_WASM build_wasm ) + set(WEBARKIT_HEADERS ${PARENT_DIR}/WebARKitTrackers/WebARKitOpticalTracking/include/WebARKitTrackers/WebARKitOpticalTracking/WebARKitConfig.h ${PARENT_DIR}/WebARKitTrackers/WebARKitOpticalTracking/include/WebARKitTrackers/WebARKitOpticalTracking//WebARKitEnums.h @@ -103,17 +43,13 @@ target_include_directories(WebARKitLib PRIVATE "${PARENT_DIR}/include") target_include_directories(WebARKitLib PRIVATE "${PARENT_DIR}/WebARKitTrackers/WebARKitOpticalTracking/include") target_include_directories(WebARKitLib PRIVATE - ${OPENCV_CONFIG_FILE_INCLUDE_DIR} - ${OPENCV_INCLUDE_DIR} - ${OPENCV_MODULE_opencv_calib3d_LOCATION}/include - ${OPENCV_MODULE_opencv_core_LOCATION}/include - ${OPENCV_MODULE_opencv_features2d_LOCATION}/include - ${OPENCV_MODULE_opencv_flann_LOCATION}/include - ${OPENCV_MODULE_opencv_imgproc_LOCATION}/include - ${OPENCV_MODULE_opencv_imgcodecs_LOCATION}/include - ${OPENCV_MODULE_opencv_video_LOCATION}/include - #${OPENCV_MODULE_opencv_xfeatures2d_LOCATION}/include - ${opencv_contrib_SOURCE_DIR}/modules/xfeatures2d/include - ) - -target_link_libraries(WebARKitLib opencv_calib3d opencv_core opencv_features2d opencv_flann opencv_imgproc opencv_imgcodecs opencv_video) \ No newline at end of file + "${build_opencv_SOURCE_DIR}" + "${build_opencv_SOURCE_DIR}/libs/opencv/include" + "${build_opencv_SOURCE_DIR}/libs/opencv/modules/calib3d/include" + "${build_opencv_SOURCE_DIR}/libs/opencv/modules/core/include" + "${build_opencv_SOURCE_DIR}/libs/opencv/modules/features2d/include" + "${build_opencv_SOURCE_DIR}/libs/opencv/modules/flann/include" + "${build_opencv_SOURCE_DIR}/libs/opencv/modules/imgproc/include" + "${build_opencv_SOURCE_DIR}/libs/opencv/modules/video/include" + "${build_opencv_SOURCE_DIR}/libs/opencv_contrib/modules/xfeatures2d/include" + ) \ No newline at end of file diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index f62345d..37fd158 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -12,7 +12,13 @@ FetchContent_Declare( ) # For Windows: Prevent overriding the parent project's compiler/linker settings set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) -FetchContent_MakeAvailable(googletest) + +FetchContent_Declare( + build_opencv + URL https://github.com/webarkit/opencv-em/releases/download/0.1.0/opencv-4.7.0.zip +) + +FetchContent_MakeAvailable(googletest build_opencv) enable_testing() @@ -24,32 +30,43 @@ add_executable( ) get_filename_component(PARENT_DIR ../ ABSOLUTE) -message("opencv contrib source dir: ${PARENT_DIR}/WebARKit/build/_deps/opencv_contrib-src/modules/xfeatures2d/include") -message("opencv contrib source dir inside tests: ${PARENT_DIR}/tests/build/_deps/opencv_contrib-src/modules/xfeatures2d/include") +get_filename_component(TEST_DIR ./ ABSOLUTE) target_include_directories(webarkit_test PRIVATE "${PARENT_DIR}/WebARKit/include") target_include_directories(webarkit_test PRIVATE "${PARENT_DIR}/WebARKit/WebARKitTrackers/WebARKitOpticalTracking/include") + target_include_directories(webarkit_test PRIVATE - ${OPENCV_CONFIG_FILE_INCLUDE_DIR} - ${OPENCV_INCLUDE_DIR} - ${OPENCV_MODULE_opencv_calib3d_LOCATION}/include - ${OPENCV_MODULE_opencv_core_LOCATION}/include - ${OPENCV_MODULE_opencv_features2d_LOCATION}/include - ${OPENCV_MODULE_opencv_flann_LOCATION}/include - ${OPENCV_MODULE_opencv_imgproc_LOCATION}/include - ${OPENCV_MODULE_opencv_imgcodecs_LOCATION}/include - ${OPENCV_MODULE_opencv_video_LOCATION}/include - #${OPENCV_MODULE_opencv_xfeatures2d_LOCATION}/include - ${PARENT_DIR}/tests/build/_deps/opencv_contrib-src/modules/xfeatures2d/include + "${build_opencv_SOURCE_DIR}" + "${build_opencv_SOURCE_DIR}/libs/opencv/include" + "${build_opencv_SOURCE_DIR}/libs/opencv/modules/calib3d/include" + "${build_opencv_SOURCE_DIR}/libs/opencv/modules/core/include" + "${build_opencv_SOURCE_DIR}/libs/opencv/modules/features2d/include" + "${build_opencv_SOURCE_DIR}/libs/opencv/modules/flann/include" + "${build_opencv_SOURCE_DIR}/libs/opencv/modules/imgproc/include" + "${build_opencv_SOURCE_DIR}/libs/opencv/modules/video/include" + "${build_opencv_SOURCE_DIR}/libs/opencv_contrib/modules/xfeatures2d/include" ) set(webarkit_test ${PARENT_DIR}/WebARKit/WebARKitManager.cpp ) +# The order of the libs make the difference! + target_link_libraries( webarkit_test WebARKitLib + "${build_opencv_SOURCE_DIR}/lib/libopencv_calib3d.a" + "${build_opencv_SOURCE_DIR}/lib/libopencv_features2d.a" + "${build_opencv_SOURCE_DIR}/lib/libopencv_flann.a" + "${build_opencv_SOURCE_DIR}/lib/libopencv_video.a" + "${build_opencv_SOURCE_DIR}/lib/libopencv_xfeatures2d.a" + "${build_opencv_SOURCE_DIR}/lib/libopencv_imgproc.a" + #"${build_opencv_SOURCE_DIR}/lib/libopencv_video.a" + #"${build_opencv_SOURCE_DIR}/3rdparty/lib/libzlib.a" + "${build_opencv_SOURCE_DIR}/lib/libopencv_core.a" + "${build_opencv_SOURCE_DIR}/3rdparty/lib/libzlib.a" + #"${build_opencv_SOURCE_DIR}/lib/libopencv_xfeatures2d.a" GTest::gtest_main ) From c54087aa687233719b893608c520b425b825f95c Mon Sep 17 00:00:00 2001 From: Walter Perdan Date: Sun, 24 Sep 2023 20:12:08 +0200 Subject: [PATCH 27/29] fix for linux command in tests.yml --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e731382..d5c8d25 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,4 +12,4 @@ jobs: node-version: '16.x' - name: Build and test WebARKitLib run: | - cd tests && mkdir build && cd build && cmake .. && make && cd bin/Debug && ./webarkit_test.exe \ No newline at end of file + cd tests && mkdir build && cd build && cmake .. && make && ./webarkit_test \ No newline at end of file From 8f65adaadd7ecb216a34689fa0774de9771eedcf Mon Sep 17 00:00:00 2001 From: Walter Perdan Date: Sun, 24 Sep 2023 20:28:16 +0200 Subject: [PATCH 28/29] setting CMP0135 NEW policy --- WebARKit/CMakeLists.txt | 4 ++-- tests/CMakeLists.txt | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/WebARKit/CMakeLists.txt b/WebARKit/CMakeLists.txt index f4b6f5c..99cd1e5 100644 --- a/WebARKit/CMakeLists.txt +++ b/WebARKit/CMakeLists.txt @@ -4,6 +4,8 @@ project(WebARKitLib) set(CMAKE_CXX_STANDARD 14) +cmake_policy(SET CMP0135 NEW) + include(FetchContent) FetchContent_Declare( @@ -15,8 +17,6 @@ FetchContent_MakeAvailable(build_opencv) get_filename_component(PARENT_DIR ./ ABSOLUTE) -#set( BUILD_WASM build_wasm ) - set(WEBARKIT_HEADERS ${PARENT_DIR}/WebARKitTrackers/WebARKitOpticalTracking/include/WebARKitTrackers/WebARKitOpticalTracking/WebARKitConfig.h ${PARENT_DIR}/WebARKitTrackers/WebARKitOpticalTracking/include/WebARKitTrackers/WebARKitOpticalTracking//WebARKitEnums.h diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 37fd158..841bfcd 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -4,6 +4,8 @@ project(Webarkit_tests) # GoogleTest requires at least C++14 set(CMAKE_CXX_STANDARD 14) +cmake_policy(SET CMP0135 NEW) + # Fetch googletest v1.13.0 commit b796f7d44681514f58a683a3a71ff17c94edb0c1 include(FetchContent) FetchContent_Declare( @@ -30,7 +32,6 @@ add_executable( ) get_filename_component(PARENT_DIR ../ ABSOLUTE) -get_filename_component(TEST_DIR ./ ABSOLUTE) target_include_directories(webarkit_test PRIVATE "${PARENT_DIR}/WebARKit/include") target_include_directories(webarkit_test PRIVATE "${PARENT_DIR}/WebARKit/WebARKitTrackers/WebARKitOpticalTracking/include") @@ -62,11 +63,8 @@ target_link_libraries( "${build_opencv_SOURCE_DIR}/lib/libopencv_video.a" "${build_opencv_SOURCE_DIR}/lib/libopencv_xfeatures2d.a" "${build_opencv_SOURCE_DIR}/lib/libopencv_imgproc.a" - #"${build_opencv_SOURCE_DIR}/lib/libopencv_video.a" - #"${build_opencv_SOURCE_DIR}/3rdparty/lib/libzlib.a" "${build_opencv_SOURCE_DIR}/lib/libopencv_core.a" "${build_opencv_SOURCE_DIR}/3rdparty/lib/libzlib.a" - #"${build_opencv_SOURCE_DIR}/lib/libopencv_xfeatures2d.a" GTest::gtest_main ) From 8341ec1c29db62afd448e9129c5ea80840f2b4d7 Mon Sep 17 00:00:00 2001 From: Walter Perdan Date: Sun, 24 Sep 2023 21:54:04 +0200 Subject: [PATCH 29/29] improving the README --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index c6b9e17..0963902 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,7 @@ + +![github releases](https://flat.badgen.net/github/release/webarkit/WebARKitLib) +![github stars](https://flat.badgen.net/github/stars/webarkit/WebARKitLib) +![github forks](https://flat.badgen.net/github/forks/webarkit/WebARKitLib)[![Test](https://github.com/webarkit/WebARKitLib/actions/workflows/test.yml/badge.svg)](https://github.com/webarkit/WebARKitLib/actions/workflows/test.yml) # WebARKitLib The C/C++ source code of WebARKit, from Artoolkit5 and extended.