-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from rhaschke/master
Cleanup cmake files
- Loading branch information
Showing
3 changed files
with
26 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,20 @@ | ||
cmake_minimum_required(VERSION 2.8.3) | ||
|
||
# Configure pybind11 using the cmake file provided by the upstream package. | ||
# This finds python includes and libs and defines pybind11_add_module() | ||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}") | ||
|
||
set(TEMP_PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE}) | ||
if(DEFINED PYBIND_PYTHON_EXECUTABLE) | ||
set(PYTHON_EXECUTABLE ${PYBIND_PYTHON_EXECUTABLE} CACHE INTERNAL "") | ||
endif() | ||
|
||
set(PYBIND11_PYTHON_VERSION ${PYTHON_VERSION_STRING}) | ||
include(pybind11Tools) | ||
|
||
# Cache variables so pybind11_add_module can be used in parent projects | ||
set(PYBIND11_INCLUDE_DIR ${PYBIND11_INCLUDE_DIR} CACHE INTERNAL "") | ||
set(PYTHON_LIBRARIES ${PYTHON_LIBRARIES} CACHE INTERNAL "") | ||
|
||
set(PYTHON_EXECUTABLE ${TEMP_PYTHON_EXECUTABLE} CACHE INTERNAL "") | ||
# set variables used by pybind11_add_module() | ||
if(@INSTALLSPACE@) | ||
set(pybind11_catkin_INCLUDE_DIRS "${pybind11_catkin_INCLUDE_DIRS}/@PROJECT_NAME@") | ||
endif() | ||
set(PYBIND11_INCLUDE_DIR "${pybind11_catkin_INCLUDE_DIRS}") | ||
list(APPEND pybind11_catkin_INCLUDE_DIRS "${PYTHON_INCLUDE_DIRS}") | ||
|
||
macro(pybind_add_module target_name other) | ||
include_directories(${pybind11_catkin_INCLUDE_DIRS}/pybind11_catkin) # Such that libraries are locally available as pybind11/pybind11, without exporting. | ||
pybind11_add_module(${ARGV}) | ||
target_link_libraries(${target_name} PRIVATE ${PYTHON_LIBRARIES} ${catkin_LIBRARIES}) | ||
set_target_properties(${target_name} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CATKIN_GLOBAL_PYTHON_DESTINATION}) | ||
set(PYTHON_LIB_DIR ${CATKIN_DEVEL_PREFIX}/${CATKIN_GLOBAL_PYTHON_DESTINATION}) | ||
add_custom_command(TARGET ${target_name} | ||
POST_BUILD | ||
COMMAND ${CMAKE_COMMAND} -E make_directory ${PYTHON_LIB_DIR} | ||
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${target_name}> ${PYTHON_LIB_DIR}/${target_name}.so | ||
WORKING_DIRECTORY ${CATKIN_DEVEL_PREFIX} | ||
COMMENT "Copying library files to python directory") | ||
set_target_properties(${target_name} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CATKIN_DEVEL_PREFIX}/${CATKIN_GLOBAL_PYTHON_DESTINATION}) | ||
endmacro(pybind_add_module) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,15 @@ | ||
<?xml version="1.0"?> | ||
<package format="2"> | ||
<name>pybind11_catkin</name> | ||
<version>2.2.4</version> | ||
<version>2.4.3</version> | ||
<description>The pybind11 package</description> | ||
<maintainer email="[email protected]">Vladimir Ivan</maintainer> | ||
<maintainer email="[email protected]">Wolfgang Merkt</maintainer> | ||
<license>BSD</license> | ||
|
||
<buildtool_depend>catkin</buildtool_depend> | ||
<!-- <build_depend>git</build_depend> --> | ||
<depend>python</depend> | ||
<depend>python-numpy</depend> | ||
<depend>rospy</depend> | ||
<depend>eigen</depend> | ||
|
||
<build_export_depend>python</build_export_depend> | ||
<build_export_depend>python-numpy</build_export_depend> | ||
<build_export_depend>eigen</build_export_depend> | ||
</package> |