Unverified Commit b20044cd authored by Justin Carpentier's avatar Justin Carpentier Committed by GitHub
Browse files

Merge pull request #132 from jcarpent/devel

Improve packaging and export of the project
parents e3087e90 17627d69
......@@ -54,8 +54,15 @@ before_install: ./.travis/run before_install
install: pip install coveralls numpy
script:
- export CMAKE_ADDITIONAL_OPTIONS="-DCMAKE_BUILD_TYPE=${BUILDTYPE}"
- sudo free -m -t
- ls -l /usr/lib/x86_64-linux-gnu/libboost_python*
- ./.travis/run ../travis_custom/custom_build
- cd $TRAVIS_BUILD_DIR/unittest/cmake
- mkdir build
- cd build
- export CMAKE_PREFIX_PATH=/tmp/_ci/install
- cmake ..
- make
- ./extra_lib
- cd /tmp/_ci/build
- make uninstall
after_failure: ./.travis/run after_failure
after_success: ./.travis/run after_success
......@@ -9,6 +9,7 @@ SET(PROJECT_NAME eigenpy)
SET(PROJECT_DESCRIPTION "Bindings between Numpy and Eigen using Boost.Python")
SET(PROJECT_URL "http://github.com/stack-of-tasks/eigenpy")
SET(PROJECT_USE_CMAKE_EXPORT TRUE)
SET(PROJECT_USE_KEYWORD_LINK_LIBRARIES TRUE)
SET(PROJECT_CUSTOM_HEADER_EXTENSION "hpp")
# Check if the submodule cmake have been initialized
......@@ -102,11 +103,6 @@ LIST(APPEND ${PROJECT_NAME}_HEADERS
${${PROJECT_NAME}_BINARY_DIR}/include/${PROJECT_NAME}/deprecated.hpp
${${PROJECT_NAME}_BINARY_DIR}/include/${PROJECT_NAME}/warning.hpp)
INCLUDE_DIRECTORIES(${${PROJECT_NAME}_BINARY_DIR}/include)
INCLUDE_DIRECTORIES(${${PROJECT_NAME}_SOURCE_DIR}/include)
LINK_DIRECTORIES(${PYTHON_LIBRARY_DIRS})
# ----------------------------------------------------
# --- TARGETS ----------------------------------------
# ----------------------------------------------------
......@@ -126,7 +122,14 @@ SET(${PROJECT_NAME}_SOURCES
)
ADD_LIBRARY(${PROJECT_NAME} SHARED ${${PROJECT_NAME}_SOURCES} ${${PROJECT_NAME}_HEADERS})
TARGET_INCLUDE_DIRECTORIES(${PROJECT_NAME} SYSTEM PUBLIC ${Boost_INCLUDE_DIRS} ${EIGEN3_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS} ${NUMPY_INCLUDE_DIRS})
TARGET_INCLUDE_DIRECTORIES(${PROJECT_NAME}
SYSTEM PUBLIC
${Boost_INCLUDE_DIRS}
${EIGEN3_INCLUDE_DIRS}
${PYTHON_INCLUDE_DIRS}
${NUMPY_INCLUDE_DIRS}
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
IF(NOT WIN32)
TARGET_COMPILE_OPTIONS(${PROJECT_NAME} PRIVATE $<$<CXX_COMPILER_ID:MSVC>:-bigobj> "-Wno-conversion")
ELSE()
......@@ -155,10 +158,6 @@ INSTALL(FILES
${CMAKE_CURRENT_BINARY_DIR}/eigenpy/${PROJECT_NAME}_export.h
DESTINATION include/eigenpy)
# This is a temporary work-around to fix MoveIt until jrl-cmakemodules
# can correctly create non-target CMake configs
install(FILES eigenpyConfig.cmake DESTINATION share/eigenpy/cmake)
# Install package for ROS
install(FILES package.xml DESTINATION share/eigenpy)
......
Subproject commit 3d9ae677710fd6f86176e9031aa3fe40d8f656ce
Subproject commit 365af59c5162364263ac8d69860f5931fae11d93
cmake_minimum_required(VERSION 2.8.3)
message(STATUS "Loading eigenpy from PkgConfig")
find_package(PkgConfig REQUIRED)
pkg_check_modules(eigenpy REQUIRED eigenpy)
# find absolute library paths for all eigenpy_LIBRARIES
set(libs ${eigenpy_LIBRARIES})
set(eigenpy_LIBRARIES "")
foreach(lib ${libs})
find_library(abs_lib_${lib} ${lib} HINTS ${eigenpy_LIBRARY_DIRS})
list(APPEND eigenpy_LIBRARIES "${abs_lib_${lib}}")
endforeach()
......@@ -39,13 +39,13 @@ ELSE()
SET(${PYWRAP}_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/${PYTHON_SITELIB}/${PROJECT_NAME})
ENDIF()
SET_TARGET_PROPERTIES(${PYWRAP} PROPERTIES SUFFIX ${PYTHON_EXT_SUFFIX})
SET_TARGET_PROPERTIES(${PYWRAP} PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/python/${PROJECT_NAME}")
SET_TARGET_PROPERTIES(${PYWRAP} PROPERTIES PREFIX "")
SET_TARGET_PROPERTIES(${PYWRAP} PROPERTIES OUTPUT_NAME "${PROJECT_NAME}")
SET_TARGET_PROPERTIES(${PYWRAP}
PROPERTIES
PREFIX ""
SUFFIX ${PYTHON_EXT_SUFFIX}
OUTPUT_NAME "${PROJECT_NAME}"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/python/${PROJECT_NAME}"
)
INSTALL(TARGETS ${PYWRAP} DESTINATION ${${PYWRAP}_INSTALL_DIR})
......
cmake_minimum_required(VERSION 2.6)
project(ExtraLib CXX)
find_package(eigenpy REQUIRED)
find_package(PythonInterp REQUIRED)
find_package(PythonLibs REQUIRED)
add_executable(extra_lib extra_lib.cpp)
target_link_libraries(extra_lib PUBLIC eigenpy::eigenpy ${PYTHON_LIBRARIES})
#include <eigenpy/version.hpp>
int main(int /*argc*/, char ** /*argv*/)
{
eigenpy::checkVersionAtLeast(0,0,0);
return 0;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment