Dear all,
Hi! I'm a new member here, so my question might be about a well
known fact or might be answered somewhere in the wiki.
BTW, there is an ambiguity about the 'make test' target that I'd
like to know more about. In one hand, you are (somewhat) using
CMake's own CTest feature, like using ENABLE_TESTING() command and
some testing constructs (some of them are only needed for older
CMake versions (probably 2.6) and can be simplified/modernized now
as the minimum usable version is in CMake 2.8 series now); on the
other hand you are creating a custom 'test' target (ENABLE_TESTING()
creates a test target itself).
I'd like to know if test target is intentionally overridden, and
provides something that cmake's own 'test' target doesn't provide.
Currently, cmake gives me a warning about this:
----------------------------------------------------------------------------------------------------
CMake Warning (dev) at CMakeLists.txt:300 (ADD_CUSTOM_TARGET):
Policy CMP0037 is not set: Target names should not be reserved and
should
match a validity pattern. Run "cmake --help-policy CMP0037" for
policy
details. Use the cmake_policy command to set the policy and
suppress this
warning.
The target name "test" is reserved or not valid for certain CMake
features,
such as generator expressions, and may result in undefined
behavior.
This warning is for project developers. Use -Wno-dev to suppress
it.
----------------------------------------------------------------------------------------------------
So, if it is necessary, we can explicitly set CMP0037 policy to be
clear that we want to override test target. If not, it might be
helpful to re-consider testing framework again considering related
features in more recent CMake versions (things like AddCxxtest.cmake
can probably be removed completely as mentioned in the referenced
page:
http://www.cmake.org/Wiki/CMakeMacroAddCxxTest).
Regards,
Hedayat