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 Aug 24, 2020
1 parent 3c5f16f commit df484fc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
6 changes: 2 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ PROJECT(${PROJECT_NAME} ${PROJECT_ARGS})

# Project dependencies
ADD_PROJECT_DEPENDENCY(Eigen3 REQUIRED PKG_CONFIG_REQUIRES "eigen3 >= 3.2.92")
SET(BOOST_COMPONENTS unit_test_framework)
SEARCH_FOR_BOOST()
FIND_PACKAGE(Boost REQUIRED COMPONENTS unit_test_framework)

# Main Library
SET(${PROJECT_NAME}_HEADERS
Expand All @@ -65,8 +64,7 @@ IF(TRACE_SOLVER)
TARGET_COMPILE_DEFINITIONS(${PROJECT_NAME} PRIVATE TRACE_SOLVER)
ENDIF(TRACE_SOLVER)

TARGET_INCLUDE_DIRECTORIES(${PROJECT_NAME} SYSTEM PRIVATE ${EIGEN3_INCLUDE_DIR})
TARGET_INCLUDE_DIRECTORIES(${PROJECT_NAME} SYSTEM INTERFACE ${EIGEN3_INCLUDE_DIR})
TARGET_INCLUDE_DIRECTORIES(${PROJECT_NAME} SYSTEM PUBLIC ${EIGEN3_INCLUDE_DIR})
TARGET_INCLUDE_DIRECTORIES(${PROJECT_NAME} INTERFACE $<INSTALL_INTERFACE:include>)
INSTALL(TARGETS ${PROJECT_NAME} EXPORT ${TARGETS_EXPORT_NAME} DESTINATION lib)

Expand Down
12 changes: 4 additions & 8 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,14 @@ SET(TESTS
eiquadprog-fast
eiquadprog-rt
eiquadprog-both
test-integration
)

FOREACH(test ${TESTS})
ADD_UNIT_TEST(${test} ${test}.cpp)
TARGET_LINK_LIBRARIES(${test} ${PROJECT_NAME}
${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
TARGET_LINK_LIBRARIES(${test} ${PROJECT_NAME} Boost::unit_test_framework)
ENDFOREACH(test ${TESTS})

ADD_LIBRARY(testab SHARED TestA.cpp TestB.cpp)
TARGET_INCLUDE_DIRECTORIES(testab SYSTEM PRIVATE ${EIGEN3_INCLUDE_DIR})
TARGET_LINK_LIBRARIES( testab ${PROJECT_NAME})

ADD_UNIT_TEST(test-integration test-integration.cpp )
TARGET_LINK_LIBRARIES(test-integration
testab ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
TARGET_LINK_LIBRARIES(testab ${PROJECT_NAME})
TARGET_LINK_LIBRARIES(test-integration testab)

0 comments on commit df484fc

Please sign in to comment.