Warning, /frameworks/kdelibs4support/cmake/modules-tests/TestFindPackage.cmake is written in an unsupported language. File is not indexed.
0001 # This module provides the macro TEST_FIND_PACKAGE() 0002 # 0003 # TEST_FIND_PACKAGE(package prefix var1 .. varN ) 0004 # It can be used to test a CMake Find-module. 0005 # It executes FIND_PACKAGE(<package>) and then prints some results. 0006 # <package> is the same as for FIND_PACKAGE() and 0007 # prefix should be the prefix which is used in that module for 0008 # all variables. 0009 # It checks <prefix>_FOUND to decide whether the module was successful or not. 0010 # 0011 # Example: 0012 # test_find_package(Xine XINE VERSION INCLUDE_DIR LIBRARY) 0013 # 0014 # This will check XINE_FOUND and then print the variables XINE_VERSION, XINE_INCLUDE_DIR and XINE_LIBRARY. 0015 0016 cmake_minimum_required(VERSION 2.6.2) 0017 cmake_policy(SET CMP0000 OLD) 0018 0019 macro(TEST_FIND_PACKAGE package prefix ) 0020 # if PKG_CONFIG_EXECUTABLE is set to "echo", FindPkgConfig.cmake 0021 # will not search again for the real pkg-config, as it would if it was set to NOTFOUND 0022 # and still the execute_process(${PKG_CONFIG_EXECUTABLE} ) calls will work 0023 # but never return success. 0024 if("${PKG_CONFIG_EXECUTABLE}" STREQUAL "echo") 0025 message(STATUS ":: ***** Testing Find${package}.cmake, with pkg-config disabled *****") 0026 else("${PKG_CONFIG_EXECUTABLE}" STREQUAL "echo") 0027 message(STATUS ":: ***** Testing Find${package}.cmake *****") 0028 endif("${PKG_CONFIG_EXECUTABLE}" STREQUAL "echo") 0029 0030 find_package(${package}) 0031 message(STATUS ":: ***** Results from Find${package}.cmake *****") 0032 0033 if ( ${prefix}_FOUND) 0034 message(STATUS ":: Find${package}.cmake: ${package} has been found") 0035 else ( ${prefix}_FOUND) 0036 message(STATUS ":: Find${package}.cmake: ${package} has NOT been found !") 0037 endif ( ${prefix}_FOUND) 0038 0039 message(STATUS ":: ${prefix}_FOUND: \"${${prefix}_FOUND}\"") 0040 foreach(var ${ARGN}) 0041 message(STATUS ":: ${prefix}_${var}: \"${${prefix}_${var}}\"") 0042 endforeach(var) 0043 message(STATUS "::") 0044 endmacro(TEST_FIND_PACKAGE package)