Commit e42190df authored by Joseph Mirabel's avatar Joseph Mirabel
Browse files

[CMake] Export Boost dependency.

parent be8fbbb8
......@@ -55,9 +55,7 @@ IF(CMAKE_BUILD_TYPE MATCHES "DEBUG")
ENDIF(CMAKE_BUILD_TYPE MATCHES "DEBUG")
# Search for Boost.
# Boost.Test is used by the test suite.
SET(BOOST_COMPONENTS_LIB thread)
SEARCH_FOR_BOOST()
ADD_PROJECT_DEPENDENCY(Boost REQUIRED COMPONENTS thread)
# Search for dependecies.
ADD_PROJECT_DEPENDENCY(hpp-util REQUIRED PKG_CONFIG_REQUIRES "hpp-util >= 3.2")
......@@ -127,11 +125,11 @@ SET(${PROJECT_NAME}_SOURCES
ADD_LIBRARY(${PROJECT_NAME} SHARED ${${PROJECT_NAME}_SOURCES} ${${PROJECT_NAME}_HEADERS})
TARGET_INCLUDE_DIRECTORIES(${PROJECT_NAME} PUBLIC $<INSTALL_INTERFACE:include>)
TARGET_LINK_LIBRARIES(${PROJECT_NAME} hpp-util::hpp-util pinocchio::pinocchio)
TARGET_LINK_LIBRARIES(${PROJECT_NAME} PUBLIC hpp-util::hpp-util pinocchio::pinocchio Boost::thread)
INSTALL(TARGETS ${PROJECT_NAME} EXPORT ${TARGETS_EXPORT_NAME} DESTINATION lib)
ADD_SUBDIRECTORY(tests)
PKG_CONFIG_APPEND_LIBS(${PROJECT_NAME})
PKG_CONFIG_APPEND_BOOST_LIBS(${BOOST_COMPONENTS_LIB})
PKG_CONFIG_APPEND_BOOST_LIBS(thread)
......@@ -15,8 +15,7 @@
# You should have received a copy of the GNU Lesser General Public License
# along with hpp-pinocchio. If not, see <http://www.gnu.org/licenses/>.
SET(BOOST_COMPONENTS ${BOOST_COMPONENTS_LIB} unit_test_framework)
SEARCH_FOR_BOOST()
find_package(Boost REQUIRED COMPONENTS unit_test_framework)
# Make Boost.Test generates the main function in test cases.
ADD_DEFINITIONS(-DBOOST_TEST_DYN_LINK -DBOOST_TEST_MAIN)
......
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