Closed ahundt closed 8 years ago
It was because of the CHOLMOD_INCLUDE_DIR-NOTFOUND
component of the path, so a previous directory was marked as not found then included. I suggest we modify the error case of this code from Missing PROPERTY argument!
to provide more accurate/easy to debug information.
Instead of the current behavior it could check that the property argument exists, which says Missing PROPERTY argument!
and another which states that the property argument couldn't be used, and prints out more context details and the contents of the variable.
A second possibility is just a single check that says the error is one of the following: property argument not defined, or invalid, plus prints the contents of the property argument and some context of where in the code this is and why it is being set.
What do you think?
Sounds reasonable, the if (NOT ARGN_PROPERTY)
check was more meant as if (ARGN_PROPERTY STREQUAL "")
, because if (NOT DEFINED ARGN_PROPERTY)
will probably not do because cmake_parse_arguments
might always define it, even if not parsed (would need to be tested).
I would not necessarily throw an error for an invalid ARGN_PROPERTY
argument in basis_set_project_property
because the property value should be allowed to be anything and this function can hardly decide whether it makes sense for this property to have such value.
For the basis_include_directories
call with invalid path, the underlying CMake command include_directories
to which this call is delegated eventually should catch any issue with it. Just as if the user called the CMake command directly with an invalid argument.
Or
list (LENGTH ARGN_PROPERTY len)
if (len EQUAL 0)
message (FATAL_ERROR "...")
endif ()
but this is probably more expensive than the comparison with an empty string.
This code produces errors that claim to be due to a missing PROPERTY argument:
I modified CommonTools.cmake
basis_set_project_property
to print some debug info withmessage(STATUS...)
as follows:Here is the cmake output, note how
basis_include_directories
callsbasis_set_project_property
, which passes aPROPERTY
argument. Furthermore the variableARGN_PROPERTY
is not empty, though I'm not sure it is correct either since all the paths are present too:I'm not sure what to make of it because I don't expect the if statement to fail, and I'm not completely sure if the variables are set correctly.