Skip to content

Commit

Permalink
[CMake] sync submodule and its use
Browse files Browse the repository at this point in the history
  • Loading branch information
nim65s committed Sep 16, 2020
1 parent 3c56ebd commit 6646bd0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
9 changes: 4 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ INCLUDE(cmake/python.cmake)
# Project definition
COMPUTE_PROJECT_ARGS(PROJECT_ARGS LANGUAGES CXX)
PROJECT(${PROJECT_NAME} ${PROJECT_ARGS})
SET(CMAKE_CXX_STANDARD 11)
CHECK_MINIMAL_CXX_STANDARD(11 ENFORCE)

# Project dependencies
ADD_PROJECT_DEPENDENCY(Eigen3 REQUIRED PKG_CONFIG_REQUIRES eigen3)
Expand All @@ -40,16 +40,14 @@ IF(CURVES_WITH_PINOCCHIO_SUPPORT)
ENDIF(CURVES_WITH_PINOCCHIO_SUPPORT)
SET(PACKAGE_EXTRA_MACROS "SET(CURVES_WITH_PINOCCHIO_SUPPORT ${CURVES_WITH_PINOCCHIO_SUPPORT})")

SET(BOOST_COMPONENTS unit_test_framework serialization)
ADD_PROJECT_DEPENDENCY(Boost REQUIRED COMPONENTS serialization)

IF(BUILD_PYTHON_INTERFACE)
FINDPYTHON()
SEARCH_FOR_BOOST_PYTHON(REQUIRED)
ADD_PROJECT_DEPENDENCY(eigenpy REQUIRED PKG_CONFIG_REQUIRES "eigenpy >= 1.6.8")
SET(BOOST_COMPONENTS ${BOOST_COMPONENTS} python)
ENDIF(BUILD_PYTHON_INTERFACE)

SEARCH_FOR_BOOST()

# Main Library
SET(${PROJECT_NAME}_HEADERS
include/${PROJECT_NAME}/bernstein.h
Expand Down Expand Up @@ -85,6 +83,7 @@ SET(${PROJECT_NAME}_HEADERS
ADD_LIBRARY(${PROJECT_NAME} INTERFACE)
TARGET_INCLUDE_DIRECTORIES(${PROJECT_NAME} SYSTEM INTERFACE ${EIGEN3_INCLUDE_DIR})
TARGET_INCLUDE_DIRECTORIES(${PROJECT_NAME} INTERFACE $<INSTALL_INTERFACE:include>)
TARGET_LINK_LIBRARIES(${PROJECT_NAME} INTERFACE Boost::serialization)
IF(CURVES_WITH_PINOCCHIO_SUPPORT)
TARGET_LINK_LIBRARIES(${PROJECT_NAME} INTERFACE pinocchio::pinocchio)
ENDIF(CURVES_WITH_PINOCCHIO_SUPPORT)
Expand Down
2 changes: 1 addition & 1 deletion python/curves/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ SET(wrap ${PROJECT_NAME}_wrap)
ADD_LIBRARY(${wrap} SHARED ${${PROJECT_NAME}_WRAP_SOURCES})
SET_TARGET_PROPERTIES(${wrap} PROPERTIES OUTPUT_NAME ${PROJECT_NAME} PREFIX "")
TARGET_COMPILE_OPTIONS(${wrap} PRIVATE "-Wno-conversion")
TARGET_LINK_LIBRARIES(${wrap} ${Boost_LIBRARIES} eigenpy::eigenpy)
TARGET_LINK_LIBRARIES(${wrap} eigenpy::eigenpy)
IF(CURVES_WITH_PINOCCHIO_SUPPORT)
TARGET_LINK_LIBRARIES(${wrap} pinocchio::pinocchio)
ENDIF(CURVES_WITH_PINOCCHIO_SUPPORT)
Expand Down
5 changes: 2 additions & 3 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ADD_UNIT_TEST(curves_tests Main.cpp)
TARGET_LINK_LIBRARIES(curves_tests ${PROJECT_NAME} ${Boost_LIBRARIES})
TARGET_LINK_LIBRARIES(curves_tests ${PROJECT_NAME})
TARGET_COMPILE_DEFINITIONS(curves_tests PRIVATE -DTEST_DATA_PATH="${CMAKE_CURRENT_SOURCE_DIR}/data/")

SET(${PROJECT_NAME}_TESTS
Expand All @@ -11,6 +11,5 @@ SET(${PROJECT_NAME}_TESTS

FOREACH(TEST ${${PROJECT_NAME}_TESTS})
ADD_UNIT_TEST(${TEST} ${TEST})
TARGET_LINK_LIBRARIES(${TEST} ${PROJECT_NAME} ${Boost_LIBRARIES})
TARGET_LINK_LIBRARIES(${TEST} ${PROJECT_NAME})
ENDFOREACH(TEST ${${PROJECT_NAME}_TESTS})

0 comments on commit 6646bd0

Please # to comment.