-
Notifications
You must be signed in to change notification settings - Fork 741
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add presets for flandmark 1.07 (pull #9)
- Loading branch information
Showing
12 changed files
with
882 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# CMake toolchain to build flandmark for Android 2.2. Sample usage: | ||
# | ||
# ANDROID_BIN=`pwd`/../android-ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/arm-linux-androideabi \ | ||
# ANDROID_CPP=`pwd`/../android-ndk/sources/cxx-stl/gnu-libstdc++/4.6/ \ | ||
# ANDROID_ROOT=`pwd`/../android-ndk/platforms/android-9/arch-arm/ \ | ||
# cmake -DCMAKE_TOOLCHAIN_FILE=android-arm.cmake -DCMAKE_INSTALL_PREFIX=.. | ||
# | ||
# If you really need to use flandmark on a CPU with no FPU, replace "libs/armeabi-v7a" by "libs/armeabi" and | ||
# "-march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16" with "-march=armv5te -mtune=xscale -msoft-float" | ||
|
||
set(CMAKE_SYSTEM_NAME UnixPaths) | ||
set(CMAKE_SYSTEM_PROCESSOR arm) | ||
set(ANDROID TRUE) | ||
|
||
set(CMAKE_C_COMPILER "$ENV{ANDROID_BIN}-gcc") | ||
set(CMAKE_CXX_COMPILER "$ENV{ANDROID_BIN}-g++") | ||
|
||
set(CMAKE_C_LINK_EXECUTABLE "<CMAKE_C_COMPILER> <FLAGS> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> -nostdlib <LINK_LIBRARIES> -L$ENV{ANDROID_ROOT}/usr/lib/ -lgcc -ldl -lz -lm -lc") | ||
set(CMAKE_CXX_LINK_EXECUTABLE "<CMAKE_CXX_COMPILER> <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> -nostdlib <LINK_LIBRARIES> -L$ENV{ANDROID_CPP}/libs/armeabi-v7a/ -L$ENV{ANDROID_ROOT}/usr/lib/ -lgnustl_static -lgcc -ldl -lz -lm -lc") | ||
|
||
set(CMAKE_C_CREATE_SHARED_LIBRARY "<CMAKE_C_COMPILER> <CMAKE_SHARED_LIBRARY_C_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> <CMAKE_SHARED_LIBRARY_SONAME_C_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> -nostdlib <LINK_LIBRARIES> -L$ENV{ANDROID_ROOT}/usr/lib/ -lgcc -ldl -lz -lm -lc") | ||
set(CMAKE_CXX_CREATE_SHARED_LIBRARY "<CMAKE_CXX_COMPILER> <CMAKE_SHARED_LIBRARY_CXX_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> -nostdlib <LINK_LIBRARIES> -L$ENV{ANDROID_CPP}/libs/armeabi-v7a/ -L$ENV{ANDROID_ROOT}/usr/lib/ -lgnustl_static -lgcc -ldl -lz -lm -lc") | ||
|
||
add_definitions("-DANDROID -fPIC -ffunction-sections -funwind-tables -fstack-protector -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -fomit-frame-pointer -fstrict-aliasing -funswitch-loops -finline-limit=300") | ||
|
||
include_directories("$ENV{ANDROID_CPP}/include/" "$ENV{ANDROID_CPP}/libs/armeabi-v7a/include/" "$ENV{ANDROID_ROOT}/usr/include/") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# CMake toolchain to build flandmark for Android 2.2. Sample usage: | ||
# | ||
# ANDROID_BIN=`pwd`/../android-ndk/toolchains/x86-4.6/prebuilt/linux-x86_64/bin/i686-linux-android \ | ||
# ANDROID_CPP=`pwd`/../android-ndk/sources/cxx-stl/gnu-libstdc++/4.6/ \ | ||
# ANDROID_ROOT=`pwd`/../android-ndk/platforms/android-9/arch-x86/ \ | ||
# cmake -DCMAKE_TOOLCHAIN_FILE=android-x86.cmake -DCMAKE_INSTALL_PREFIX=.. | ||
|
||
set(CMAKE_SYSTEM_NAME UnixPaths) | ||
set(CMAKE_SYSTEM_PROCESSOR atom) | ||
set(ANDROID TRUE) | ||
|
||
set(CMAKE_C_COMPILER "$ENV{ANDROID_BIN}-gcc") | ||
set(CMAKE_CXX_COMPILER "$ENV{ANDROID_BIN}-g++") | ||
|
||
set(CMAKE_C_LINK_EXECUTABLE "<CMAKE_C_COMPILER> <FLAGS> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> -nostdlib <LINK_LIBRARIES> -L$ENV{ANDROID_ROOT}/usr/lib/ -lgcc -ldl -lz -lm -lc") | ||
set(CMAKE_CXX_LINK_EXECUTABLE "<CMAKE_CXX_COMPILER> <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> -nostdlib <LINK_LIBRARIES> -L$ENV{ANDROID_CPP}/libs/x86/ -L$ENV{ANDROID_ROOT}/usr/lib/ -lgnustl_static -lgcc -ldl -lz -lm -lc") | ||
|
||
set(CMAKE_C_CREATE_SHARED_LIBRARY "<CMAKE_C_COMPILER> <CMAKE_SHARED_LIBRARY_C_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> <CMAKE_SHARED_LIBRARY_SONAME_C_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> -nostdlib <LINK_LIBRARIES> -L$ENV{ANDROID_ROOT}/usr/lib/ -lgcc -ldl -lz -lm -lc") | ||
set(CMAKE_CXX_CREATE_SHARED_LIBRARY "<CMAKE_CXX_COMPILER> <CMAKE_SHARED_LIBRARY_CXX_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> -nostdlib <LINK_LIBRARIES> -L$ENV{ANDROID_CPP}/libs/x86/ -L$ENV{ANDROID_ROOT}/usr/lib/ -lgnustl_static -lgcc -ldl -lz -lm -lc") | ||
|
||
add_definitions("-DANDROID -fPIC -ffunction-sections -funwind-tables -fstack-protector -mtune=atom -mssse3 -mfpmath=sse -fomit-frame-pointer -fstrict-aliasing -funswitch-loops -finline-limit=300") | ||
|
||
include_directories("$ENV{ANDROID_CPP}/include/" "$ENV{ANDROID_CPP}/libs/x86/include/" "$ENV{ANDROID_ROOT}/usr/include/") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,66 @@ | ||
#!/bin/sh | ||
if [[ -z "$PLATFORM" ]]; then | ||
echo "This file is meant to be included by the parent cppbuild.sh script" | ||
exit 1 | ||
fi | ||
|
||
# FLANDMARK_VERSION=a0981a3b09cc5534255dc1dcdae2179097231bdd | ||
# download https://github.com/uricamic/flandmark/archive/$FLANDMARK_VERSION.zip flandmark.zip | ||
|
||
# unzip -o flandmark.zip -d flandmark/sources | ||
FLANDMARK_VERSION=master | ||
download https://github.com/uricamic/flandmark/archive/$FLANDMARK_VERSION.zip flandmark-$FLANDMARK_VERSION.zip | ||
|
||
mkdir -p $PLATFORM | ||
cd $PLATFORM | ||
INSTALL_PATH=`pwd` | ||
mkdir -p include lib bin | ||
unzip -o ../flandmark-$FLANDMARK_VERSION.zip | ||
cd flandmark-$FLANDMARK_VERSION | ||
|
||
mkdir -p include | ||
cp -r ../flandmark/sources/libflandmark/flandmark_detector.h include | ||
cp -r ../flandmark/sources/libflandmark/msvc-compat.h include | ||
cp -r ../../../opencv/cppbuild/$PLATFORM/include/opencv/cv.h include | ||
cp -r ../../../opencv/cppbuild/$PLATFORM/include/opencv/cvaux.h include | ||
cp -r ../../../opencv/cppbuild/$PLATFORM/include/opencv2/ include | ||
|
||
mkdir -p bin | ||
cp -r ../flandmark/build/x64/libflandmark/RelWithDebInfo/flandmark_shared.dll bin | ||
cp -r ../../../opencv/cppbuild/$PLATFORM/bin/* bin | ||
OPENCV_PATH=$INSTALL_PATH/../../../opencv/cppbuild/$PLATFORM/ | ||
|
||
mkdir -p lib | ||
cp -r ../flandmark/build/x64/libflandmark/RelWithDebInfo/flandmark_static.lib lib | ||
cp -r ../../../opencv/cppbuild/$PLATFORM/lib/* lib | ||
case $PLATFORM in | ||
android-arm) | ||
cmake -DCMAKE_TOOLCHAIN_FILE=$INSTALL_PATH/../../android-arm.cmake -DCMAKE_BUILD_TYPE=Release -DOpenCV_DIR=$OPENCV_PATH/sdk/native/jni/ -DANDROID_NDK_ABI_NAME=armeabi_v7a | ||
make -j4 flandmark_static | ||
cp libflandmark/*.h ../include | ||
cp libflandmark/*.a ../lib | ||
;; | ||
android-x86) | ||
cmake -DCMAKE_TOOLCHAIN_FILE=$INSTALL_PATH/../../android-x86.cmake -DCMAKE_BUILD_TYPE=Release -DOpenCV_DIR=$OPENCV_PATH/sdk/native/jni/ -DANDROID_NDK_ABI_NAME=x86 | ||
make -j4 flandmark_static | ||
cp libflandmark/*.h ../include | ||
cp libflandmark/*.a ../lib | ||
;; | ||
linux-x86) | ||
CC="gcc -m32" CXX="g++ -m32" cmake -DCMAKE_BUILD_TYPE=Release -DOpenCV_DIR=$OPENCV_PATH/share/OpenCV/ | ||
make -j4 flandmark_static | ||
cp libflandmark/*.h ../include | ||
cp libflandmark/*.a ../lib | ||
;; | ||
linux-x86_64) | ||
CC="gcc -m64" CXX="g++ -m64" cmake -DCMAKE_BUILD_TYPE=Release -DOpenCV_DIR=$OPENCV_PATH/share/OpenCV/ | ||
make -j4 flandmark_static | ||
cp libflandmark/*.h ../include | ||
cp libflandmark/*.a ../lib | ||
;; | ||
macosx-x86_64) | ||
cmake -DCMAKE_BUILD_TYPE=Release -DOpenCV_DIR=$OPENCV_PATH/share/OpenCV/ | ||
make -j4 flandmark_static | ||
cp libflandmark/*.h ../include | ||
cp libflandmark/*.a ../lib | ||
;; | ||
windows-x86) | ||
cmake -DCMAKE_BUILD_TYPE=Release -DOpenCV_DIR=$OPENCV_PATH/opencv/build/ | ||
nmake flandmark_static | ||
cp libflandmark/*.h ../include | ||
cp libflandmark/*.lib ../lib | ||
;; | ||
windows-x86_64) | ||
cmake -DCMAKE_BUILD_TYPE=Release -DOpenCV_DIR=$OPENCV_PATH/opencv/build/ | ||
nmake flandmark_static | ||
cp libflandmark/*.h ../include | ||
cp libflandmark/*.lib ../lib | ||
;; | ||
*) | ||
echo "Error: Platform \"$PLATFORM\" is not supported" | ||
;; | ||
esac | ||
|
||
cd .. | ||
cd ../.. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.