diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 000000000..8b2dd03cd --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,5 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) +PROJECT(SeetaFaceEngine) +ADD_SUBDIRECTORY(FaceDetection) +ADD_SUBDIRECTORY(FaceAlignment) +ADD_SUBDIRECTORY(FaceIdentification) diff --git a/FaceAlignment/CMakeLists.txt b/FaceAlignment/CMakeLists.txt index e5321aa73..5e15fc959 100644 --- a/FaceAlignment/CMakeLists.txt +++ b/FaceAlignment/CMakeLists.txt @@ -14,7 +14,7 @@ message(STATUS "C++11 support has been enabled by default.") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse4.1") -include_directories(include) +include_directories(include ${seeta_facedet_lib_INCLUDE_DIRS}) set(src_files src/cfan.cpp @@ -38,3 +38,10 @@ if (BUILD_EXAMPLES) target_link_libraries(fa_test ${fa_required_libs}) endif() endif() + +# Expose B's public includes (including Boost transitively) to other +# subprojects through cache variable. +# Reference: http://stackoverflow.com/questions/16398937 +set(${PROJECT_NAME}_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/include + ${seeta_facedet_lib_INCLUDE_DIRS} + CACHE INTERNAL "${PROJECT_NAME}: Include Directories" FORCE) diff --git a/FaceDetection/CMakeLists.txt b/FaceDetection/CMakeLists.txt index 671c3f281..aeea937e3 100644 --- a/FaceDetection/CMakeLists.txt +++ b/FaceDetection/CMakeLists.txt @@ -65,3 +65,10 @@ if (BUILD_EXAMPLES) target_link_libraries(facedet_test ${facedet_required_libs}) endif() endif() + +# Expose B's public includes (including Boost transitively) to other +# subprojects through cache variable. +# Reference: http://stackoverflow.com/questions/16398937 +set(${PROJECT_NAME}_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/include + ${OpenCV_INCLUDE_DIRS} + CACHE INTERNAL "${PROJECT_NAME}: Include Directories" FORCE) diff --git a/FaceIdentification/src/test/CMakeLists.txt b/FaceIdentification/src/test/CMakeLists.txt index c1170904c..6ced8f146 100644 --- a/FaceIdentification/src/test/CMakeLists.txt +++ b/FaceIdentification/src/test/CMakeLists.txt @@ -4,11 +4,13 @@ message(${SRC_LIST}) # add external libraries find_package(OpenCV REQUIRED) +include_directories(${seeta_facedet_lib_INCLUDE_DIRS} ${seeta_fa_lib_INCLUDE_DIRS}) +list(APPEND seeta_fi_lib_required_libs ${OpenCV_LIBS} seeta_facedet_lib seeta_fa_lib) enable_testing () foreach (f ${SRC_LIST}) string(REGEX REPLACE "[.]cpp" ".bin" BIN ${f}) add_executable(${BIN} ${f}) - target_link_libraries(${BIN} viplnet ${OpenCV_LIBS}) + target_link_libraries(${BIN} viplnet ${seeta_fi_lib_required_libs}) endforeach () diff --git a/FaceIdentification/src/test/test_face_recognizer.cpp b/FaceIdentification/src/test/test_face_recognizer.cpp index cc288692e..7dcebf959 100644 --- a/FaceIdentification/src/test/test_face_recognizer.cpp +++ b/FaceIdentification/src/test/test_face_recognizer.cpp @@ -62,6 +62,9 @@ using namespace std; #endif //__unix +#include +#include +#include #include #include diff --git a/FaceIdentification/src/test/test_face_verification.cpp b/FaceIdentification/src/test/test_face_verification.cpp index b30dc4127..edba6c06a 100644 --- a/FaceIdentification/src/test/test_face_verification.cpp +++ b/FaceIdentification/src/test/test_face_verification.cpp @@ -61,6 +61,9 @@ using namespace std; #endif //__unix +#include +#include +#include #include #include #include "face_identification.h" diff --git a/README.md b/README.md index 1d00ccf1c..0326cd1c3 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,19 @@ This face recognition engine is developed by Visual Information Processing and Learning (VIPL) group, Institute of Computing Technology, Chinese Academy of Sciences. The codes are written in C++ without dependence on any 3rd-party libraries. The open source is now released under BSD-2 license (see [LICENSE](LICENSE) for details), which means the codes can be used freely for both acedemic purpose and industrial products. +### Compile + +#### Linux & Mac OS + +Change current working directory to `SeetaFaceEngine` and run the following command: + +``` +mkdir build +cd build +cmake .. && make +``` + + ### Contact Info If you have any problem on SeetaFace Engine, please contact us by sending email to SeetaFace@vipl.ict.ac.cn. @@ -23,4 +36,4 @@ If you have any problem on SeetaFace Engine, please contact us by sending email * [SeetaFace Detection](./FaceDetection/README.md) * [SeetaFace Alignment](./FaceAlignment/README.md) -* [SeetaFace Identification](./FaceIdentification/README.md) \ No newline at end of file +* [SeetaFace Identification](./FaceIdentification/README.md)