Skip to content

Commit 3535586

Browse files
authored
Merge pull request #2600 from opensim-org/opensim-copy-dependencies-with-wrapping
OPENSIM_COPY_DEPENDENCIES with wrapping
2 parents d76e5d4 + f8d72ff commit 3535586

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ Other Changes
4545
building and simulating a simple arm model; using OutputReporters to record and write marker location and coordinate values to file.
4646
- Added Python example that demonstrates how to run an optimization using the cma package and how to avoid an expensive call to `initSystem()` within the objective function. (PR #2604)
4747
- OpenSim 4.1 ships with Python3 bindings as default. It is still possible to create bindings for Python2 if desired by setting CMake variable OPENSIM_PYTHON_VERSION to 2
48+
- For CMake, the option OPENSIM_COPY_DEPENDENCIES option is now an advanced option, and a warning is provided if this option is off but wrapping is turned on.
4849

4950
v4.0
5051
====

CMakeLists.txt

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,9 @@ option(OPENSIM_COPY_DEPENDENCIES "Copy Simbody and BTK into the
8989
OpenSim installation. This should be set to ON when making a relocatable
9090
distribution, and should be set to OFF when packaging for Homebrew, Debian,
9191
etc. On Linux and macOS: we use relative RPATHs when ON, and absolute RPATHs
92-
when OFF." ON)
92+
when OFF. For most users, this should also be on if BUILD_JAVA_WRAPPING or
93+
BUILD_PYTHON_WRAPPING is ON, so if this OFF, a warning is thrown." ON)
94+
mark_as_advanced(OPENSIM_COPY_DEPENDENCIES)
9395

9496
option(OPENSIM_PYTHON_STANDALONE "Make the Python package standalone, meaning
9597
the OpenSim (and Simbody and BTK) shared libraries it depends on are copied
@@ -440,6 +442,15 @@ if(${BUILD_JAVA_WRAPPING})
440442
endif()
441443
endif()
442444
endif()
445+
# Most users need to copy dependencies if wrapping is on. Warn user
446+
# if it isn't on.
447+
if (NOT OPENSIM_COPY_DEPENDENCIES)
448+
string(CONCAT MSG
449+
"BUILD_JAVA_WRAPPING is ON but OPENSIM_COPY_DEPENDENCIES is OFF. "
450+
"Wrapping may not work correctly. Consider switching the "
451+
"OPENSIM_COPY_DEPENDENCIES flag to ON.")
452+
message(WARNING ${MSG})
453+
endif()
443454
endif()
444455

445456
if(${BUILD_PYTHON_WRAPPING})
@@ -488,7 +499,16 @@ if(${BUILD_PYTHON_WRAPPING})
488499
CACHE FILEPATH "${pylib_desc}")
489500
endif()
490501
find_package(PythonLibs ${required_python_version} REQUIRED)
491-
502+
503+
# Most users need to copy dependencies if wrapping is on. Warn user
504+
# if it isn't on.
505+
if (NOT OPENSIM_COPY_DEPENDENCIES)
506+
string(CONCAT MSG
507+
"BUILD_PYTHON_WRAPPING is ON but OPENSIM_COPY_DEPENDENCIES is OFF. "
508+
"Wrapping may not work correctly. Consider switching the "
509+
"OPENSIM_COPY_DEPENDENCIES flag to ON.")
510+
message(WARNING ${MSG})
511+
endif()
492512
endif()
493513

494514
if(WIN32)

0 commit comments

Comments
 (0)