banditcpp/bandit

add_custom_command for snowhouse-tests doesn't do anything

Closed this issue · 0 comments

When running cmake on Bandit, a warning is generated stating that the snowhouse-tests target is unknown:

CMake Warning (dev) at CMakeLists.txt:52 (add_custom_command):
  Policy CMP0040 is not set: The target in the TARGET signature of
  add_custom_command() must exist.  Run "cmake --help-policy CMP0040" for
  policy details.  Use the cmake_policy command to set the policy and
  suppress this warning.

  The target name "snowhouse-tests" is unknown in this context.
This warning is for project developers.  Use -Wno-dev to suppress it.

This is because add_custom_command does not work for targets in subdirectories.

One option is to add the snowhouse-tests to the bandit-specs target, but I don't think this is necessary as they get executed just because of the add_subdirectory. A better choice might be to just remove it.