-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathopensim-core.patch
222 lines (198 loc) · 8.21 KB
/
opensim-core.patch
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
From bd7834c5674d3df0a044231302ae2c3674dee2d7 Mon Sep 17 00:00:00 2001
From: Christopher Dembia <[email protected]>
Date: Mon, 7 Apr 2014 22:06:08 -0700
Subject: [PATCH 1/3] Detach output of JavaWrap from GUI.
---
OpenSim/Wrapping/Java/OpenSimJNI/CMakeLists.txt | 47 +++++++++++++++++++------
1 file changed, 36 insertions(+), 11 deletions(-)
diff --git a/OpenSim/Wrapping/Java/OpenSimJNI/CMakeLists.txt b/OpenSim/Wrapping/Java/OpenSimJNI/CMakeLists.txt
index 13bf0f4..5eee042 100644
--- a/OpenSim/Wrapping/Java/OpenSimJNI/CMakeLists.txt
+++ b/OpenSim/Wrapping/Java/OpenSimJNI/CMakeLists.txt
@@ -9,17 +9,39 @@ INCLUDE(${CMAKE_ROOT}/Modules/FindJNI.cmake)
IF(JAVA_INCLUDE_PATH)
# Run command to generate OpenSimJNI_wrap.cxx
-SET(swig_generated_file_fullname ${OpenSim_SOURCE_DIR}/OpenSim/Wrapping/Java/OpenSimJNI/OpenSimJNI_wrap.cxx)
-SET(swig_interface_file_fullname ${OpenSim_SOURCE_DIR}/OpenSim/Wrapping/Java/swig/javaWrapOpenSim.i)
-SET(SWIG_OUTPUT_DIR ${OpenSim_SOURCE_DIR}/Gui/opensim/modeling/src
- CACHE PATH
- "Directory, under which to generate .java files")
-
-SET(SimTK_INCLUDE_PATH ${SIMTK_INCLUDE_DIR})
-
-ADD_CUSTOM_TARGET(JavaWrap ${SWIG_EXECUTABLE} -v -c++ -java -package org.opensim.modeling -I${OpenSim_SOURCE_DIR} -I${Simbody_INCLUDE_DIR} -I${OpenSim_SOURCE_DIR}/OpenSim/Wrapping
- -o ${swig_generated_file_fullname} -outdir ${SWIG_OUTPUT_DIR}/org/opensim/modeling ${swig_interface_file_fullname})
-SET_TARGET_PROPERTIES(JavaWrap PROPERTIES PROJECT_LABEL "Java Bindings - Generate")
+SET(swig_generated_file_fullname
+ ${CMAKE_CURRENT_BINARY_DIR}/OpenSimJNI_wrap.cxx)
+SET(swig_interface_file_fullname
+ ${OpenSim_SOURCE_DIR}/OpenSim/Wrapping/Java/swig/javaWrapOpenSim.i)
+SET(OPENSIM_JAVA_WRAPPING_PACKAGE "org.opensim.modeling"
+ CACHE STRING
+ "The wrapping is built as the Java package specified in this variable.")
+
+# Syntax for find-replace:
+# STRING(REGEX REPLACE <pattern> <replacement string>
+# <target variable> <source string>)
+STRING(REGEX REPLACE "\\." "/"
+ SWIG_JAVA_PACKAGE_PATH ${OPENSIM_JAVA_WRAPPING_PACKAGE})
+
+SET(SWIG_JAVA_SOURCE_BUILD_OUTPUT_DIR
+ ${CMAKE_CURRENT_BINARY_DIR}/src/${SWIG_JAVA_PACKAGE_PATH})
+
+# We place the .java files in this folder.
+EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E make_directory
+ ${SWIG_JAVA_SOURCE_BUILD_OUTPUT_DIR})
+
+SET(SimTK_INCLUDE_PATH ${SIMTK_INCLUDE_DIR})
+
+ADD_CUSTOM_TARGET(JavaWrap ${SWIG_EXECUTABLE} -v -c++ -java
+ -package ${OPENSIM_JAVA_WRAPPING_PACKAGE}
+ -I${OpenSim_SOURCE_DIR}
+ -I${Simbody_INCLUDE_DIR}
+ -I${OpenSim_SOURCE_DIR}/OpenSim/Wrapping
+ -o ${swig_generated_file_fullname}
+ -outdir ${SWIG_JAVA_SOURCE_BUILD_OUTPUT_DIR}
+ ${swig_interface_file_fullname})
+SET_TARGET_PROPERTIES(JavaWrap PROPERTIES
+ PROJECT_LABEL "Java Bindings - Generate")
FILE(GLOB SOURCE_FILES OpenSimContext.cpp)
@@ -60,6 +82,9 @@ ELSE()
ARCHIVE DESTINATION sdk/lib)
ENDIF()
+INSTALL(DIRECTORY ${SWIG_JAVA_SOURCE_BUILD_OUTPUT_DIR}
+ DESTINATION sdk/Java)
+
IF(BUILD_TESTING)
SUBDIRS(Test)
ENDIF(BUILD_TESTING)
--
1.8.3.2
From a26edbe0e8ce3889397bc6b8f0da64740e2b74ee Mon Sep 17 00:00:00 2001
From: Christopher Dembia <[email protected]>
Date: Mon, 7 Apr 2014 09:46:37 -0700
Subject: [PATCH 2/3] Clear CMake of Gui, CFSQP, Models, installer.
---
CMakeLists.txt | 54 +++-----------------------------------------------
Vendors/CMakeLists.txt | 10 +---------
2 files changed, 4 insertions(+), 60 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 34c6f8d..b68f41e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -381,13 +381,6 @@ ENDFOREACH()
INSTALL(DIRECTORY ${Simbody_INCLUDE_DIR} DESTINATION sdk/include/SimTK
PATTERN ".svn" EXCLUDE)
-SET(OPENSIM_INSTALL_PACKAGE_BUILD OFF CACHE BOOL "Build an installer (to post on simtk.org)")
-MARK_AS_ADVANCED(OPENSIM_INSTALL_PACKAGE_BUILD)
-IF(OPENSIM_INSTALL_PACKAGE_BUILD)
-IF(WIN32)
- SET(VTK_LIB_DIR ${OpenSim_SOURCE_DIR}/Vendors/vtk_dll/${PLATFORM_ABI}/ CACHE PATH "Prebuilt VTK-shared libraries")
-ENDIF(WIN32)
-ENDIF(OPENSIM_INSTALL_PACKAGE_BUILD)
IF(NOT LIBRARY_OUTPUT_PATH)
SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/${VCVERSION} CACHE INTERNAL "Single output directory for building all libraries.")
@@ -467,18 +460,6 @@ INSTALL(PROGRAMS ${THIRDPARTY_BIN_FILES}
INSTALL(FILES ${THIRDPARTY_LIB_FILES} DESTINATION lib)
INSTALL(FILES ${THIRDPARTY_SDKLIB_FILES} DESTINATION sdk/lib)
-## These INSTALL commands should go into proper subdirectories
-IF(WIN32)
- IF(OPENSIM_INSTALL_PACKAGE_BUILD)
- # Install windows runtime libraries to support prebuilt libraries
- # and redistributable
- INSTALL_FILES(/bin/ FILES
- ${OpenSim_SOURCE_DIR}/Vendors/vtk_dll/msvcr71.dll
- ${OpenSim_SOURCE_DIR}/Vendors/vtk_dll/msvcp71.dll)
-
- ENDIF(OPENSIM_INSTALL_PACKAGE_BUILD)
-ENDIF(WIN32)
-
## The following are required to uses Dart and the Cdash dashboard per Jesse
ENABLE_TESTING()
@@ -519,46 +500,17 @@ FILE(APPEND ${VERSION_FILE_PATH} "Platform=${Platform}-${PLATFORM_ABI}")
FILE(APPEND ${VERSION_FILE_PATH} "\n")
INSTALL(FILES ${VERSION_FILE_PATH} DESTINATION sdk)
-IF(OPENSIM_INSTALL_PACKAGE_BUILD)
-IF(WIN32 AND NOT UNIX)
- # There is a bug in NSI that does not handle full unix paths properly. Make
- # sure there is at least one set of four (4) backlasshes.
- SET(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}\\\\Installer\\\\OpenSimInstallerIcon.bmp")
- # SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\OpenSim.exe")
- SET(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} ")
- SET(CPACK_CREATE_DESKTOP_LINKS "${CPACK_PACKAGE_INSTALL_DIRECTORY}\\\\bin\\\\OpenSim.exe")
- SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\www.simtk.org/home/opensim")
- SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\www.simtk.org/home/opensim")
- SET(CPACK_NSIS_CONTACT "[email protected]")
- SET(CPACK_NSIS_MODIFY_PATH ON)
- SET (CPACK_NSIS_EXTRA_INSTALL_COMMANDS
- "ExecWait '\\\"$INSTDIR\\\\bin\\\\vcredist_x86.exe\\\"'"
- )
-ELSE(WIN32 AND NOT UNIX)
- SET(CPACK_STRIP_FILES "bin/OpenSim")
- SET(CPACK_SOURCE_STRIP_FILES "")
-ENDIF(WIN32 AND NOT UNIX)
-SET(CPACK_PACKAGE_EXECUTABLES "OpenSim" "OpenSim")
-
-INCLUDE (CPack)
-
-ENDIF(OPENSIM_INSTALL_PACKAGE_BUILD)
-
#
# Build the documentation
#
#-----------------------------------------------------------------------------
-SET(BUILD_API_ONLY OFF CACHE BOOL "Build API only (headers and libs, no GUI or Applications")
+SET(BUILD_API_ONLY OFF CACHE BOOL "Build/install only headers, libraries,
+ wrapping, tests; not applications (ik, rra, etc.).")
MARK_AS_ADVANCED( BUILD_API_ONLY )
IF(BUILD_API_ONLY)
SUBDIRS(Vendors OpenSim)
- SET(OPENSIM_INSTALL_PACKAGE_BUILD OFF)
ELSE(BUILD_API_ONLY)
-IF(OPENSIM_INSTALL_PACKAGE_BUILD)
- SUBDIRS(Vendors OpenSim Applications Models Gui)
-ELSE(OPENSIM_INSTALL_PACKAGE_BUILD)
- SUBDIRS(Vendors OpenSim Applications Models)
-ENDIF(OPENSIM_INSTALL_PACKAGE_BUILD)
+ SUBDIRS(Vendors OpenSim Applications)
ENDIF(BUILD_API_ONLY)
diff --git a/Vendors/CMakeLists.txt b/Vendors/CMakeLists.txt
index 64d9ab8..7dd474c 100644
--- a/Vendors/CMakeLists.txt
+++ b/Vendors/CMakeLists.txt
@@ -1,10 +1,2 @@
#-----------------------------------------------------------------------------
-SUBDIRS(CFSQP lepton)
-
-IF(WIN32)
- FILE(GLOB VTK_LIBS "vtk_dll/*.dll")
- FOREACH(LIBF ${VTK_LIBS})
- INSTALL(FILES ${LIBF} DESTINATION bin)
- ENDFOREACH()
-ENDIF(WIN32)
-
+SUBDIRS(lepton)
--
1.8.3.2
From 79529f546aa71df0b437dc26540e5c0734f53052 Mon Sep 17 00:00:00 2001
From: Christopher Dembia <[email protected]>
Date: Sat, 12 Apr 2014 17:42:39 -0700
Subject: [PATCH 3/3] Fix Java source install directory.
---
OpenSim/Wrapping/Java/OpenSimJNI/CMakeLists.txt | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/OpenSim/Wrapping/Java/OpenSimJNI/CMakeLists.txt b/OpenSim/Wrapping/Java/OpenSimJNI/CMakeLists.txt
index 5eee042..3e42f47 100644
--- a/OpenSim/Wrapping/Java/OpenSimJNI/CMakeLists.txt
+++ b/OpenSim/Wrapping/Java/OpenSimJNI/CMakeLists.txt
@@ -82,8 +82,8 @@ ELSE()
ARCHIVE DESTINATION sdk/lib)
ENDIF()
-INSTALL(DIRECTORY ${SWIG_JAVA_SOURCE_BUILD_OUTPUT_DIR}
- DESTINATION sdk/Java)
+INSTALL(DIRECTORY ${SWIG_JAVA_SOURCE_BUILD_OUTPUT_DIR}/
+ DESTINATION sdk/Java/${SWIG_JAVA_PACKAGE_PATH})
IF(BUILD_TESTING)
SUBDIRS(Test)
--
1.8.3.2