Initial commit
This commit is contained in:
61
pixelmatch-cpp17/all/patches/1.0.3-conan-dependencies.patch
Normal file
61
pixelmatch-cpp17/all/patches/1.0.3-conan-dependencies.patch
Normal file
@@ -0,0 +1,61 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index f4ed9a7..a5b6a69 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -6,14 +6,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
option(PIXELMATCH_BUILD_TESTS "Enable building tests" OFF)
|
||||
|
||||
-# stb libraries for tests and image_utils. Not used in pixelmatch-cpp17 itself.
|
||||
-add_library(pixelmatch_third_party_stb_image STATIC third_party/stb/stb_image.cpp)
|
||||
-target_include_directories(pixelmatch_third_party_stb_image PUBLIC third_party)
|
||||
-target_compile_options(pixelmatch_third_party_stb_image PRIVATE -Wno-unused-function -Wno-self-assign)
|
||||
-
|
||||
-add_library(pixelmatch_third_party_stb_image_write STATIC third_party/stb/stb_image_write.cpp)
|
||||
-target_include_directories(pixelmatch_third_party_stb_image_write PUBLIC third_party)
|
||||
-target_compile_options(pixelmatch_third_party_stb_image_write PRIVATE -Wno-unused-function -Wno-self-assign)
|
||||
+find_package(stb)
|
||||
|
||||
# Main library
|
||||
add_library(pixelmatch-cpp17 src/pixelmatch/pixelmatch.cc)
|
||||
@@ -22,16 +15,18 @@ target_include_directories(pixelmatch-cpp17 PUBLIC src)
|
||||
# image_utils helper library (uses stb to load and save images)
|
||||
add_library(image_utils src/pixelmatch/image_utils.cc)
|
||||
target_include_directories(image_utils PUBLIC src)
|
||||
-target_link_libraries(image_utils PUBLIC pixelmatch-cpp17 pixelmatch_third_party_stb_image pixelmatch_third_party_stb_image_write)
|
||||
+target_link_libraries(image_utils PUBLIC pixelmatch-cpp17 stb::stb)
|
||||
+
|
||||
+install(FILES src/pixelmatch/pixelmatch.h DESTINATION include/pixelmatch)
|
||||
+install(TARGETS pixelmatch-cpp17 DESTINATION lib)
|
||||
+
|
||||
+if ((MSVC) AND (MSVC_VERSION GREATER_EQUAL 1914))
|
||||
+ target_compile_options(${PROJECT_NAME} PRIVATE "/Zc:preprocessor")
|
||||
+ target_compile_options(${PROJECT_NAME} PRIVATE "/Zc:__cplusplus")
|
||||
+endif()
|
||||
|
||||
if(PIXELMATCH_BUILD_TESTS)
|
||||
-include(FetchContent)
|
||||
-FetchContent_Declare(
|
||||
- googletest
|
||||
- URL https://github.com/google/googletest/archive/refs/tags/v1.14.0.zip
|
||||
-)
|
||||
-set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
|
||||
-FetchContent_MakeAvailable(googletest)
|
||||
+find_package(GTest)
|
||||
|
||||
enable_testing()
|
||||
add_library(test_base INTERFACE)
|
||||
diff --git a/src/pixelmatch/image_utils.cc b/src/pixelmatch/image_utils.cc
|
||||
index 74ec434..068e75d 100644
|
||||
--- a/src/pixelmatch/image_utils.cc
|
||||
+++ b/src/pixelmatch/image_utils.cc
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "pixelmatch/image_utils.h"
|
||||
|
||||
-#include <stb/stb_image.h>
|
||||
-#include <stb/stb_image_write.h>
|
||||
+#include <stb_image.h>
|
||||
+#include <stb_image_write.h>
|
||||
|
||||
#include <cassert>
|
||||
#include <cstring> // For memcmp.
|
||||
Reference in New Issue
Block a user