summaryrefslogtreecommitdiffstats
path: root/src/vidstab-2-lib-type-fix.patch
blob: 1a6f365a06da6278c9034f39f1a595406dce536b (plain)
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
This file is part of MXE.
See index.html for further information.

This patch has been taken from:
https://github.com/georgmartius/vid.stab/pull/20

From f06ce5b7ad4fc60ecf11b86059541c7dc321806c Mon Sep 17 00:00:00 2001
From: Timothy Gu <timothygu99@gmail.com>
Date: Fri, 15 Aug 2014 17:58:49 -0700
Subject: [PATCH] Fix if BUILD_SHARED_LIBS is OFF

The option() disrupts toolchain files.

Signed-off-by: Timothy Gu <timothygu99@gmail.com>
---
 CMakeLists.txt | 26 ++++++++++++--------------
 1 file changed, 12 insertions(+), 14 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index e9a2af4..920a2da 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -12,9 +12,6 @@ set(MINOR_VERSION 0)
 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)
-
 add_definitions( -Wall -O3 -g -Wno-pointer-sign -fPIC -std=gnu99)
 # add_definitions(  -Wall -O0 -g -Wno-pointer-sign )
 
@@ -48,17 +45,18 @@ set(HEADERS src/frameinfo.h src/transformtype.h src/libvidstab.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)
-if(ORC_FOUND)
-target_link_libraries(vidstab ${ORC_LIBRARIES})
-endif()
-if(USE_OMP)
-target_link_libraries(vidstab gomp)
-endif()
+if(BUILD_SHARED_LIBS)
+  #set version of lib
+  set_target_properties(vidstab PROPERTIES SOVERSION ${MAJOR_VERSION}.${MINOR_VERSION})
+
+  target_link_libraries(vidstab m)
+  if(ORC_FOUND)
+    target_link_libraries(vidstab ${ORC_LIBRARIES})
+  endif()
+  if(USE_OMP)
+    target_link_libraries(vidstab gomp)
+  endif()
+endif(BUILD_SHARED_LIBS)
 
 
 #if(!NOHEADERS)
-- 
2.0.3