Commit 25f035f5 authored by Justin Carpentier's avatar Justin Carpentier
Browse files

[CMake] Add BUILD_UNIT_TESTS as option

parent 1247fe01
......@@ -47,6 +47,7 @@ ENDIF(WIN32)
# --- OPTIONS ----------------------------------------
OPTION (BUILD_BENCHMARK "Build the benchmarks" OFF)
OPTION (BUILD_UNIT_TESTS "Build the unitary tests" ON)
OPTION (BUILD_UTILS "Build the utils" OFF)
OPTION (INITIALIZE_WITH_NAN "Initialize Eigen entries with NaN" OFF)
OPTION (BUILD_TESTS_WITH_HPP "Build geom tests and benchmarks with hpp to do comparisons" OFF)
......
......@@ -6,7 +6,7 @@ set -x
set -v
# Setup environment variables.
export CMAKE_ADDITIONAL_OPTIONS=" ${CMAKE_ADDITIONAL_OPTIONS} -DBUILD_BENCHMARK=\"ON\" -DCOMPILE_UNIT_TESTS=1"
export CMAKE_ADDITIONAL_OPTIONS=" ${CMAKE_ADDITIONAL_OPTIONS} -DBUILD_BENCHMARK=\"ON\" -DBUILD_UNIT_TESTS=\"ON\""
export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}:/opt/openrobots/lib/pkgconfig"
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/opt/openrobots/lib"
# Setup environment variables.
......
......@@ -19,11 +19,11 @@
# --- MACROS ------------------------------------------------------------------
# --- MACROS ------------------------------------------------------------------
MACRO(ADD_UNIT_TEST NAME PKGS)
IF (COMPILE_UNIT_TESTS)
IF (BUILD_UNIT_TESTS)
ADD_EXECUTABLE(${NAME} ${NAME})
ELSE (COMPILE_UNIT_TESTS)
ELSE (BUILD_UNIT_TESTS)
ADD_EXECUTABLE(${NAME} EXCLUDE_FROM_ALL ${NAME})
ENDIF (COMPILE_UNIT_TESTS)
ENDIF (BUILD_UNIT_TESTS)
FOREACH(PKG ${PKGS})
PKG_CONFIG_USE_DEPENDENCY(${NAME} ${PKG})
ENDFOREACH(PKG)
......
Supports Markdown
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