Skip to content
This repository has been archived by the owner on Feb 8, 2019. It is now read-only.

Commit

Permalink
Add a cache variable to disable unit tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
florent-lamiraux committed Dec 31, 2016
1 parent 43f6270 commit 65f22b5
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ IF (HPP_DEBUG)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DHPP_DEBUG")
ENDIF()

# Add a cache variable to allow not compiling and running tests
set (RUN_TESTS TRUE CACHE BOOL "compile and run unit tests")

# Declare headers
SET(${PROJECT_NAME}_HEADERS
include/hpp/model/body.hh
Expand All @@ -63,8 +66,10 @@ SET(${PROJECT_NAME}_HEADERS
)

# Declare dependencies
SET(BOOST_COMPONENTS unit_test_framework)
SEARCH_FOR_BOOST()
IF (RUN_TESTS)
SET(BOOST_COMPONENTS unit_test_framework)
SEARCH_FOR_BOOST()
ENDIF ()

ADD_REQUIRED_DEPENDENCY("eigen3 >= 3.2")
ADD_REQUIRED_DEPENDENCY("hpp-util >= 0.7")
Expand All @@ -75,7 +80,9 @@ ADD_OPTIONAL_DEPENDENCY("assimp")
CONFIGURE_FILE(doc/main.hh.in doc/main.hh)

ADD_SUBDIRECTORY(src)
ADD_SUBDIRECTORY(tests)
IF (RUN_TESTS)
ADD_SUBDIRECTORY(tests)
ENDIF ()

# Add dependency toward hpp-model library in pkg-config file.
PKG_CONFIG_APPEND_LIBS("hpp-model")
Expand Down

0 comments on commit 65f22b5

Please sign in to comment.