diff options
Diffstat (limited to 'attic/modules-tests')
25 files changed, 231 insertions, 0 deletions
diff --git a/attic/modules-tests/AGG/CMakeLists.txt b/attic/modules-tests/AGG/CMakeLists.txt new file mode 100644 index 00000000..3d0e7b90 --- /dev/null +++ b/attic/modules-tests/AGG/CMakeLists.txt @@ -0,0 +1,5 @@ +include("${CMAKE_CURRENT_SOURCE_DIR}/../TestFindPackage.cmake") + +set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../modules" ) + +test_find_package(AGG AGG INCLUDE_DIR LIBRARIES DEFINITIONS) diff --git a/attic/modules-tests/Blitz/CMakeLists.txt b/attic/modules-tests/Blitz/CMakeLists.txt new file mode 100644 index 00000000..ef81e4df --- /dev/null +++ b/attic/modules-tests/Blitz/CMakeLists.txt @@ -0,0 +1,5 @@ +include("${CMAKE_CURRENT_SOURCE_DIR}/../TestFindPackage.cmake") + +set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../modules" ) + +test_find_package(Blitz BLITZ INCLUDES LIBRARIES) diff --git a/attic/modules-tests/BlueZ/CMakeLists.txt b/attic/modules-tests/BlueZ/CMakeLists.txt new file mode 100644 index 00000000..bfc17709 --- /dev/null +++ b/attic/modules-tests/BlueZ/CMakeLists.txt @@ -0,0 +1,5 @@ +include("${CMAKE_CURRENT_SOURCE_DIR}/../TestFindPackage.cmake") + +set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../modules" ) + +test_find_package(BlueZ BLUEZ INCLUDE_DIR LIBRARIES DEFINITIONS) diff --git a/attic/modules-tests/ENCHANT/CMakeLists.txt b/attic/modules-tests/ENCHANT/CMakeLists.txt new file mode 100644 index 00000000..6ed9e51f --- /dev/null +++ b/attic/modules-tests/ENCHANT/CMakeLists.txt @@ -0,0 +1,5 @@ +include("${CMAKE_CURRENT_SOURCE_DIR}/../TestFindPackage.cmake") + +set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../modules" ) + +test_find_package(ENCHANT ENCHANT INCLUDE_DIR LIBRARIES DEFINITIONS) diff --git a/attic/modules-tests/Eigen2/CMakeLists.txt b/attic/modules-tests/Eigen2/CMakeLists.txt new file mode 100644 index 00000000..b2ae0d35 --- /dev/null +++ b/attic/modules-tests/Eigen2/CMakeLists.txt @@ -0,0 +1,5 @@ +include("${CMAKE_CURRENT_SOURCE_DIR}/../TestFindPackage.cmake") + +set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../modules" ) + +test_find_package(Eigen2 EIGEN2 INCLUDE_DIR ) diff --git a/attic/modules-tests/FFmpeg/CMakeLists.txt b/attic/modules-tests/FFmpeg/CMakeLists.txt new file mode 100644 index 00000000..4c93079b --- /dev/null +++ b/attic/modules-tests/FFmpeg/CMakeLists.txt @@ -0,0 +1,5 @@ +include("${CMAKE_CURRENT_SOURCE_DIR}/../TestFindPackage.cmake") + +set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../modules" ) + +test_find_package(FFmpeg FFMPEG INCLUDE_DIR LIBRARIES DEFINITIONS) diff --git a/attic/modules-tests/Flac/CMakeLists.txt b/attic/modules-tests/Flac/CMakeLists.txt new file mode 100644 index 00000000..604f2dd6 --- /dev/null +++ b/attic/modules-tests/Flac/CMakeLists.txt @@ -0,0 +1,5 @@ +include("${CMAKE_CURRENT_SOURCE_DIR}/../TestFindPackage.cmake") + +set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../modules" ) + +test_find_package(Flac FLAC INCLUDE_DIR LIBRARIES OGGFLAC_LIBRARIES) diff --git a/attic/modules-tests/Flex/CMakeLists.txt b/attic/modules-tests/Flex/CMakeLists.txt new file mode 100644 index 00000000..38b66566 --- /dev/null +++ b/attic/modules-tests/Flex/CMakeLists.txt @@ -0,0 +1,5 @@ +include("${CMAKE_CURRENT_SOURCE_DIR}/../TestFindPackage.cmake") + +set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../modules" ) + +test_find_package(Flex FLEX VERSION EXECUTABLE) diff --git a/attic/modules-tests/GObject/CMakeLists.txt b/attic/modules-tests/GObject/CMakeLists.txt new file mode 100644 index 00000000..971a20be --- /dev/null +++ b/attic/modules-tests/GObject/CMakeLists.txt @@ -0,0 +1,5 @@ +include("${CMAKE_CURRENT_SOURCE_DIR}/../TestFindPackage.cmake") + +set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../modules" ) + +test_find_package(GObject GOBJECT INCLUDE_DIR LIBRARIES DEFINITIONS) diff --git a/attic/modules-tests/GStreamer/CMakeLists.txt b/attic/modules-tests/GStreamer/CMakeLists.txt new file mode 100644 index 00000000..896a8536 --- /dev/null +++ b/attic/modules-tests/GStreamer/CMakeLists.txt @@ -0,0 +1,5 @@ +include("${CMAKE_CURRENT_SOURCE_DIR}/../TestFindPackage.cmake") + +set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../modules" ) + +test_find_package(GStreamer GSTREAMER INCLUDE_DIR LIBRARIES DEFINITIONS) diff --git a/attic/modules-tests/LCMS/CMakeLists.txt b/attic/modules-tests/LCMS/CMakeLists.txt new file mode 100644 index 00000000..43a90425 --- /dev/null +++ b/attic/modules-tests/LCMS/CMakeLists.txt @@ -0,0 +1,5 @@ +include("${CMAKE_CURRENT_SOURCE_DIR}/../TestFindPackage.cmake") + +set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../modules" ) + +test_find_package(LCMS LCMS INCLUDE_DIR LIBRARIES VERSION) diff --git a/attic/modules-tests/LibArt/CMakeLists.txt b/attic/modules-tests/LibArt/CMakeLists.txt new file mode 100644 index 00000000..e64d2310 --- /dev/null +++ b/attic/modules-tests/LibArt/CMakeLists.txt @@ -0,0 +1,5 @@ +include("${CMAKE_CURRENT_SOURCE_DIR}/../TestFindPackage.cmake") + +set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../modules" ) + +test_find_package(LibArt LIBART INCLUDE_DIR LIBRARIES) diff --git a/attic/modules-tests/LibXslt/CMakeLists.txt b/attic/modules-tests/LibXslt/CMakeLists.txt new file mode 100644 index 00000000..561a6930 --- /dev/null +++ b/attic/modules-tests/LibXslt/CMakeLists.txt @@ -0,0 +1,5 @@ +include("${CMAKE_CURRENT_SOURCE_DIR}/../TestFindPackage.cmake") + +set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../modules" ) + +test_find_package(LibXslt LIBXSLT INCLUDE_DIR LIBRARIES DEFINITIONS XSLTPROC_EXECUTABLE) diff --git a/attic/modules-tests/OpenEXR/CMakeLists.txt b/attic/modules-tests/OpenEXR/CMakeLists.txt new file mode 100644 index 00000000..dd33dab9 --- /dev/null +++ b/attic/modules-tests/OpenEXR/CMakeLists.txt @@ -0,0 +1,5 @@ +include("${CMAKE_CURRENT_SOURCE_DIR}/../TestFindPackage.cmake") + +set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../modules" ) + +test_find_package(OpenEXR OPENEXR INCLUDE_DIR LIBRARIES DEFINITIONS) diff --git a/attic/modules-tests/PCRE/CMakeLists.txt b/attic/modules-tests/PCRE/CMakeLists.txt new file mode 100644 index 00000000..928806da --- /dev/null +++ b/attic/modules-tests/PCRE/CMakeLists.txt @@ -0,0 +1,5 @@ +include("${CMAKE_CURRENT_SOURCE_DIR}/../TestFindPackage.cmake") + +set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../modules" ) + +test_find_package(PCRE PCRE INCLUDE_DIR LIBRARIES) diff --git a/attic/modules-tests/QCA2/CMakeLists.txt b/attic/modules-tests/QCA2/CMakeLists.txt new file mode 100644 index 00000000..46f617ed --- /dev/null +++ b/attic/modules-tests/QCA2/CMakeLists.txt @@ -0,0 +1,5 @@ +include("${CMAKE_CURRENT_SOURCE_DIR}/../TestFindPackage.cmake") + +set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../modules" ) + +test_find_package(QCA2 QCA2 INCLUDE_DIR LIBRARIES DEFINITIONS) diff --git a/attic/modules-tests/QImageBlitz/CMakeLists.txt b/attic/modules-tests/QImageBlitz/CMakeLists.txt new file mode 100644 index 00000000..12edb3f7 --- /dev/null +++ b/attic/modules-tests/QImageBlitz/CMakeLists.txt @@ -0,0 +1,5 @@ +include("${CMAKE_CURRENT_SOURCE_DIR}/../TestFindPackage.cmake") + +set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../modules" ) + +test_find_package(QImageBlitz QIMAGEBLITZ INCLUDES LIBRARIES) diff --git a/attic/modules-tests/RunAllModuleTests.cmake b/attic/modules-tests/RunAllModuleTests.cmake new file mode 100644 index 00000000..d68f61fd --- /dev/null +++ b/attic/modules-tests/RunAllModuleTests.cmake @@ -0,0 +1,59 @@ +# Run this script via "cmake -P RunAllModuletests.cmake" to +# execute all module tests in one go. +# Run this script with "cmake -DMODULE=foo -P RunAllModuletests.cmake" to +# test only the one specified module. +# To see only the results and not the other cmake output, +# you can grep for "::". +# To have it delete the previous test build dirs, run it with -DCLEAN_DIRS=TRUE + +get_filename_component(currentDir "${CMAKE_CURRENT_LIST_FILE}" PATH) + +function(execute_one_test name) + set(workingDir "${currentDir}/${name}/build") + if(CLEAN_DIRS) + file(REMOVE_RECURSE "${workingDir}") + endif(CLEAN_DIRS) + 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) + +if(DEFINED MODULE) + set(modulesToTest ${MODULE}) +else(DEFINED MODULE) + set(modulesToTest AGG + Blitz + BlueZ + ENCHANT + Eigen2 + FFmpeg + Flac + Flex + GObject + GStreamer + LCMS + LibArt + LibXslt + OpenEXR + PCRE + QCA2 + QImageBlitz + Sqlite + Strigi + USB + Xine + Xmms) +endif(DEFINED MODULE) + +foreach(currentModule ${modulesToTest}) + execute_one_test(${currentModule}) +endforeach(currentModule ${modulesToTest}) + diff --git a/attic/modules-tests/Sqlite/CMakeLists.txt b/attic/modules-tests/Sqlite/CMakeLists.txt new file mode 100644 index 00000000..000be428 --- /dev/null +++ b/attic/modules-tests/Sqlite/CMakeLists.txt @@ -0,0 +1,5 @@ +include("${CMAKE_CURRENT_SOURCE_DIR}/../TestFindPackage.cmake") + +set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../modules" ) + +test_find_package(Sqlite SQLITE INCLUDE_DIR LIBRARIES DEFINITIONS) diff --git a/attic/modules-tests/Strigi/CMakeLists.txt b/attic/modules-tests/Strigi/CMakeLists.txt new file mode 100644 index 00000000..bbe1e23f --- /dev/null +++ b/attic/modules-tests/Strigi/CMakeLists.txt @@ -0,0 +1,17 @@ +include("${CMAKE_CURRENT_SOURCE_DIR}/../TestFindPackage.cmake") + +set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../modules" ) + +set(STRIGI_MIN_VERSION 0.6.0) + +#find_package(Strigi 1.2.3) + +test_find_package(Strigi STRIGI VERSION + INCLUDE_DIR + STREAMANALYZER_LIBRARY + STREAMS_LIBRARY + STRIGIQTDBUSCLIENT_LIBRARY + NEEDS_SIGNED_CHAR + NEEDS_CHAR + LINE_ANALYZER_PREFIX + THROUGH_ANALYZER_PREFIX ) diff --git a/attic/modules-tests/TestFindPackage.cmake b/attic/modules-tests/TestFindPackage.cmake new file mode 100644 index 00000000..8de22b06 --- /dev/null +++ b/attic/modules-tests/TestFindPackage.cmake @@ -0,0 +1,44 @@ +# This module provides the macro TEST_FIND_PACKAGE() +# +# TEST_FIND_PACKAGE(package prefix var1 .. varN ) +# It can be used to test a CMake Find-module. +# It executes FIND_PACKAGE(<package>) and then prints some results. +# <package> is the same as for FIND_PACKAGE() and +# prefix should be the prefix which is used in that module for +# all variables. +# It checks <prefix>_FOUND to decide whether the module was successful or not. +# +# Example: +# test_find_package(Xine XINE VERSION INCLUDE_DIR LIBRARY) +# +# This will check XINE_FOUND and then print the variables XINE_VERSION, XINE_INCLUDE_DIR and XINE_LIBRARY. + +cmake_minimum_required(VERSION 2.6.2) +cmake_policy(SET CMP0000 OLD) + +macro(TEST_FIND_PACKAGE package prefix ) + # 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 *****") + + if ( ${prefix}_FOUND) + message(STATUS ":: Find${package}.cmake: ${package} has been found") + else ( ${prefix}_FOUND) + message(STATUS ":: Find${package}.cmake: ${package} has NOT been found !") + endif ( ${prefix}_FOUND) + + message(STATUS ":: ${prefix}_FOUND: \"${${prefix}_FOUND}\"") + foreach(var ${ARGN}) + message(STATUS ":: ${prefix}_${var}: \"${${prefix}_${var}}\"") + endforeach(var) + message(STATUS "::") +endmacro(TEST_FIND_PACKAGE package) diff --git a/attic/modules-tests/USB/CMakeLists.txt b/attic/modules-tests/USB/CMakeLists.txt new file mode 100644 index 00000000..37f9dd2c --- /dev/null +++ b/attic/modules-tests/USB/CMakeLists.txt @@ -0,0 +1,5 @@ +include("${CMAKE_CURRENT_SOURCE_DIR}/../TestFindPackage.cmake") + +set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../modules" ) + +test_find_package(USB LIBUSB INCLUDE_DIR LIBRARIES) diff --git a/attic/modules-tests/Xine/CMakeLists.txt b/attic/modules-tests/Xine/CMakeLists.txt new file mode 100644 index 00000000..8c2ac6e6 --- /dev/null +++ b/attic/modules-tests/Xine/CMakeLists.txt @@ -0,0 +1,5 @@ +include("${CMAKE_CURRENT_SOURCE_DIR}/../TestFindPackage.cmake") + +set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../modules" ) + +test_find_package(Xine XINE VERSION BUGFIX_VERSION INCLUDE_DIR LIBRARY XCB_FOUND) diff --git a/attic/modules-tests/Xmms/CMakeLists.txt b/attic/modules-tests/Xmms/CMakeLists.txt new file mode 100644 index 00000000..c55e6a44 --- /dev/null +++ b/attic/modules-tests/Xmms/CMakeLists.txt @@ -0,0 +1,5 @@ +include("${CMAKE_CURRENT_SOURCE_DIR}/../TestFindPackage.cmake") + +set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../modules" ) + +test_find_package(Xmms XMMS INCLUDE_DIR LIBRARIES ) diff --git a/attic/modules-tests/readme.txt b/attic/modules-tests/readme.txt new file mode 100644 index 00000000..2fabc9bf --- /dev/null +++ b/attic/modules-tests/readme.txt @@ -0,0 +1,6 @@ +in each of the subdirs here is a simple CMakeLists.txt which does a very +basic test for one of the cmake modules in the modules/ directory. +To run them, create a build directory, run cmake and check the output. +(yes, this can of course be enhanced, but it's better than nothing). + +Alex |