summaryrefslogtreecommitdiffstats
path: root/src/chipmunk-1-lib.patch
blob: a98a87cfe588aa47cfa7354255ed65ecace6caec (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
This file is part of MXE.
See index.html for further information.

Taken from https://github.com/slembcke/Chipmunk2D/pull/87.

From e3f2b8aa221170988b9349cdce161fe0f109109b Mon Sep 17 00:00:00 2001
From: Timothy Gu <timothygu99@gmail.com>
Date: Thu, 4 Sep 2014 20:23:24 -0700
Subject: [PATCH] build: Make lib and executable install path settable

Also changes DLL install dir to bin/ and install DLL import libs.
---
 CMakeLists.txt     | 6 ++++++
 src/CMakeLists.txt | 6 ++++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 863afc0..4c99925 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -15,6 +15,12 @@ if(NOT CMAKE_BUILD_TYPE)
       FORCE)
 endif()
 
+# to manually select install locations of libraries and executables
+#   -D LIB_INSTALL_DIR mylib
+#   -D BIN_INSTALL_DIR newbin
+set(LIB_INSTALL_DIR lib CACHE STRING "Install location of libraries")
+set(BIN_INSTALL_DIR bin CACHE STRING "Install location of executables")
+
 # other options for the build, you can i.e. activate the shared library by passing
 #   -D BUILD_SHARED=ON
 # to cmake. Other options analog
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 2e817ea..633a101 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -22,7 +22,9 @@ if(BUILD_SHARED)
 	  # need to explicitly link to the math library because the CMake/Android toolchains may not do it automatically
 	  target_link_libraries(chipmunk m)
   endif(ANDROID)
-  install(TARGETS chipmunk RUNTIME DESTINATION lib LIBRARY DESTINATION lib)
+  install(TARGETS chipmunk RUNTIME DESTINATION ${BIN_INSTALL_DIR}
+                           LIBRARY DESTINATION ${LIB_INSTALL_DIR}
+                           ARCHIVE DESTINATION ${LIB_INSTALL_DIR})
 endif(BUILD_SHARED)
 
 if(BUILD_STATIC)
@@ -37,7 +39,7 @@ if(BUILD_STATIC)
   # Sets chipmunk_static to output "libchipmunk.a" not "libchipmunk_static.a"
   set_target_properties(chipmunk_static PROPERTIES OUTPUT_NAME chipmunk)
   if(INSTALL_STATIC)
-    install(TARGETS chipmunk_static ARCHIVE DESTINATION lib)
+    install(TARGETS chipmunk_static ARCHIVE DESTINATION ${LIB_INSTALL_DIR})
   endif(INSTALL_STATIC)
 endif(BUILD_STATIC)
 
-- 
1.8.3.2