From fa6f5219bf876711a794189531d7bc59bc6c9412 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 29 Apr 2014 12:19:21 +0000 Subject: [PATCH] From Mattias Helsing, "I finally got to fix the cmake Modules that have duplicates in later version of cmake. See attached submission. I have tested the ones that I compile myself (GDAL, Freetype, ZLIB) on ubuntu 12.04 with cmake-2.8.7." --- CMakeModules/FindFLTK.cmake | 9 +++++++++ CMakeModules/FindFreetype.cmake | 10 ++++++++++ CMakeModules/FindGDAL.cmake | 1 + CMakeModules/FindJasper.cmake | 9 +++++++++ CMakeModules/FindOpenThreads.cmake | 10 ++++++++++ CMakeModules/FindQuickTime.cmake | 10 ++++++++++ CMakeModules/FindZLIB.cmake | 10 ++++++++++ 7 files changed, 59 insertions(+) diff --git a/CMakeModules/FindFLTK.cmake b/CMakeModules/FindFLTK.cmake index e376b7896..74583d37f 100644 --- a/CMakeModules/FindFLTK.cmake +++ b/CMakeModules/FindFLTK.cmake @@ -9,6 +9,15 @@ # # Created by Robert Osfield. +# prefer FindFLTK from cmake distribution +if(EXISTS ${CMAKE_ROOT}/Modules/FindFLTK.cmake) + include(${CMAKE_ROOT}/Modules/FindFLTK.cmake) + + if(FLTK_FOUND) + return() + endif() +endif() + FIND_PATH(FLTK_INCLUDE_DIR Fl/Fl.H Fl/Fl.h $ENV{FLTK_DIR}/include $ENV{FLTK_DIR} diff --git a/CMakeModules/FindFreetype.cmake b/CMakeModules/FindFreetype.cmake index ac26dca9a..86c4a1c4f 100644 --- a/CMakeModules/FindFreetype.cmake +++ b/CMakeModules/FindFreetype.cmake @@ -12,6 +12,15 @@ # used in building FREETYPE. # Created by Eric Wing. +# prefer FindFreetype from cmake distribution +if(EXISTS ${CMAKE_ROOT}/Modules/FindFreetype.cmake) + include(${CMAKE_ROOT}/Modules/FindFreetype.cmake) + + if(FREETYPE_FOUND) + return() + endif() +endif() + # Ugh, FreeType seems to use some #include trickery which # makes this harder than it should be. It looks like they # put ft2build.h in a common/easier-to-find location which @@ -24,6 +33,7 @@ # wants explicit full paths and this trickery doesn't work too well. # I'm going to attempt to cut out the middleman and hope # everything still works. + FIND_PATH(FREETYPE_INCLUDE_DIR_ft2build ft2build.h PATHS $ENV{FREETYPE_DIR} diff --git a/CMakeModules/FindGDAL.cmake b/CMakeModules/FindGDAL.cmake index 7abccec53..3b963c4c4 100644 --- a/CMakeModules/FindGDAL.cmake +++ b/CMakeModules/FindGDAL.cmake @@ -19,6 +19,7 @@ # This makes the presumption that you are include gdal.h like # #include "gdal.h" +# prefer FindGDAL from cmake distribution if(EXISTS ${CMAKE_ROOT}/Modules/FindGDAL.cmake) include(${CMAKE_ROOT}/Modules/FindGDAL.cmake) diff --git a/CMakeModules/FindJasper.cmake b/CMakeModules/FindJasper.cmake index acb949f14..4b1a2dd38 100644 --- a/CMakeModules/FindJasper.cmake +++ b/CMakeModules/FindJasper.cmake @@ -9,6 +9,15 @@ # # Created by Robert Osfield. +# prefer FindJasper from cmake distribution +if(EXISTS ${CMAKE_ROOT}/Modules/FindJasper.cmake) + include(${CMAKE_ROOT}/Modules/FindJasper.cmake) + + if(JASPER_FOUND) + return() + endif() +endif() + FIND_PATH(JASPER_INCLUDE_DIR jasper/jasper.h $ENV{JASPER_DIR}/include $ENV{JASPER_DIR}/src/libjasper/include diff --git a/CMakeModules/FindOpenThreads.cmake b/CMakeModules/FindOpenThreads.cmake index ffbad8323..8a19ea886 100644 --- a/CMakeModules/FindOpenThreads.cmake +++ b/CMakeModules/FindOpenThreads.cmake @@ -17,6 +17,16 @@ # # Created by Eric Wing. +# prefer FindOpenThreads from cmake distribution +if(EXISTS ${CMAKE_ROOT}/Modules/FindOpenThreads.cmake) + include(${CMAKE_ROOT}/Modules/FindOpenThreads.cmake) + + if(OPENTHREADS_FOUND) + return() + endif() +endif() + + # Header files are presumed to be included like # #include diff --git a/CMakeModules/FindQuickTime.cmake b/CMakeModules/FindQuickTime.cmake index 84c3d8478..cd5703929 100644 --- a/CMakeModules/FindQuickTime.cmake +++ b/CMakeModules/FindQuickTime.cmake @@ -9,6 +9,16 @@ # # Created by Eric Wing. +# prefer FindQuickTime from cmake distribution +if(EXISTS ${CMAKE_ROOT}/Modules/FindQuickTime.cmake) + include(${CMAKE_ROOT}/Modules/FindQuickTime.cmake) + + if(QUICKTIME_FOUND) + return() + endif() +endif() + + # QuickTime on OS X looks different than QuickTime for Windows, # so I am going to case the two. diff --git a/CMakeModules/FindZLIB.cmake b/CMakeModules/FindZLIB.cmake index 4b3da9193..3583ba302 100644 --- a/CMakeModules/FindZLIB.cmake +++ b/CMakeModules/FindZLIB.cmake @@ -10,6 +10,16 @@ # # Created by Ulrich Hertlein. +# prefer FindZLIB from cmake distribution +if(EXISTS ${CMAKE_ROOT}/Modules/FindZLIB.cmake) + include(${CMAKE_ROOT}/Modules/FindZLIB.cmake) + + if(ZLIB_FOUND) + return() + endif() +endif() + + FIND_PATH(ZLIB_INCLUDE_DIR zlib.h $ENV{ZLIB_DIR}/include $ENV{ZLIB_DIR}