diff options
Diffstat (limited to 'Tests/FindPackageModeMakefileTest/CMakeLists.txt')
-rw-r--r-- | Tests/FindPackageModeMakefileTest/CMakeLists.txt | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/Tests/FindPackageModeMakefileTest/CMakeLists.txt b/Tests/FindPackageModeMakefileTest/CMakeLists.txt new file mode 100644 index 0000000..0be3783 --- /dev/null +++ b/Tests/FindPackageModeMakefileTest/CMakeLists.txt @@ -0,0 +1,22 @@ + +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(PNG_FOUND) + + get_target_property(cmakeExecutable cmake LOCATION) + + 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) + + add_test(FindPackageModeMakefileTest ${CMAKE_MAKE_PROGRAM} -f ${CMAKE_CURRENT_BINARY_DIR}/ConfMakefile -C ${CMAKE_CURRENT_BINARY_DIR} ) + + endif() + +endif() |