Skip to content
Snippets Groups Projects
Commit 285b7093 authored by Marcel Loose's avatar Marcel Loose :sunglasses:
Browse files

Bug 1310: LofarFindPackage now uses <PKG>_INCLUDE_DIR to set include...

Bug 1310: LofarFindPackage now uses <PKG>_INCLUDE_DIR to set include directories, if <PKG>_INCLUDE_DIRS was not set. This solves an issue with a lot of FindXXX macros that come with CMake that otherwise had to be wrapped. The two wrappers FindLibXml2 and FindPNG are made obsolete by this fix.
parent 8346edec
No related branches found
No related tags found
No related merge requests found
# - A tiny wrapper around the FindLibXml2.cmake macro that comes with CMake.
# Its purpose is to set some variables that should have been set according
# to the recommendations for writing FindXXX.cmake files.
# Call the "real" FindLibXml2 module.
include(${CMAKE_ROOT}/Modules/FindLibXml2.cmake)
# Set missing variables if LibXml2 was found.
if(LIBXML2_FOUND)
if(NOT DEFINED LIBXML2_INCLUDE_DIRS)
set(LIBXML2_INCLUDE_DIRS ${LIBXML2_INCLUDE_DIR})
endif(NOT DEFINED LIBXML2_INCLUDE_DIRS)
endif(LIBXML2_FOUND)
# - A tiny wrapper around the FindPNG.cmake macro that comes with CMake.
# Its purpose is to set variables that should have been set, according to the
# standard for FindXXX modules, but weren't.
# Copyright (C) 2010
# ASTRON (Netherlands Institute for Radio Astronomy)
# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
#
# This file is part of the LOFAR software suite.
# The LOFAR software suite is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# The LOFAR software suite is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
#
# $Id$
# Call the "real" FindPNG module.
include(${CMAKE_ROOT}/Modules/FindPNG.cmake)
# Set PNG_INCLUDE_DIRS if PNG was found and PNG_INCLUDE_DIRS was not yet set.
if(PNG_FOUND)
if(NOT PNG_INCLUDE_DIRS)
set(PNG_INCLUDE_DIRS ${PNG_INCLUDE_DIR})
endif(NOT PNG_INCLUDE_DIRS)
endif(PNG_FOUND)
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
# #
# Furthermore: # Furthermore:
# Add preprocessor definitions that are defined in <PKG>_DEFINITIONS. # Add preprocessor definitions that are defined in <PKG>_DEFINITIONS.
# Add include directories that are defined <PKG>_INCLUDE_DIRS. # Add include directories that are defined <PKG>_INCLUDE_DIR[S].
# Add <PKG>_LIBRARIES to the list of LOFAR_EXTRA_LIBRARIES, needed for # Add <PKG>_LIBRARIES to the list of LOFAR_EXTRA_LIBRARIES, needed for
# linking. # linking.
# Add cache variable HAVE_<PKG> that indicates whether the package was found; # Add cache variable HAVE_<PKG> that indicates whether the package was found;
...@@ -76,7 +76,11 @@ function(lofar_find_package _package) ...@@ -76,7 +76,11 @@ function(lofar_find_package _package)
set(HAVE_${_PKG} TRUE CACHE INTERNAL "Have ${_package}?") set(HAVE_${_PKG} TRUE CACHE INTERNAL "Have ${_package}?")
endif(NOT DEFINED HAVE_${_PKG}) endif(NOT DEFINED HAVE_${_PKG})
add_definitions(${${_PKG}_DEFINITIONS}) add_definitions(${${_PKG}_DEFINITIONS})
include_directories(${${_PKG}_INCLUDE_DIRS}) if(${_PKG}_INCLUDE_DIRS})
include_directories(${${_PKG}_INCLUDE_DIRS})
else(${_PKG}_INCLUDE_DIRS})
include_directories(${${_PKG}_INCLUDE_DIR})
endif(${_PKG}_INCLUDE_DIRS})
set(LOFAR_EXTRA_LIBRARIES ${LOFAR_EXTRA_LIBRARIES} ${${_PKG}_LIBRARIES} set(LOFAR_EXTRA_LIBRARIES ${LOFAR_EXTRA_LIBRARIES} ${${_PKG}_LIBRARIES}
PARENT_SCOPE) PARENT_SCOPE)
else(${_PKG}_FOUND) else(${_PKG}_FOUND)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment