Files
MINGW-packages/mingw-w64-hlsl2glsl-git/0004-CMake-Handle-installation.patch
Christoph Reiter 4d8828efed Make pkgbase of all packages match the name of the PKGBUILD directory (#2878)
This either changes the pkgbase to match the directory name
or the other way around.

The motivation for this is to make it possible to automatically generate
an URL to the PKGBUILD file from the package information alone.
2017-09-12 14:25:41 +03:00

52 lines
1.9 KiB
Diff

From 3554bdeaed2b0fe4e8fdff83fd509ab1143b1cdd Mon Sep 17 00:00:00 2001
From: Ray Donnelly <mingw.android@gmail.com>
Date: Wed, 22 Jul 2015 15:39:03 +0100
Subject: [PATCH 4/4] CMake: Handle installation
---
CMakeLists.txt | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index dc30cd5..fcc78e9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -208,6 +208,7 @@ add_library(hlsl2glsl
${MACHINE_INDEPENDENT_GENERATED_SOURCE_FILES}
)
+set_property(TARGET hlsl2glsl PROPERTY PUBLIC_HEADER include/hlsl2glsl.h)
include_directories(
${INCLUDE_FILES}
@@ -215,3 +216,26 @@ include_directories(
add_executable(hlsl2glsltest tests/hlsl2glsltest/hlsl2glsltest.cpp)
target_link_libraries(hlsl2glsltest hlsl2glsl ${TEST_LIBS})
+
+# <taken from>
+# http://www.cmake.org/pipermail/cmake/2010-February/035466.html
+# compute default library install dir
+set (_DEFAULT_LIBRARY_INSTALL_DIR lib)
+if (EXISTS "${CMAKE_INSTALL_PREFIX}/lib32/" AND CMAKE_SIZEOF_VOID_P EQUAL 4)
+ set (_DEFAULT_LIBRARY_INSTALL_DIR lib32)
+elif (EXISTS "${CMAKE_INSTALL_PREFIX}/lib64/" AND CMAKE_SIZEOF_VOID_P EQUAL 8)
+ set (_DEFAULT_LIBRARY_INSTALL_DIR lib64)
+endif ()
+# the library install dir
+set(LIBRARY_INSTALL_DIR "${_DEFAULT_LIBRARY_INSTALL_DIR}" CACHE PATH "Installation directory for libraries")
+# make the library install dir an absolute path (can be important e.g. when using CONFIGURE_FILE to embed
+# the library installation directory into a file)
+if(NOT IS_ABSOLUTE "${LIBRARY_INSTALL_DIR}")
+ set(LIBRARY_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${LIBRARY_INSTALL_DIR}")
+endif()
+# </taken from>
+
+install(TARGETS hlsl2glsl PUBLIC_HEADER
+ ARCHIVE DESTINATION "${LIBRARY_INSTALL_DIR}"
+ RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin"
+ PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_PREFIX}/include")
--
2.5.0