early-access version 2853
This commit is contained in:
159
externals/vcpkg/ports/vlfeat/CMakeLists.txt
vendored
Executable file
159
externals/vcpkg/ports/vlfeat/CMakeLists.txt
vendored
Executable file
@@ -0,0 +1,159 @@
|
||||
cmake_minimum_required (VERSION 3.10)
|
||||
project (vlfeat)
|
||||
|
||||
set(INSTALL_BIN_DIR "bin" CACHE PATH "Path where exe and dll will be installed")
|
||||
set(INSTALL_LIB_DIR "lib" CACHE PATH "Path where lib will be installed")
|
||||
set(INSTALL_INCLUDE_DIR "include/vlfeat" CACHE PATH "Path where headers will be installed")
|
||||
set(INSTALL_CMAKE_DIR "share/vlfeat" CACHE PATH "Path where cmake configs will be installed")
|
||||
|
||||
# Make relative paths absolute (needed later on)
|
||||
set(RELATIVE_INSTALL_INCLUDE_DIR ${INSTALL_INCLUDE_DIR})
|
||||
foreach(p LIB BIN INCLUDE CMAKE)
|
||||
set(var INSTALL_${p}_DIR)
|
||||
if(NOT IS_ABSOLUTE "${${var}}")
|
||||
set(${var} "${CMAKE_INSTALL_PREFIX}/${${var}}")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# make sure that the default is a RELEASE
|
||||
set(default_build_type "Release")
|
||||
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
||||
message(STATUS "Setting build type to '${default_build_type}' as none was specified.")
|
||||
set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE
|
||||
STRING "Choose the type of build." FORCE)
|
||||
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
|
||||
"Debug" "Release" "MinSizeRel" "RelWithDebInfo")
|
||||
endif()
|
||||
|
||||
if(ENABLE_OPENMP)
|
||||
find_package(OpenMP REQUIRED)
|
||||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
|
||||
add_definitions(-D__LITTLE_ENDIAN__)
|
||||
add_definitions(/Zp8)
|
||||
add_definitions(/wd4146)
|
||||
if(CMAKE_C_FLAGS MATCHES "/W[0-4]")
|
||||
string(REGEX REPLACE "/W[0-4]" "/W1" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCC)
|
||||
add_definitions(-std=c99)
|
||||
add_definitions(-Wno-unused-function)
|
||||
add_definitions(-Wno-long-long)
|
||||
add_definitions(-Wno-variadic-macros)
|
||||
endif()
|
||||
|
||||
if(USE_SSE)
|
||||
add_definitions(-D__SSE2__)
|
||||
set(SSE2_VL_C_FILES "vl/mathop_sse2.c" "vl/imopv_sse2.c")
|
||||
set(SSE2_VL_H_FILES "vl/mathop_sse2.h" "vl/imopv_sse2.h")
|
||||
else()
|
||||
add_definitions(-DVL_DISABLE_SSE2)
|
||||
endif()
|
||||
|
||||
if(USE_AVX)
|
||||
set(AVX_VL_C_FILES "vl/mathop_avx.c")
|
||||
set(AVX_VL_H_FILES "vl/mathop_avx.h")
|
||||
else()
|
||||
add_definitions(-DVL_DISABLE_AVX)
|
||||
endif()
|
||||
|
||||
|
||||
set (C_SOURCES
|
||||
vl/aib.c
|
||||
vl/array.c
|
||||
vl/covdet.c
|
||||
vl/dsift.c
|
||||
vl/fisher.c
|
||||
vl/generic.c
|
||||
vl/getopt_long.c
|
||||
vl/gmm.c
|
||||
vl/hikmeans.c
|
||||
vl/hog.c
|
||||
vl/homkermap.c
|
||||
vl/host.c
|
||||
vl/ikmeans.c
|
||||
vl/imopv.c
|
||||
vl/kdtree.c
|
||||
vl/kmeans.c
|
||||
vl/lbp.c
|
||||
vl/liop.c
|
||||
vl/mathop.c
|
||||
${AVX_VL_C_FILES}
|
||||
${SSE2_VL_C_FILES}
|
||||
vl/mser.c
|
||||
vl/pgm.c
|
||||
vl/quickshift.c
|
||||
vl/random.c
|
||||
vl/rodrigues.c
|
||||
vl/scalespace.c
|
||||
vl/sift.c
|
||||
vl/slic.c
|
||||
vl/stringop.c
|
||||
vl/svm.c
|
||||
vl/svmdataset.c
|
||||
vl/vlad.c
|
||||
)
|
||||
|
||||
set (H_SOURCES
|
||||
vl/aib.h
|
||||
vl/array.h
|
||||
vl/covdet.h
|
||||
vl/dsift.h
|
||||
vl/fisher.h
|
||||
vl/generic.h
|
||||
vl/getopt_long.h
|
||||
vl/gmm.h
|
||||
vl/heap-def.h
|
||||
vl/hikmeans.h
|
||||
vl/hog.h
|
||||
vl/homkermap.h
|
||||
vl/host.h
|
||||
vl/ikmeans.h
|
||||
vl/imopv.h
|
||||
vl/kdtree.h
|
||||
vl/kmeans.h
|
||||
vl/lbp.h
|
||||
vl/liop.h
|
||||
vl/mathop.h
|
||||
${AVX_VL_H_FILES}
|
||||
${SSE2_VL_H_FILES}
|
||||
vl/mser.h
|
||||
vl/pgm.h
|
||||
vl/qsort-def.h
|
||||
vl/quickshift.h
|
||||
vl/random.h
|
||||
vl/rodrigues.h
|
||||
vl/scalespace.h
|
||||
vl/shuffle-def.h
|
||||
vl/sift.h
|
||||
vl/slic.h
|
||||
vl/stringop.h
|
||||
vl/svm.h
|
||||
vl/svmdataset.h
|
||||
vl/vlad.h
|
||||
)
|
||||
|
||||
add_library(vl ${C_SOURCES} ${H_SOURCES})
|
||||
set_property(TARGET vl PROPERTY POSITION_INDEPENDENT_CODE ON)
|
||||
target_compile_definitions(vl PRIVATE -DVL_BUILD_DLL)
|
||||
target_include_directories(vl PUBLIC $<INSTALL_INTERFACE:${RELATIVE_INSTALL_INCLUDE_DIR}> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/vl>)
|
||||
set_target_properties(vl PROPERTIES PUBLIC_HEADER "${H_SOURCES}")
|
||||
|
||||
install(TARGETS vl EXPORT vlfeatTargets
|
||||
RUNTIME DESTINATION "${INSTALL_BIN_DIR}"
|
||||
LIBRARY DESTINATION "${INSTALL_LIB_DIR}"
|
||||
ARCHIVE DESTINATION "${INSTALL_LIB_DIR}"
|
||||
PUBLIC_HEADER DESTINATION "${INSTALL_INCLUDE_DIR}"
|
||||
COMPONENT dev
|
||||
)
|
||||
|
||||
install(EXPORT vlfeatTargets
|
||||
FILE vlfeatConfig.cmake
|
||||
NAMESPACE unofficial::vlfeat::
|
||||
DESTINATION "${INSTALL_CMAKE_DIR}"
|
||||
)
|
||||
79
externals/vcpkg/ports/vlfeat/expose_missing_symbols.patch
vendored
Executable file
79
externals/vcpkg/ports/vlfeat/expose_missing_symbols.patch
vendored
Executable file
@@ -0,0 +1,79 @@
|
||||
diff --git a/vl/generic.c b/vl/generic.c
|
||||
index c6f84a9..8617ed2 100644
|
||||
--- a/vl/generic.c
|
||||
+++ b/vl/generic.c
|
||||
@@ -1513,13 +1513,13 @@ vl_thread_specific_state_delete (VlThreadState * self)
|
||||
*/
|
||||
|
||||
#if (defined(VL_OS_LINUX) || defined(VL_OS_MACOSX)) && defined(VL_COMPILER_GNUC)
|
||||
-static void vl_constructor () __attribute__ ((constructor)) ;
|
||||
-static void vl_destructor () __attribute__ ((destructor)) ;
|
||||
+//static void vl_constructor () __attribute__ ((constructor)) ;
|
||||
+//static void vl_destructor () __attribute__ ((destructor)) ;
|
||||
#endif
|
||||
|
||||
#if defined(VL_OS_WIN)
|
||||
-static void vl_constructor () ;
|
||||
-static void vl_destructor () ;
|
||||
+//static void vl_constructor () ;
|
||||
+//static void vl_destructor () ;
|
||||
|
||||
BOOL WINAPI DllMain(
|
||||
HINSTANCE hinstDLL, // handle to DLL module
|
||||
@@ -1563,7 +1563,7 @@ BOOL WINAPI DllMain(
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
/** @internal @brief Initialize VLFeat state */
|
||||
-static void
|
||||
+void
|
||||
vl_constructor (void)
|
||||
{
|
||||
VlState * state ;
|
||||
@@ -1637,7 +1637,7 @@ vl_constructor (void)
|
||||
}
|
||||
|
||||
/** @internal @brief Destruct VLFeat */
|
||||
-static void
|
||||
+void
|
||||
vl_destructor ()
|
||||
{
|
||||
VlState * state ;
|
||||
diff --git a/vl/generic.h b/vl/generic.h
|
||||
index 4ef87f2..30a974e 100644
|
||||
--- a/vl/generic.h
|
||||
+++ b/vl/generic.h
|
||||
@@ -206,5 +206,7 @@ VL_EXPORT double vl_toc (void) ;
|
||||
VL_EXPORT double vl_get_cpu_time (void) ;
|
||||
/** @} */
|
||||
|
||||
+VL_EXPORT void vl_constructor();
|
||||
+VL_EXPORT void vl_destructor();
|
||||
/* VL_GENERIC_H */
|
||||
#endif
|
||||
diff --git a/vl/sift.c b/vl/sift.c
|
||||
index 03963fe..6477a81 100644
|
||||
--- a/vl/sift.c
|
||||
+++ b/vl/sift.c
|
||||
@@ -1443,7 +1443,7 @@ vl_sift_detect (VlSiftFilt * f)
|
||||
** @remark The minimum octave size is 2x2xS.
|
||||
**/
|
||||
|
||||
-static void
|
||||
+void
|
||||
update_gradient (VlSiftFilt *f)
|
||||
{
|
||||
int s_min = f->s_min ;
|
||||
diff --git a/vl/sift.h b/vl/sift.h
|
||||
index 50e03f4..f9558ad 100644
|
||||
--- a/vl/sift.h
|
||||
+++ b/vl/sift.h
|
||||
@@ -138,7 +138,8 @@ void vl_sift_keypoint_init (VlSiftFilt const *f,
|
||||
double y,
|
||||
double sigma) ;
|
||||
/** @} */
|
||||
-
|
||||
+VL_EXPORT
|
||||
+void update_gradient(VlSiftFilt* f);
|
||||
/** @name Retrieve data and parameters
|
||||
** @{
|
||||
**/
|
||||
33
externals/vcpkg/ports/vlfeat/portfile.cmake
vendored
Executable file
33
externals/vcpkg/ports/vlfeat/portfile.cmake
vendored
Executable file
@@ -0,0 +1,33 @@
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO vlfeat/vlfeat
|
||||
REF 1b9075fc42fe54b42f0e937f8b9a230d8e2c7701
|
||||
SHA512 6d317a1a9496ccac80244553d555fe060b150ccc7ee397a353b64f3a8451f24d1f03d8c00ed04cd9fc2dc066a5c5089b03695c614cb43ffa09be363660278255
|
||||
PATCHES
|
||||
expose_missing_symbols.patch
|
||||
)
|
||||
|
||||
set(USE_SSE ON)
|
||||
set(USE_AVX OFF) # feature is broken, so it's always off anyway
|
||||
|
||||
if(VCPKG_TARGET_ARCHITECTURE MATCHES "arm")
|
||||
set(USE_SSE OFF)
|
||||
set(USE_AVX OFF)
|
||||
endif()
|
||||
|
||||
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
|
||||
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PREFER_NINJA
|
||||
OPTIONS
|
||||
-DUSE_SSE=${USE_SSE}
|
||||
-DUSE_AVX=${USE_AVX}
|
||||
)
|
||||
|
||||
vcpkg_install_cmake()
|
||||
vcpkg_fixup_cmake_targets()
|
||||
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share)
|
||||
|
||||
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
|
||||
7
externals/vcpkg/ports/vlfeat/vcpkg.json
vendored
Executable file
7
externals/vcpkg/ports/vlfeat/vcpkg.json
vendored
Executable file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"name": "vlfeat",
|
||||
"version-string": "2020-07-10",
|
||||
"port-version": 1,
|
||||
"description": "An open library of computer vision algorithms",
|
||||
"homepage": "https://www.vlfeat.org"
|
||||
}
|
||||
Reference in New Issue
Block a user