2011-08-12 01:27:19 +04:00
|
|
|
|
|
|
|
|
2011-08-17 00:31:26 +04:00
|
|
|
# the test program links against the png lib, so test first whether it exists
|
|
|
|
if(UNIX AND "${CMAKE_GENERATOR}" MATCHES "Makefile")
|
2011-08-12 01:27:19 +04:00
|
|
|
|
2011-08-17 00:31:26 +04:00
|
|
|
# build a library which we can search during the test
|
|
|
|
add_library(foo STATIC foo.cpp)
|
2011-08-12 01:27:19 +04:00
|
|
|
|
2011-08-17 00:31:26 +04:00
|
|
|
# configure a FindFoo.cmake so it knows where the library can be found
|
|
|
|
configure_file(FindFoo.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/FindFoo.cmake @ONLY)
|
2011-08-12 01:27:19 +04:00
|
|
|
|
2011-08-17 00:31:26 +04:00
|
|
|
# now set up the test:
|
|
|
|
get_target_property(cmakeExecutable cmake LOCATION)
|
2011-08-12 01:27:19 +04:00
|
|
|
|
2011-08-17 00:31:26 +04:00
|
|
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Makefile.in ${CMAKE_CURRENT_BINARY_DIR}/ConfMakefile @ONLY)
|
|
|
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/main.cpp ${CMAKE_CURRENT_BINARY_DIR}/main.cpp COPYONLY)
|
2011-08-12 01:27:19 +04:00
|
|
|
|
2011-08-17 00:31:26 +04:00
|
|
|
add_test(FindPackageModeMakefileTest ${CMAKE_MAKE_PROGRAM} -f ${CMAKE_CURRENT_BINARY_DIR}/ConfMakefile )
|
2011-08-12 01:27:19 +04:00
|
|
|
|
|
|
|
endif()
|