Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify CMake for examples #199

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
189 changes: 189 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
Makefile.Debug
Makefile.Release
*.bak
*~
*.autosave
*.qm
*.user
.CCodec.h.kate-swp
.kdev4/
.kdev_include_paths
build/
build_android/
build_unix_mingw/
build_windows_mingw/
build_unix/
build_windows_msvc/
*.ncb
.metadata/
*~
debug/
bin/
*.class
.deps/
Makefile.in
aclocal.m4
config.guess
config.h
config.h.in
config.h.in~
config.log
config.status
config.sub
configure
depcomp
install-sh
libtool
ltmain.sh
missing
reachmonitor
stamp-h1
.deps/
Makefile.in
aclocal.m4
config.guess
config.h
config.h.in
config.h.in~
config.log
config.status
config.sub
configure
depcomp
install-sh
libtool
ltmain.sh
missing
stamp-h1
*.bak
*.bs
*.la
*.lo
*.ft
*.ft.1
*.made
*.o
*.obj
*.old
*.orig
*.out
*.pdb
*.rej
.libs/
Makefile
*.cdf
*.cache
*.obj
*.ilk
*.resources
*.tlb
*.tli
*.tlh
*.tmp
*.rsp
*.pgc
*.pgd
*.meta
*.tlog
*.manifest
*.res
*.pch
*.exp
*.idb
*.rep
*.xdc
*.pdb
*_manifest.rc
*.bsc
*.sbr
*.opensdf
*.sdf
*.suo
Debug/
release/
Release/
ipch/
IncludeLocalDatabase.txt
ThirdLibrary/unix_mingw/
ThirdLibrary/unix/
ThirdLibrary/unix_static/
ThirdLibrary/android/
ThirdLibrary/android_static/
ThirdLibrary/windows_msvc/
ThirdLibrary/windows_mingw/
ThirdLibrary/src/
ThirdLibrary/windows_mingw_static/
ThirdLibrary/windows_msvc_static/
rabbitim.kdev4
*.pro.user.*
Doxygen/
Doxyfile
android/local.properties
android/gradle.properties
android/gradlew.*

# Compiled Object files
*.slo
*.lo
*.o
*.obj

# Precompiled Headers
*.gch
*.pch

# Compiled Dynamic libraries
*.so
*.dylib
*.dll

# Fortran module files
*.mod

# Compiled Static libraries
*.lai
*.la
*.a
*.lib

# Executables
*.exe
*.out
*.app

# Platform Specifics - auto generated files
PlatformSpecifics/Windows/*.rc

# Visual studio - project files
*.sln
*.suo
*.vcxproj
*.vcxproj.filters
*.vcxproj.user

# Visual Studio - Build Results
[Dd]ebug/
[Rr]elease/
[Mm]in[Ss]ize[Rr]el/
[Rr]el[Ww]ith[Dd]eb[Ii]nfo/

# Visual Studio - Browsing Database File
*.sdf
*.opensdf

#osx xcode
DerivedData/
*.DS_Store
*.build
*.xcodeproj

#CPACK related files
CPackConfig-*.cmake
_CPack_Packages/

#packages
*.tar.gz
*.zip


cmake_uninstall.cmake
49 changes: 49 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
cmake_minimum_required(VERSION 2.8.12)

set (SEETAFACEENGINE_VERSION_MAJOR 4)
set (SEETAFACEENGINE_VERSION_MINOR 5)
set (SEETAFACEENGINE_VERSION_PATCH 0)

# ����Ҫɾ�����ļ�
CONFIGURE_FILE(
"${CMAKE_SOURCE_DIR}/cmake_uninstall.cmake.in"
"${CMAKE_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY)
# ����ɾ��Ŀ��
ADD_CUSTOM_TARGET(uninstall
"${CMAKE_COMMAND}" -P "${CMAKE_BINARY_DIR}/cmake_uninstall.cmake")

# ���ð�װǰ׺
IF(NOT CMAKE_INSTALL_PREFIX)
SET(CMAKE_INSTALL_PREFIX ${PROJECT_BINARY_DIR}/${PROJECT_NAME} CACHE STRING "Install path prefix.")
ENDIF()

# Find Git Version Patch
if(EXISTS "${CMAKE_SOURCE_DIR}/.git")
FIND_PROGRAM(GIT git)
IF(GIT)
EXECUTE_PROCESS(
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMAND ${GIT} rev-parse --short HEAD
OUTPUT_VARIABLE BUILD_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE
)
MESSAGE("Git Version: ${BUILD_VERSION}\n")
ENDIF(GIT)
ENDIF()

IF(MSVC)
# This option is to enable the /MP switch for Visual Studio 2005 and above compilers
OPTION(WIN32_USE_MP "Set to ON to build OpenSceneGraph with the /MP option (Visual Studio 2005 and above)." ON)
MARK_AS_ADVANCED(WIN32_USE_MP)
IF(WIN32_USE_MP)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
ENDIF(WIN32_USE_MP)
ENDIF(MSVC)

add_subdirectory(FaceDetection)
add_subdirectory(FaceAlignment)
add_subdirectory(FaceIdentification)

# Install cmake files
configure_file(SeetaFaceEngineConfig.cmake.in ${CMAKE_BINARY_DIR}/SeetaFaceEngineConfig.cmake @ONLY)
install(FILES ${CMAKE_BINARY_DIR}/SeetaFaceEngineConfig.cmake DESTINATION .)
36 changes: 27 additions & 9 deletions FaceAlignment/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.4)
project(seeta_fa_lib)

# Build options
option(BUILD_EXAMPLES "Set to ON to build examples" ON)
option(BUILD_EXAMPLES "Set to ON to build examples" OFF)

# Use C++11
#set(CMAKE_CXX_STANDARD 11)
Expand All @@ -24,18 +24,36 @@ set(src_files
)

add_library(seeta_fa_lib SHARED ${src_files})
set(fa_required_libs seeta_fa_lib)

# Install target
INSTALL(TARGETS ${PROJECT_NAME}
RUNTIME DESTINATION bin
LIBRARY DESTINATION "lib"
ARCHIVE DESTINATION "lib")
# Install head files
INSTALL(DIRECTORY include DESTINATION ".")
# Install model files
INSTALL(DIRECTORY model DESTINATION ".")

if (BUILD_EXAMPLES)
message(STATUS "Build with examples.")
find_package(OpenCV)
if (NOT OpenCV_FOUND)
message(WARNING "OpenCV not found. Test will not be built.")
else()
include_directories(${OpenCV_INCLUDE_DIRS} build)
link_directories(build)
list(APPEND fa_required_libs ${OpenCV_LIBS} seeta_facedet_lib)
add_executable(fa_test src/test/face_alignment_test.cpp)
target_link_libraries(fa_test ${fa_required_libs})
message(FATAL_ERROR "OpenCV not found. Test will not be built.")
endif()

find_package(SeetaFaceEngine)
if(NOT SEETAFACEENGINE_FOUND)
message(FATAL_ERROR "Please set BUILD_EXAMPLES to OFF and isntall SeetaFaceEngine")
endif()

include_directories(${OpenCV_INCLUDE_DIRS} ${SEETAFACEENGINE_INCLUDE_DIRS})
add_executable(fa_test src/test/face_alignment_test.cpp)
target_link_libraries(fa_test ${OpenCV_LIBS} ${SEETAFACEENGINE_LIBRARIES})

# Install target
INSTALL(TARGETS fa_test RUNTIME DESTINATION bin)
# Install example data
INSTALL(DIRECTORY data DESTINATION ".")

endif()
Loading