diff options
| -rw-r--r-- | modules-tests/RunAllModuleTests.cmake | 8 | ||||
| -rw-r--r-- | modules-tests/TestFindPackage.cmake | 13 | 
2 files changed, 19 insertions, 2 deletions
diff --git a/modules-tests/RunAllModuleTests.cmake b/modules-tests/RunAllModuleTests.cmake index 9b58959c..31198c50 100644 --- a/modules-tests/RunAllModuleTests.cmake +++ b/modules-tests/RunAllModuleTests.cmake @@ -14,6 +14,14 @@ function(execute_one_test name)     file(MAKE_DIRECTORY "${workingDir}")     execute_process(COMMAND ${CMAKE_COMMAND} "${currentDir}/${name}"                     WORKING_DIRECTORY "${workingDir}") +   # now the same with pkg-config disabled +   set(workingDir "${currentDir}/${name}/build-no-pkgconfig") +   if(CLEAN_DIRS) +      file(REMOVE_RECURSE "${workingDir}") +   endif(CLEAN_DIRS) +   file(MAKE_DIRECTORY "${workingDir}") +   execute_process(COMMAND ${CMAKE_COMMAND} -DPKG_CONFIG_EXECUTABLE=echo "${currentDir}/${name}" +                   WORKING_DIRECTORY "${workingDir}")  endfunction(execute_one_test)  execute_one_test(Blitz) diff --git a/modules-tests/TestFindPackage.cmake b/modules-tests/TestFindPackage.cmake index d176938f..8de22b06 100644 --- a/modules-tests/TestFindPackage.cmake +++ b/modules-tests/TestFindPackage.cmake @@ -17,7 +17,16 @@ cmake_minimum_required(VERSION 2.6.2)  cmake_policy(SET CMP0000 OLD)  macro(TEST_FIND_PACKAGE package prefix ) -   message(STATUS ":: ***** Testing Find${package}.cmake *****") +   # if PKG_CONFIG_EXECUTABLE is set to "echo", FindPkgConfig.cmake +   # will not search again for the real pkg-config, as it would if it was set to NOTFOUND +   # and still the execute_process(${PKG_CONFIG_EXECUTABLE} ) calls will work +   # but never return success. +   if("${PKG_CONFIG_EXECUTABLE}" STREQUAL "echo") +      message(STATUS ":: ***** Testing Find${package}.cmake, with pkg-config disabled *****") +   else("${PKG_CONFIG_EXECUTABLE}" STREQUAL "echo") +      message(STATUS ":: ***** Testing Find${package}.cmake *****") +   endif("${PKG_CONFIG_EXECUTABLE}" STREQUAL "echo") +     find_package(${package})     message(STATUS ":: ***** Results from Find${package}.cmake *****") @@ -31,5 +40,5 @@ macro(TEST_FIND_PACKAGE package prefix )     foreach(var ${ARGN})        message(STATUS ":: ${prefix}_${var}: \"${${prefix}_${var}}\"")     endforeach(var) -   message(STATUS ":: ***** Done *****") +   message(STATUS "::")  endmacro(TEST_FIND_PACKAGE package)  | 
