# Enable CTest/CDash support
include(CTest)
+# Provide ADD_TEST_28 macro to approximate CMake 2.8 ADD_TEST(NAME).
+# TODO: Require CMake 2.8 and drop this workaround (perhaps late 2010).
+INCLUDE(AddTest28)
+
OPTION(ENABLE_TAR "Enable tar building" ON)
OPTION(ENABLE_TAR_SHARED "Enable dynamic build of tar" OFF)
OPTION(ENABLE_CPIO "Enable cpio building" ON)
# test. We can use that to define the tests for cmake by
# defining a DEFINE_TEST macro and reading list.h in.
MACRO (DEFINE_TEST _testname)
- ADD_TEST("bsdcpio_${_testname}"
- bsdcpio_test -vv
- -p ${BSDCPIO}
- -r ${CMAKE_CURRENT_SOURCE_DIR}
- ${_testname})
+ ADD_TEST_28(
+ NAME bsdcpio_${_testname}
+ COMMAND bsdcpio_test -vv
+ -p $<TARGET_FILE:bsdcpio>
+ -r ${CMAKE_CURRENT_SOURCE_DIR}
+ ${_testname})
ENDMACRO (DEFINE_TEST _testname)
INCLUDE(${CMAKE_CURRENT_BINARY_DIR}/list.h)
# test. We can use that to define the tests for cmake by
# defining a DEFINE_TEST macro and reading list.h in.
MACRO (DEFINE_TEST _testname)
- ADD_TEST("libarchive_${_testname}"
- libarchive_test -vv
+ ADD_TEST_28(
+ NAME libarchive_${_testname}
+ COMMAND libarchive_test -vv
-r ${CMAKE_CURRENT_SOURCE_DIR}
${_testname})
ENDMACRO (DEFINE_TEST _testname)
# test. We can use that to define the tests for cmake by
# defining a DEFINE_TEST macro and reading list.h in.
MACRO (DEFINE_TEST _testname)
- ADD_TEST("bsdtar_${_testname}"
- bsdtar_test -vv
- -p ${BSDTAR}
- -r ${CMAKE_CURRENT_SOURCE_DIR}
- ${_testname})
+ ADD_TEST_28(
+ NAME bsdtar_${_testname}
+ COMMAND bsdtar_test -vv
+ -p $<TARGET_FILE:bsdtar>
+ -r ${CMAKE_CURRENT_SOURCE_DIR}
+ ${_testname})
ENDMACRO (DEFINE_TEST _testname)
INCLUDE(${CMAKE_CURRENT_BINARY_DIR}/list.h)