Commit 8ebf74b0 authored by Rolf Eike Beer's avatar Rolf Eike Beer
Browse files

Find* (and some other): use ${CMAKE_CURRENT_LIST_DIR} in include()

This solves a lots of warnings, e.g. in the FindModulesExecuteAll test. If the
installed version on the system is rather old this may even lead to bugs, e.g.
https://bugs.gentoo.org/show_bug.cgi?id=436540
parent d39bd3e6
......@@ -30,7 +30,7 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
include(CMakeParseArguments)
include(${CMAKE_CURRENT_LIST_DIR}/CMakeParseArguments.cmake)
function(CMAKE_EXPAND_IMPORTED_TARGETS _RESULT )
......
......@@ -80,7 +80,7 @@
# The functions defined in this file depend on the fixup_bundle function
# (and others) found in BundleUtilities.cmake
include(BundleUtilities)
include("${CMAKE_CURRENT_LIST_DIR}/BundleUtilities.cmake")
set(DeployQt4_cmake_dir "${CMAKE_CURRENT_LIST_DIR}")
set(DeployQt4_apple_plugins_dir "PlugIns")
......
......@@ -177,7 +177,7 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
include(CMakeParseArguments)
include("${CMAKE_CURRENT_LIST_DIR}/CMakeParseArguments.cmake")
function(ADD_FEATURE_INFO _name _enabled _desc)
......
......@@ -40,8 +40,8 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
include(CheckFunctionExists)
include(CheckFortranFunctionExists)
include(${CMAKE_CURRENT_LIST_DIR}/CheckFunctionExists.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/CheckFortranFunctionExists.cmake)
set(_blas_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
......
......@@ -49,7 +49,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(BZip2
VERSION_VAR BZIP2_VERSION_STRING)
if (BZIP2_FOUND)
include(CheckLibraryExists)
include(${CMAKE_CURRENT_LIST_DIR}/CheckLibraryExists.cmake)
CHECK_LIBRARY_EXISTS("${BZIP2_LIBRARIES}" BZ2_bzCompressInit "" BZIP2_NEED_PREFIX)
endif ()
......
......@@ -28,7 +28,7 @@ find_path(CUPS_INCLUDE_DIR cups/cups.h )
find_library(CUPS_LIBRARIES NAMES cups )
if (CUPS_INCLUDE_DIR AND CUPS_LIBRARIES AND CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE)
include(CheckLibraryExists)
include(${CMAKE_CURRENT_LIST_DIR}/CheckLibraryExists.cmake)
# ippDeleteAttribute is new in cups-1.1.19 (and used by kdeprint)
CHECK_LIBRARY_EXISTS(cups ippDeleteAttribute "" CUPS_HAS_IPP_DELETE_ATTRIBUTE)
......
......@@ -56,7 +56,7 @@ endif()
# prefix as the library was found, if still not found, try curses.h with the
# default search paths.
if(CURSES_CURSES_LIBRARY AND CURSES_NEED_NCURSES)
include(CheckLibraryExists)
include(${CMAKE_CURRENT_LIST_DIR}/CheckLibraryExists.cmake)
CHECK_LIBRARY_EXISTS("${CURSES_CURSES_LIBRARY}"
wsyncup "" CURSES_CURSES_HAS_WSYNCUP)
......
......@@ -58,7 +58,7 @@ if(WIN32)
endif()
if(UNIX)
include(FindX11)
include(${CMAKE_CURRENT_LIST_DIR}/FindX11.cmake)
find_library(FLTK_MATH_LIBRARY m)
set( FLTK_PLATFORM_DEPENDENT_LIBS ${X11_LIBRARIES} ${FLTK_MATH_LIBRARY})
endif()
......
......@@ -58,8 +58,8 @@ set(GIF_LIBRARIES ${GIF_LIBRARY})
# one.
# http://giflib.sourcearchive.com/documentation/4.1.4/files.html
if(GIF_INCLUDE_DIR)
include(CMakePushCheckState)
include(CheckStructHasMember)
include(${CMAKE_CURRENT_LIST_DIR}/CMakePushCheckState.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/CheckStructHasMember.cmake)
CMAKE_PUSH_CHECK_STATE()
set(GIF_VERSION 3)
set(CMAKE_REQUIRED_INCLUDES "${GIF_INCLUDE_DIR}")
......
......@@ -19,7 +19,7 @@
message(STATUS
"WARNING: you are using the obsolete 'GLU' package, please use 'OpenGL' instead")
include(FindOpenGL)
include(${CMAKE_CURRENT_LIST_DIR}/FindOpenGL.cmake)
if (OPENGL_GLU_FOUND)
set (GLU_LIBRARY ${OPENGL_LIBRARIES})
......
......@@ -21,7 +21,7 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
include(FindCygwin)
include(${CMAKE_CURRENT_LIST_DIR}/FindCygwin.cmake)
find_program(GNUPLOT_EXECUTABLE
NAMES
......
......@@ -60,7 +60,7 @@
# This module is maintained by Will Dicharry <wdicharry@stellarscience.com>.
include(SelectLibraryConfigurations)
include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
# List of the valid HDF5 components
......
......@@ -245,7 +245,7 @@ endif()
# KDE3Macros.cmake contains all the KDE specific macros
include(KDE3Macros)
include(${CMAKE_CURRENT_LIST_DIR}/KDE3Macros.cmake)
macro (KDE3_PRINT_RESULTS)
......
......@@ -40,9 +40,9 @@ set(_lapack_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
get_property(_LANGUAGES_ GLOBAL PROPERTY ENABLED_LANGUAGES)
if (NOT _LANGUAGES_ MATCHES Fortran)
include(CheckFunctionExists)
include(${CMAKE_CURRENT_LIST_DIR}/CheckFunctionExists.cmake)
else ()
include(CheckFortranFunctionExists)
include(${CMAKE_CURRENT_LIST_DIR}/CheckFortranFunctionExists.cmake)
endif ()
set(LAPACK_FOUND FALSE)
......
......@@ -45,7 +45,7 @@ if(MPEG2_FOUND)
#some native mpeg2 installations will depend
#on libSDL, if found, add it in.
include( FindSDL )
include(${CMAKE_CURRENT_LIST_DIR}/FindSDL.cmake)
if(SDL_FOUND)
set( MPEG2_LIBRARIES ${MPEG2_LIBRARIES} ${SDL_LIBRARY})
endif()
......
......@@ -78,7 +78,7 @@
# include this to handle the QUIETLY and REQUIRED arguments
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
include(GetPrerequisites)
include(${CMAKE_CURRENT_LIST_DIR}/GetPrerequisites.cmake)
#
# This part detects MPI compilers, attempting to wade through the mess of compiler names in
......
......@@ -103,7 +103,7 @@ else ()
if (OPENGL_gl_LIBRARY)
if(NOT X11_FOUND)
include(FindX11)
include(${CMAKE_CURRENT_LIST_DIR}/FindX11.cmake)
endif()
if (X11_FOUND)
if (NOT APPLE)
......
......@@ -95,7 +95,7 @@ if(CMAKE_C_COMPILER_LOADED)
unset(OpenMP_C_FLAG_CANDIDATES)
else()
_OPENMP_FLAG_CANDIDATES("C")
include(CheckCSourceCompiles)
include(${CMAKE_CURRENT_LIST_DIR}/CheckCSourceCompiles.cmake)
endif()
foreach(FLAG ${OpenMP_C_FLAG_CANDIDATES})
......@@ -126,7 +126,7 @@ if(CMAKE_CXX_COMPILER_LOADED)
unset(OpenMP_CXX_FLAG_CANDIDATES)
else()
_OPENMP_FLAG_CANDIDATES("CXX")
include(CheckCXXSourceCompiles)
include(${CMAKE_CURRENT_LIST_DIR}/CheckCXXSourceCompiles.cmake)
# use the same source for CXX as C for now
set(OpenMP_CXX_TEST_SOURCE ${OpenMP_C_TEST_SOURCE})
......
......@@ -72,7 +72,7 @@
# Output variables of the form OPENSCENEGRAPH_FOO
#
include(Findosg_functions)
include(${CMAKE_CURRENT_LIST_DIR}/Findosg_functions.cmake)
set(_osg_modules_to_process)
foreach(_osg_component ${OpenSceneGraph_FIND_COMPONENTS})
......
......@@ -88,8 +88,8 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
include(FindPackageMessage)
include(CMakeParseArguments)
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageMessage.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/CMakeParseArguments.cmake)
# internal helper macro
macro(_FPHSA_FAILURE_MESSAGE _msg)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment