File: 0001-Cutomize-CMakeLists.txt.patch

package info (click to toggle)
libosl 0.8.0-4.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,328 kB
  • sloc: cpp: 114,345; ruby: 1,290; ansic: 915; makefile: 431; perl: 309; sh: 35
file content (94 lines) | stat: -rw-r--r-- 3,125 bytes parent folder | download | duplicates (2)
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
94
From 393d80183d91f8b6b4e939a18ef2fdadd75fa45e Mon Sep 17 00:00:00 2001
From: Daigo Moriwaki <daigo@debian.org>
Date: Sun, 4 Dec 2016 11:14:57 +0900
Subject: [PATCH 01/11] Cutomize CMakeLists.txt

---
 CMakeLists.txt | 35 +++++++++++++++++++++++++++++++----
 1 file changed, 31 insertions(+), 4 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 762ec98c5..1d624595c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,5 +1,11 @@
 project (osl CXX)
 
+# To support for multiarch
+# See
+#   - https://cmake.org/cmake/help/v3.3/module/GNUInstallDirs.html
+#   - https://wiki.debian.org/Multiarch/Implementation#CMake
+include(GNUInstallDirs)
+
 # Tweak build mode
 if(NOT CMAKE_BUILD_TYPE)
   set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "" FORCE)
@@ -28,7 +34,7 @@ if(CMAKE_COMPILER_IS_GNUCXX OR MINGW OR APPLE)
   #if(CMAKE_BUILD_RELEASE)
   #        add_definitions(-Werror)
   #endif()
-  add_compile_options(-std=c++11) #CMake 2.8.12 or newer
+  #add_compile_options(-std=c++11) #CMake 2.8.12 or newer
   #add_definitions(-std=c++11) #older than CMake 2.8.11
   set (CMAKE_CXX_FLAGS_DEBUG   "-g -O0 -DDEBUG")
   set (CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
@@ -53,7 +59,7 @@ elseif (APPLE)
 
   set (BOOST_ROOT "/usr/local/Cellar/boost/1.54.0")
 elseif (UNIX)
-  add_compile_options(-march=native)
+  #add_compile_options(-march=native)
 endif()
 
 if (APPLE)
@@ -76,12 +82,12 @@ include_directories ("${PROJECT_SOURCE_DIR}/full")
 
 ## Boost thing
 #set (BOOST_ROOT "$ENV{HOME}/local/boost_1_36_0_binaries/")
-set (Boost_USE_STATIC_LIBS ON)
+#set (Boost_USE_STATIC_LIBS ON)
 set (Boost_USE_MULTITHREADED ON)
 if (MINGW)
   find_package (Boost 1.54.0)
 else()
-  find_package (Boost 1.54.0)
+  find_package (Boost)
 endif()
 if (Boost_FOUND)
   include_directories (${Boost_INCLUDE_DIRS})
@@ -99,11 +105,32 @@ list(REMOVE_ITEM OSL_SRCS ${EXCLUDE_SRCS})
 #message (STATUS "Headers: ${OSL_HEADERS}")
 #message (STATUS "Sources: ${OSL_SRCS}")
 #set (SampleAleriUDF_ALL_SRCS ${SampleAleriUDF_HEADERS} ${SampleAleriUDF_SRCS})
+
 add_library (osl-static STATIC ${OSL_SRCS})
 SET_TARGET_PROPERTIES(osl-static PROPERTIES OUTPUT_NAME "osl")
 SET_TARGET_PROPERTIES(osl-static PROPERTIES PREFIX "lib")
 if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
   add_library (osl SHARED ${OSL_SRCS})
   target_link_libraries (osl ${CMAKE_THREAD_LIBS_INIT})
+  set_target_properties(osl PROPERTIES
+                            VERSION 1.0.0
+                            SOVERSION 1)
 endif()
 
+install(TARGETS osl osl-static
+        RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+        LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+        ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
+
+# Install header files
+install(DIRECTORY "core/osl"
+        DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
+        FILES_MATCHING PATTERN "*.h" PATTERN "*.tcc")
+install(DIRECTORY "std/osl"
+        DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
+        FILES_MATCHING PATTERN "*.h" PATTERN "*.tcc")
+install(DIRECTORY "full/osl"
+        DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
+        FILES_MATCHING PATTERN "*.h" PATTERN "*.tcc")
+
+
-- 
2.33.0