Closed undisputed-seraphim closed 1 year ago
oh please check if this change is still compatible with Python3 flavor
oh please check if this change is still compatible with Python3 flavor
The change is purely CMake only, to target Python3 we just change all find_package(Python2 ...)
to find_package(Python3 ...)
to target Python3 we just change all find_package(Python2 ...) to find_package(Python3 ...)
we will need to patch a lot.
Also, Currently the behavior can be changed by installing python-is-python2
or python-is-python3
without changing CMakeLists, but we will lose that capability.
to target Python3 we just change all find_package(Python2 ...) to find_package(Python3 ...)
we will need to patch a lot.
Also, Currently the behavior can be changed by installing
python-is-python2
orpython-is-python3
without changing CMakeLists, but we will lose that capability.
We can use FindPython , which will define target names that are version agnostic. i.e.,
find_package(Python 2.7 REQUIRED COMPONENTS Interpreter Development NumPy)
...
target_link_libraries(my_library PUBLIC Python::Module Python::NumPy)
That way, we only need to change 2.7
to 3.x
without having to change anything else.
Does that work for you?
Sure that should be ok
Closing this due to developments on another branch involving CMake.
This merge request aims to implement proper target exporting and importing with CMake.
I need to make these changes because certain embedded platform build systems expect
myproject-targets.cmake
files to be present in order to facilitate dependency resolution. Existing dependency layers that are bundled with the build system also expect other dependencies to be reasonably well-behaved (does not force-set CMake variables that leak across projects).High-level overview of changes:
cpp-gen-md5
binary just to get basic md5 symbols. This has to be changed because otherwisecpp-gen-md5
also has to be exported and installed together with libopenrave.EXPORT
to mostinstall()
commands.find_package(Python2)
to set Python-related directories, and the now-deprecatedfind_package(PythonLibs 2)
code is removed.openrave-config.cmake.in
to fit modern standards.openrave-config-version.cmake
deleted - It is now automatically generated by CMake.myrelpath.py
deleted - It is used solely to determine the prefix path of the installation directory of python modules, but CMake has a built-in function for this now.There is also a compatibility shim so that existing libraries that use deprecated behaviours continue to work, but ideally we should fix downstream libraries and them remove this shim.
After this change, any project that wishes to link against OpenRAVE in CMake do not need any to do any voodoo; simply
find_package(OpenRAVE REQUIRED)
and thentarget_link_libraries(myproject PUBLIC OpenRAVE::OpenRAVE)
.