Only enable the test when using GNU make
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
This commit is contained in:
parent
3011149947
commit
7d693108fa
|
@ -1,8 +1,16 @@
|
|||
|
||||
|
||||
# the test program links against the png lib, so test first whether it exists
|
||||
if(UNIX AND "${CMAKE_GENERATOR}" MATCHES "Makefile")
|
||||
|
||||
# Test whether the make is GNU make, and only add the test in this case,
|
||||
# since the configured makefile in this test uses $(shell ...), which
|
||||
# is AFAIK a GNU make extension. Alex
|
||||
execute_process(COMMAND ${CMAKE_MAKE_PROGRAM} -v
|
||||
OUTPUT_VARIABLE makeVersionOutput
|
||||
TIMEOUT 10)
|
||||
string(TOUPPER "${makeVersionOutput}" MAKE_VERSION_OUTPUT)
|
||||
if("${MAKE_VERSION_OUTPUT}" MATCHES ".*GNU MAKE.*")
|
||||
|
||||
# build a library which we can search during the test
|
||||
add_library(foo STATIC foo.cpp)
|
||||
|
||||
|
@ -17,4 +25,6 @@ if(UNIX AND "${CMAKE_GENERATOR}" MATCHES "Makefile")
|
|||
|
||||
add_test(FindPackageModeMakefileTest ${CMAKE_MAKE_PROGRAM} -f ${CMAKE_CURRENT_BINARY_DIR}/ConfMakefile )
|
||||
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
|
Loading…
Reference in New Issue