Skip to content

Commit

Permalink
FIX: modify cmake version name
Browse files Browse the repository at this point in the history
  • Loading branch information
KangLin committed Apr 14, 2020
1 parent 8865ea3 commit e1c3205
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 3 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,13 @@ export(TARGETS ${fdt_lib_name}
)
# Install cmake configure files
install(EXPORT ${fdt_lib_name}Config
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${fdt_lib_name}"
)
write_basic_package_version_file(
"${CMAKE_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
"${CMAKE_BINARY_DIR}/${fdt_lib_name}ConfigVersion.cmake"
VERSION ${BUILD_VERSION}
COMPATIBILITY AnyNewerVersion)
install(FILES "${CMAKE_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake" DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake")
install(FILES "${CMAKE_BINARY_DIR}/${fdt_lib_name}ConfigVersion.cmake" DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${fdt_lib_name}")

# Create demo. OpenCV is requred.
if (DEMO)
Expand Down
35 changes: 35 additions & 0 deletions build_android.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash

if [ -n "$1" ]; then
ANDROID_NDK=$1
fi
if [ -z "${ANDROID_NDK}" ]; then
echo "$0 ANDROID_NDK"
exit -1
fi

if [ -z "${ANDROID_STL}" ]; then
ANDROID_STL=c++_static
fi

if [ ! -d build_android ]; then
mkdir -p build_android
fi
cd build_android

cmake .. -G"Unix Makefiles" -DCMAKE_INSTALL_PREFIX=install \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_VERBOSE_MAKEFILE=TRUE \
-DANDROID_ABI="arm64-v8a" \
-DANDROID_ARM_NEON=ON \
-DANDROID_PLATFORM=android-24 \
-DCMAKE_TOOLCHAIN_FILE=${ANDROID_NDK}/build/cmake/android.toolchain.cmake \
-DANDROID_STL=${ANDROID_STL} \
-DENABLE_NEON=ON \
-DENABLE_AVX2=OFF

cmake --build . --config Release -- -j`cat /proc/cpuinfo |grep 'cpu cores' |wc -l`

cmake --build . --config Release --target install/strip -- -j`cat /proc/cpuinfo |grep 'cpu cores' |wc -l`

cd ..

0 comments on commit e1c3205

Please sign in to comment.