Previously CMake block termination commands were required to have arguments
matching the command starting the block. This is no longer necessary and not
the preferred style. This type of change has been implemented in other open
source projects such as: ITK, vxl, and BRAINSTools. It is the preferred style
for KDE. Consistent style practices help improve readability and
maintainability of code.
This was implemented with the shell script:
NOTE: MUST USE GNU compliant version of sed
in else endif endforeach endfunction endmacro endwhile; do
echo 's/\b'"$c"'\(\s*\)(.\+)/'"$c"'\1()/'
done >convert.sed \
&& git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' \
| xargs -0 gsed -i -f convert.sed \
&& rm convert.sed
This is a reimplementation of ITK commit
e52dbe7fa476f6283c9b9d1507fca052355113a4
Fixes #585
89 lines
1.9 KiB
CMake
89 lines
1.9 KiB
CMake
# - Try to find libbfd
|
|
# Once done this will define
|
|
#
|
|
# LIBBFD_FOUND - system has libbfd
|
|
# LIBBFD_INCLUDE_DIRS - the libbfd include directory
|
|
# LIBBFD_LIBRARIES - Link these to use libbfd
|
|
# LIBBFD_DEFINITIONS - Compiler switches required for using libbfd
|
|
#
|
|
# Based on:
|
|
#
|
|
# Copyright (c) 2008 Bernhard Walle <bernhard.walle@gmx.de>
|
|
#
|
|
# Redistribution and use is allowed according to the terms of the New
|
|
# BSD license.
|
|
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
|
#
|
|
|
|
|
|
if (LIBBFD_LIBRARIES AND LIBBFD_INCLUDE_DIRS)
|
|
set (LIBBFD_FIND_QUIETLY TRUE)
|
|
endif ()
|
|
|
|
find_path (LIBBFD_INCLUDE_DIRS
|
|
NAMES
|
|
bfd.h
|
|
dis-asm.h
|
|
PATHS
|
|
/usr/include
|
|
/usr/local/include
|
|
/opt/local/include
|
|
/opt/include
|
|
ENV CPATH)
|
|
|
|
# Ugly, yes ugly...
|
|
find_library (LIBBFD_BFD_LIBRARY
|
|
NAMES
|
|
bfd
|
|
PATHS
|
|
/usr/lib
|
|
/usr/lib64
|
|
/usr/local/lib
|
|
/usr/local/lib64
|
|
/usr/include
|
|
/opt/local/lib
|
|
/opt/usr/lib64
|
|
ENV LIBRARY_PATH
|
|
ENV LD_LIBRARY_PATH)
|
|
|
|
#find_library (LIBBFD_IBERTY_LIBRARY
|
|
# NAMES
|
|
# iberty
|
|
# PATHS
|
|
# /usr/lib
|
|
# /usr/lib64
|
|
# /usr/local/lib
|
|
# /usr/local/lib64
|
|
# /usr/include
|
|
# /opt/local/lib
|
|
# /opt/usr/lib64
|
|
# ENV LIBRARY_PATH
|
|
# ENV LD_LIBRARY_PATH)
|
|
|
|
#find_library (LIBBFD_OPCODES_LIBRARY
|
|
# NAMES
|
|
# opcodes
|
|
# PATHS
|
|
# /usr/lib
|
|
# /usr/lib64
|
|
# /usr/local/lib
|
|
# /usr/local/lib64
|
|
# /usr/include
|
|
# /opt/local/lib
|
|
# /opt/usr/lib64
|
|
# ENV LIBRARY_PATH
|
|
# ENV LD_LIBRARY_PATH)
|
|
|
|
|
|
include (FindPackageHandleStandardArgs)
|
|
|
|
|
|
# handle the QUIETLY and REQUIRED arguments and set LIBBFD_FOUND to TRUE if all listed variables are TRUE
|
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBBFD DEFAULT_MSG
|
|
LIBBFD_BFD_LIBRARY
|
|
# LIBBFD_IBERTY_LIBRARY
|
|
# LIBBFD_OPCODES_LIBRARY
|
|
LIBBFD_INCLUDE_DIRS)
|
|
|
|
set(LIBBFD_LIBRARIES "${LIBBFD_BFD_LIBRARY}")
|
|
mark_as_advanced(LIBBFD_INCLUDE_DIRS LIBBFD_LIBRARIES) |