Skip to content

Commit 69ac54c

Browse files
gabrielebndnjcarpent
authored andcommitted
Deprecate BUILD_UNIT_TESTS (#142)
* Default BUILD_TESTING to OFF * Deprecate BUILD_UNIT_TESTS and remove its usage * Revert "Default BUILD_TESTING to OFF" This reverts commit 102bf6f. * [BUILD_UNIT_TESTS] Better deprecation message
1 parent 6e5ecf7 commit 69ac54c

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

CMakeLists.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@ ENDIF(WIN32)
4545
# --- OPTIONS ---------------------------------------
4646
# ----------------------------------------------------
4747
OPTION(INSTALL_DOCUMENTATION "Generate and install the documentation" FALSE)
48-
OPTION(BUILD_UNIT_TESTS "Build the unitary tests" OFF)
4948

50-
IF(BUILD_UNIT_TESTS)
51-
SET(BUILD_TESTING ON)
52-
ELSE(BUILD_UNIT_TESTS)
53-
SET(BUILD_TESTING OFF)
54-
ENDIF(BUILD_UNIT_TESTS)
49+
IF(DEFINED BUILD_UNIT_TESTS)
50+
MESSAGE(AUTHOR_WARNING "BUILD_UNIT_TESTS is deprecated. Use BUILD_TESTING instead.\
51+
If you are manually building Pinocchio from source in an existing build folder,\
52+
we suggest that you delete your build folder and make a new one.")
53+
SET(BUILD_TESTING ${BUILD_UNIT_TESTS})
54+
ENDIF(DEFINED BUILD_UNIT_TESTS)
5555

5656
FINDPYTHON()
5757
FIND_NUMPY()

unittest/CMakeLists.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
MACRO(ADD_LIB_UNIT_TEST test PKGS)
77
CREATE_CTEST_BUILD_TESTS_TARGET()
88

9-
IF(BUILD_UNIT_TESTS)
9+
IF(BUILD_TESTING)
1010
ADD_LIBRARY(${test} SHARED ${test})
11-
ELSE(BUILD_UNIT_TESTS)
11+
ELSE(BUILD_TESTING)
1212
ADD_LIBRARY(${test} SHARED EXCLUDE_FROM_ALL ${test})
13-
ENDIF(BUILD_UNIT_TESTS)
13+
ENDIF(BUILD_TESTING)
1414

1515
FOREACH(PKG ${PKGS})
1616
PKG_CONFIG_USE_DEPENDENCY(${test} ${PKG})
@@ -24,9 +24,9 @@ MACRO(ADD_LIB_UNIT_TEST test PKGS)
2424
ADD_TEST(NAME ${test} COMMAND ${PYTHON_EXECUTABLE} -c "import ${test}")
2525

2626
ADD_DEPENDENCIES(build_tests ${test})
27-
IF(NOT BUILD_UNIT_TESTS)
27+
IF(NOT BUILD_TESTING)
2828
SET_TESTS_PROPERTIES(${test} PROPERTIES DEPENDS ctest_build_tests)
29-
ENDIF(NOT BUILD_UNIT_TESTS)
29+
ENDIF(NOT BUILD_TESTING)
3030
ENDMACRO(ADD_LIB_UNIT_TEST)
3131

3232
ADD_LIB_UNIT_TEST(matrix "eigen3")

0 commit comments

Comments
 (0)