Use CXXFLAGS in the makefile's link rule since it invokes the C++
compiler front-end. Retool the makefile not to require GNU Make. Using
backticks instead of $(shell ...) is safe so long as one guards against
the possibility of backslashes getting inside the backticks, so use
temporary files and shell variables to avoid them.
BSD make doesn't use -v for printing its name and version, and so
complains on stderr that this is a bad command line option, used
in Tests/FindPackageModeMakefileTest/CMakeLists.txt .
Silence stderr to make that ugly output go away.
Patch by David Coppy.
Alex
The makefile used in the test uses $(shell ...), which is
AFAIK a GNU extension, and will probably not work e.g. with OpenBSD make.
According to the FreeBSD make manpage their make has a != assignment,
which seems to do something similar, but I don't have such a system
around for testing.
Also, the point of this test is not to write a portable makefile,
but to check whether cmake --find-package prints a correct string.
Alex
The commit message for the previous commit was wrong, it should
have been: fix the test by using $(shell ...) syntax instead
of backticks in the Makefile.
With backticks I couldn't get the quoting right.
Printing -I"/some/path with space" did not work, the compiler
complained that there is not file "with". Also backslashes in
different numbers did not make it work.
Alex
Instead of relying on that some development package is installed on the
system, now a tiny library is built, which is the searched and used
during the test.
Alex
BSD make doesn't seem to support -C, so do not use it,
According to the documentation the working directory is set
to CMAKE_CURRENT_BINARY_DIR anyway, so it should work just the same.
Alex