1 | PROJECT(FlairVisionFilter)
|
---|
2 | cmake_minimum_required(VERSION 2.8)
|
---|
3 | include($ENV{FLAIR_ROOT}/flair-dev/cmake-modules/GlobalCmakeFlair.cmake)
|
---|
4 |
|
---|
5 | if(NOT "${CMAKE_SYSTEM_PROCESSOR_DEFAULTTUNE}" MATCHES "armv5te")
|
---|
6 |
|
---|
7 | find_package(LibXml2 REQUIRED)
|
---|
8 |
|
---|
9 | execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion
|
---|
10 | OUTPUT_VARIABLE GCC_VERSION)
|
---|
11 |
|
---|
12 | if (GCC_VERSION VERSION_GREATER 4.3 OR GCC_VERSION VERSION_EQUAL 4.3)
|
---|
13 | if (GCC_VERSION VERSION_GREATER 4.7 OR GCC_VERSION VERSION_EQUAL 4.7)
|
---|
14 | ADD_DEFINITIONS("-std=c++11")
|
---|
15 | else()
|
---|
16 | ADD_DEFINITIONS("-std=c++0x")
|
---|
17 | endif()
|
---|
18 | else()
|
---|
19 | message(STATUS "GCC version < 4.3, c+11 is not supported!")
|
---|
20 | endif()
|
---|
21 |
|
---|
22 | INCLUDE_DIRECTORIES(
|
---|
23 | ${LIBXML2_INCLUDE_DIR}
|
---|
24 | ${CMAKE_CURRENT_SOURCE_DIR}/src
|
---|
25 | ${CMAKE_CURRENT_SOURCE_DIR}/src/unexported
|
---|
26 | ${CMAKE_CURRENT_SOURCE_DIR}/../FlairCore/src
|
---|
27 | ${CMAKE_CURRENT_SOURCE_DIR}/../FlairFilter/src
|
---|
28 | ${CMAKE_SYSROOT}/usr/include/opencv1
|
---|
29 | )
|
---|
30 |
|
---|
31 | FILE(GLOB SRC_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp")
|
---|
32 |
|
---|
33 | SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
|
---|
34 |
|
---|
35 | ADD_LIBRARY(${PROJECT_NAME}
|
---|
36 | ${SRC_SRC}
|
---|
37 | )
|
---|
38 |
|
---|
39 | INSTALL(TARGETS ${PROJECT_NAME}
|
---|
40 | LIBRARY DESTINATION $ENV{FLAIR_ROOT}/flair-bin/lib/${ARCH_DIR}
|
---|
41 | ARCHIVE DESTINATION $ENV{FLAIR_ROOT}/flair-bin/lib/${ARCH_DIR}
|
---|
42 | )
|
---|
43 |
|
---|
44 | FILE(GLOB HEADER_FILES "${CMAKE_CURRENT_SOURCE_DIR}/src/*.h")
|
---|
45 | INSTALL(FILES ${HEADER_FILES} DESTINATION $ENV{FLAIR_ROOT}/flair-dev/include/${PROJECT_NAME})
|
---|
46 |
|
---|
47 | add_custom_target(
|
---|
48 | compile_info
|
---|
49 | COMMAND $ENV{FLAIR_ROOT}/flair-dev/scripts/compile_info.sh ${CMAKE_C_COMPILER} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src/unexported/compile_info.h
|
---|
50 | )
|
---|
51 |
|
---|
52 | add_dependencies(${PROJECT_NAME} compile_info)
|
---|
53 |
|
---|
54 | else()
|
---|
55 | if(DEFINED CMAKE_SYSTEM_PROCESSOR_DEFAULTTUNE)
|
---|
56 | warn("${PROJECT_NAME} will not be built for ${CMAKE_SYSTEM_PROCESSOR_DEFAULTTUNE} architecture")
|
---|
57 | else()
|
---|
58 | warn("${PROJECT_NAME} will not be built for ${CMAKE_SYSTEM_PROCESSOR} architecture")
|
---|
59 | endif()
|
---|
60 | endif()
|
---|