Skip to content

Conversation

@jnbrunet
Copy link
Contributor

Not sure why it happen, but it was reported by @pedroperrusi that some targets might not have the LIBRARY_OUTPUT_DIRECTORY property, hence making the target dependencies lookout for RPATHs fail:

CMake Error at CMake/SofaPython3Tools.cmake:158 (file):
  file RELATIVE_PATH must be passed a full path to the file:
  DEPENDENCY_LIBRARY_OUTPUT_DIRECTORY-NOTFOUND
Call Stack (most recent call first):
  bindings/SofaRuntime/CMakeLists.txt:22 (SP3_add_python_module)


Python module 'SofaRuntime' added to site-packages/SofaRuntime
CMake Error at CMake/SofaPython3Tools.cmake:158 (file):
  file RELATIVE_PATH must be passed a full path to the file:
  DEPENDENCY_LIBRARY_OUTPUT_DIRECTORY-NOTFOUND
Call Stack (most recent call first):
  bindings/SofaGui/CMakeLists.txt:18 (SP3_add_python_module)

This PR will make sure that the dependency lookout don't fail in such a case.

if (TARGET ${DEPENDENCY})
get_target_property(DEPENDENCY_LIBRARY_OUTPUT_DIRECTORY "${DEPENDENCY}" LIBRARY_OUTPUT_DIRECTORY)
if (NOT "${DEPENDENCY_LIBRARY_OUTPUT_DIRECTORY}" STREQUAL "")
if (NOT "${DEPENDENCY_LIBRARY_OUTPUT_DIRECTORY}" STREQUAL "" AND NOT "${DEPENDENCY_LIBRARY_OUTPUT_DIRECTORY}" MATCHES "NOTFOUND$")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (DEPENDENCY_LIBRARY_OUTPUT_DIRECTORY) will do this double check 😉

@jnbrunet
Copy link
Contributor Author

jnbrunet commented Jul 1, 2020

Thanks @guparan , it should be good now!

@marques-bruno marques-bruno merged commit c1cd7b2 into sofa-framework:master Jul 1, 2020
@guparan guparan added this to the v20.12 milestone Oct 26, 2021
hugtalbot pushed a commit to hugtalbot/SofaPython3 that referenced this pull request Feb 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants