forked from georgmartius/vid.stab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
93 lines (71 loc) · 2.49 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
cmake_minimum_required (VERSION 2.6)
project (vid.stab)
SET(CMAKE_BUILTTYPE None)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/CMakeModules/")
include (FindSSE)
set(MAJOR_VERSION 1)
set(MINOR_VERSION 1)
set(PATCH_VERSION 0)
set(VIDSTAB_VERSION ${MAJOR_VERSION}.${MINOR_VERSION}${PATCH_VERSION})
option(BUILD_SHARED_LIBS "build shared libraries instead of static libraries"
ON)
option(USE_OMP "use parallelization use OMP" ON)
# determine lib suffix
get_property(LIB64 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS)
if (LIB64 STREQUAL "TRUE")
set(LIBSUFFIX 64)
else()
set(LIBSUFFIX "")
endif()
add_definitions( -Wall -O3 -g -Wno-pointer-sign -fPIC -std=gnu99)
# add_definitions( -Wall -O0 -g -Wno-pointer-sign )
### ORC is not used in any active code at the moment ###
# I tried it with 0.4.14
# 0.4.10 did not work (not all opcode implemented)
# find_package(Orc)
if(ORC_FOUND)
add_definitions( -DUSE_ORC ${ORC_DEFINITIONS} )
include_directories( ${ORC_INCLUDE_DIRS} )
else()
add_definitions( -DDISABLE_ORC )
endif()
# here we should check for SSE2
# our -DUSE_SSE2_ASM code does not work with fpic
if(SSE2_FOUND)
add_definitions( -DUSE_SSE2 -msse2 -ffast-math )
endif()
if(USE_OMP)
add_definitions(-fopenmp -DUSE_OMP)
endif()
set(SOURCES src/frameinfo.c src/transformtype.c src/libvidstab.c
src/transform.c src/transformfixedpoint.c src/motiondetect.c
src/motiondetect_opt.c src/serialize.c src/localmotion2transform.c
src/boxblur.c src/vsvector.c src/orc/motiondetectorc.c)
set(HEADERS src/frameinfo.h src/transformtype.h src/libvidstab.h
src/transform.h src/motiondetect.h src/serialize.h
src/localmotion2transform.h src/boxblur.h src/vsvector.h )
# Create the vidstab library
add_library (vidstab ${SOURCES})
#set version of lib
set_target_properties(vidstab PROPERTIES SOVERSION ${MAJOR_VERSION}.${MINOR_VERSION})
target_link_libraries(vidstab m)
set(PKG_EXTRA_LIBS -lm)
if(ORC_FOUND)
target_link_libraries(vidstab ${ORC_LIBRARIES})
set(PKG_EXTRA_LIBS "${PKG_EXTRA_LIBS} ${ORC_LIBRARIES}")
endif()
if(USE_OMP)
target_link_libraries(vidstab gomp)
set(PKG_EXTRA_LIBS "${PKG_EXTRA_LIBS} -lgomp")
endif()
#if(!NOHEADERS)
FILE(GLOB HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/src/*.h")
INSTALL(FILES ${HEADERS} DESTINATION include/vid.stab)
#endif()
INSTALL(TARGETS vidstab
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib${LIB_SUFFIX}
ARCHIVE DESTINATION lib${LIB_SUFFIX}
)
include(create_pkgconfig_file)
create_pkgconfig_file(vidstab "Vid.Stab, a library for stabilizing video clips")