summaryrefslogtreecommitdiffstats
path: root/Tests/FindPackageModeMakefileTest/CMakeLists.txt
blob: d2c6be9c9714248f7d8de1e7413a7f3923c0bbf7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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  AND  UNIX  AND  "${CMAKE_GENERATOR}" MATCHES "Makefile")

    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 )

  endif()

endif()