armbian-build/extras-buildpkgs/libglshim/debian/patches/add-install-target.patch
2016-09-10 17:31:43 +03:00

57 lines
1.6 KiB
Diff

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 13ac06b..0cd8d0e 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,7 +1,9 @@
-cmake_minimum_required(VERSION 2.6)
+cmake_minimum_required(VERSION 2.9)
project(glshim)
+include(GNUInstallDirs)
+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
@@ -35,8 +37,12 @@ if(USE_DRAWTEX)
add_definitions(-DUSE_DRAWTEX)
endif()
-link_directories(${CMAKE_BINARY_DIR}/lib)
+set(INSTALL_TARGETS_DEFAULT_ARGS RUNTIME DESTINATION "${BIN_INSTALL_DIR}"
+ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}/${PRIVATEDIR}"
+ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}")
+
add_definitions(-g -std=gnu99 -funwind-tables -O3 -fvisibility=hidden)
include_directories(include)
+include_directories(include_mali)
add_subdirectory(src)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 4cb3b30..3d926df 100755
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -16,9 +16,11 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
target_link_libraries(GL X11 m dl)
endif()
-if(CMAKE_SHARED_LIBRARY_SUFFIX MATCHES ".so")
- set_target_properties(GL PROPERTIES SUFFIX ".so.1")
-endif()
+SET_TARGET_PROPERTIES (GL
+ PROPERTIES
+ VERSION 1.2.0
+ SOVERSION 1
+)
aux_source_directory(preload PRELOAD_SOURCES)
add_library(preload SHARED ${PRELOAD_SOURCES})
@@ -27,3 +29,7 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
endif()
add_subdirectory(proxy)
+
+INSTALL(TARGETS GL preload
+ ${INSTALL_TARGETS_DEFAULT_ARGS}
+)