diff options
author | Alex Neundorf <neundorf@kde.org> | 2011-08-16 20:31:26 (GMT) |
---|---|---|
committer | Alex Neundorf <neundorf@kde.org> | 2011-08-16 20:31:26 (GMT) |
commit | 626fc717c6a6fb880053e645b3f12805f60c102a (patch) | |
tree | 45cd140bb45fc2f0585a41c074cb062e8ccdd91b /Tests/FindPackageModeMakefileTest/CMakeLists.txt | |
parent | ec6982dc8cad04c72a6ab78b7f115ece65e812bd (diff) | |
download | CMake-626fc717c6a6fb880053e645b3f12805f60c102a.zip CMake-626fc717c6a6fb880053e645b3f12805f60c102a.tar.gz CMake-626fc717c6a6fb880053e645b3f12805f60c102a.tar.bz2 |
Much improved test, should now be executed on all UNIXes
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
Diffstat (limited to 'Tests/FindPackageModeMakefileTest/CMakeLists.txt')
-rw-r--r-- | Tests/FindPackageModeMakefileTest/CMakeLists.txt | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/Tests/FindPackageModeMakefileTest/CMakeLists.txt b/Tests/FindPackageModeMakefileTest/CMakeLists.txt index d2c6be9..17f02b4 100644 --- a/Tests/FindPackageModeMakefileTest/CMakeLists.txt +++ b/Tests/FindPackageModeMakefileTest/CMakeLists.txt @@ -1,22 +1,20 @@ -if("${CMAKE_CXX_COMPILER_ID}" MATCHES GNU - OR "${CMAKE_CXX_COMPILER_ID}" MATCHES Intel - OR "${CMAKE_CXX_COMPILER_ID}" MATCHES Clang - OR "${CMAKE_CXX_COMPILER_ID}" MATCHES XL - OR "${CMAKE_CXX_COMPILER_ID}" MATCHES SunPro) - find_package(PNG) +# the test program links against the png lib, so test first whether it exists +if(UNIX AND "${CMAKE_GENERATOR}" MATCHES "Makefile") - # the test program links against the png lib, so test first whether it exists - if(PNG_FOUND AND UNIX AND "${CMAKE_GENERATOR}" MATCHES "Makefile") + # build a library which we can search during the test + add_library(foo STATIC foo.cpp) - get_target_property(cmakeExecutable cmake LOCATION) + # 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) - 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) + # now set up the test: + get_target_property(cmakeExecutable cmake LOCATION) - add_test(FindPackageModeMakefileTest ${CMAKE_MAKE_PROGRAM} -f ${CMAKE_CURRENT_BINARY_DIR}/ConfMakefile ) + 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) - endif() + add_test(FindPackageModeMakefileTest ${CMAKE_MAKE_PROGRAM} -f ${CMAKE_CURRENT_BINARY_DIR}/ConfMakefile ) endif() |