-
Notifications
You must be signed in to change notification settings - Fork 38
/
CMakeLists.txt
59 lines (44 loc) · 1.95 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
cmake_minimum_required(VERSION 2.8)
project(lbp)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++0x")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99")
#set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake-modules)
IF(UNIX)
# add some standard warnings
ADD_DEFINITIONS(-Wno-variadic-macros -Wno-long-long -Wall -Wextra -Winit-self -Woverloaded-virtual -Wsign-promo -Wno-unused-parameter -pedantic -Woverloaded-virtual -Wno-unknown-pragmas)
# -ansi does not compile with sjn module
#ADD_DEFINITIONS(-ansi)
# if you like to have warinings about conversions, e.g. double->int or double->float etc., or float compare
#ADD_DEFINITIONS(-Wconversion -Wfloat-equal)
endif(UNIX)
if(APPLE)
set(CMAKE_MACOSX_RPATH ON)
endif()
find_package(OpenCV REQUIRED)
message(STATUS "OpenCV library status:")
message(STATUS " version: ${OpenCV_VERSION}")
message(STATUS " libraries: ${OpenCV_LIBS}")
message(STATUS " include path: ${OpenCV_INCLUDE_DIRS}")
#if(${OpenCV_VERSION} VERSION_EQUAL 4 OR ${OpenCV_VERSION} VERSION_GREATER 4)
# message (FATAL_ERROR "OpenCV version is not compatible: ${OpenCV_VERSION}")
# message (FATAL_ERROR "Please use OpenCV 2.x or 3.x")
#endif()
file(GLOB sources histogram.cpp)
file(GLOB main Main.cpp)
file(GLOB_RECURSE lbp package_lbp/*.cpp package_lbp/*.c)
file(GLOB_RECURSE lbp_include package_lbp/*.h package_lbp/*.hpp)
include_directories(${CMAKE_SOURCE_DIR})
add_library(lbp SHARED ${sources} ${lbp})
target_link_libraries(lbp ${OpenCV_LIBS})
set_property(TARGET lbp PROPERTY PUBLIC_HEADER ${lbp_include})
add_executable(lbp_bin ${main})
target_link_libraries(lbp_bin ${OpenCV_LIBS} lbp)
set_target_properties(lbp_bin PROPERTIES OUTPUT_NAME lbp)
INSTALL(TARGETS lbp
lbp_bin
RUNTIME DESTINATION bin COMPONENT app
LIBRARY DESTINATION lib COMPONENT runtime
ARCHIVE DESTINATION lib COMPONENT runtime
PUBLIC_HEADER DESTINATION include/package_lbp COMPONENT dev
FRAMEWORK DESTINATION "/Library/Frameworks"
)