Commit 2ade4c88 authored by Konstantinos Chatzilygeroudis's avatar Konstantinos Chatzilygeroudis
Browse files

Make building of tests optional; Boost is a big dependency to have by default

parent 3c6006c9
Pipeline #17283 passed with stage
in 53 seconds
......@@ -27,6 +27,7 @@ SET(PROJECT_URL "https://github.com/${PROJECT_ORG}/${PROJECT_NAME}")
# Project options
OPTION(TRACE_SOLVER "trace solver on stderr" OFF)
OPTION(BUILD_TESTS "build tests" ON)
# Project configuration
SET(PROJECT_USE_CMAKE_EXPORT TRUE)
......@@ -36,7 +37,9 @@ SET(PROJECT_CUSTOM_HEADER_EXTENSION "hpp")
# JRL-cmakemodule setup
INCLUDE(cmake/base.cmake)
INCLUDE(cmake/boost.cmake)
IF(BUILD_TESTS)
INCLUDE(cmake/boost.cmake)
ENDIF(BUILD_TESTS)
# Project definition
COMPUTE_PROJECT_ARGS(PROJECT_ARGS LANGUAGES CXX)
......@@ -44,7 +47,9 @@ PROJECT(${PROJECT_NAME} ${PROJECT_ARGS})
# Project dependencies
ADD_PROJECT_DEPENDENCY(Eigen3 REQUIRED)
FIND_PACKAGE(Boost REQUIRED COMPONENTS unit_test_framework)
IF(BUILD_TESTS)
FIND_PACKAGE(Boost REQUIRED COMPONENTS unit_test_framework)
ENDIF(BUILD_TESTS)
# Main Library
SET(${PROJECT_NAME}_HEADERS
......@@ -68,4 +73,6 @@ 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)
ADD_SUBDIRECTORY(tests)
IF(BUILD_TESTS)
ADD_SUBDIRECTORY(tests)
ENDIF(BUILD_TESTS)
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