Imported Debian version 1.0~trusty
[deb_vid.stab.git] / CMakeLists.txt
CommitLineData
80f575fc
DM
1cmake_minimum_required (VERSION 2.6)
2project (vid.stab)
3
4SET(CMAKE_BUILTTYPE None)
5
6set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/CMakeModules/")
7
8include (FindSSE)
9
10set(MAJOR_VERSION 1)
11set(MINOR_VERSION 0)
12set(PATCH_VERSION 0)
13set(VIDSTAB_VERSION ${MAJOR_VERSION}.${MINOR_VERSION}${PATCH_VERSION})
14
15option(BUILD_SHARED_LIBS "build shared libraries instead of static libraries"
16 ON)
17
18add_definitions( -Wall -O3 -g -Wno-pointer-sign -fPIC -std=gnu99)
19# add_definitions( -Wall -O0 -g -Wno-pointer-sign )
20
21### ORC is not used in any active code at the moment ###
22# I tried it with 0.4.14
23# 0.4.10 did not work (not all opcode implemented)
24# find_package(Orc)
25if(ORC_FOUND)
26add_definitions( -DUSE_ORC ${ORC_DEFINITIONS} )
27include_directories( ${ORC_INCLUDE_DIRS} )
28else()
29add_definitions( -DDISABLE_ORC )
30endif()
31
32# here we should check for SSE2
33# our -DUSE_SSE2_ASM code does not work with fpic
34if(SSE2_FOUND)
35add_definitions( -DUSE_SSE2 -msse2 -ffast-math )
36endif()
37
38set(SOURCES src/frameinfo.c src/transformtype.c src/libvidstab.c
39 src/transform.c src/transformfixedpoint.c src/motiondetect.c
40 src/motiondetect_opt.c src/serialize.c src/localmotion2transform.c
41 src/boxblur.c src/vsvector.c src/orc/motiondetectorc.c)
42
43set(HEADERS src/frameinfo.h src/transformtype.h src/libvidstab.h
44 src/transform.h src/motiondetect.h src/serialize.h
45 src/localmotion2transform.h src/boxblur.h src/vsvector.h )
46
47
48# Create the vidstab library
49add_library (vidstab ${SOURCES})
50
51#set version of lib
52set_target_properties(vidstab PROPERTIES SOVERSION ${MAJOR_VERSION}.${MINOR_VERSION})
53
54
55target_link_libraries(vidstab m)
56if(ORC_FOUND)
57target_link_libraries(vidstab ${ORC_LIBRARIES})
58endif()
59if(USE_OMP)
60target_link_libraries(vidstab gomp)
61endif()
62
63
64#if(!NOHEADERS)
65FILE(GLOB HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/src/*.h")
66INSTALL(FILES ${HEADERS} DESTINATION include/vid.stab)
67#endif()
68
69INSTALL(TARGETS vidstab
70 RUNTIME DESTINATION bin
71 LIBRARY DESTINATION lib${LIB_SUFFIX}
72 ARCHIVE DESTINATION lib${LIB_SUFFIX}
73)
74
75include(create_pkgconfig_file)
76create_pkgconfig_file(vidstab "Vid.Stab, a library for stabilizing video clips")