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
48 lines
1.2 KiB
CMake
48 lines
1.2 KiB
CMake
# - Find CBLAS (includes and library)
|
|
# This module defines
|
|
# CBLAS_INCLUDE_DIR
|
|
# CBLAS_LIBRARIES
|
|
# CBLAS_FOUND
|
|
# also defined, but not for general use are
|
|
# CBLAS_LIBRARY, where to find the library.
|
|
|
|
find_path(CBLAS_INCLUDE_DIR cblas.h
|
|
/usr/include/atlas/
|
|
/usr/local/include/atlas/
|
|
/usr/include/
|
|
/usr/local/include/
|
|
)
|
|
|
|
set(CBLAS_NAMES ${CBLAS_NAMES} cblas)
|
|
find_library(CBLAS_LIBRARY
|
|
NAMES ${CBLAS_NAMES}
|
|
PATHS /usr/lib64/atlas-sse3 /usr/lib64/atlas /usr/lib64 /usr/local/lib64/atlas /usr/local/lib64 /usr/lib/atlas-sse3 /usr/lib/atlas-sse2 /usr/lib/atlas-sse /usr/lib/atlas-3dnow /usr/lib/atlas /usr/lib /usr/local/lib/atlas /usr/local/lib
|
|
)
|
|
|
|
if (CBLAS_LIBRARY AND CBLAS_INCLUDE_DIR)
|
|
set(CBLAS_LIBRARIES ${CBLAS_LIBRARY})
|
|
set(CBLAS_FOUND "YES")
|
|
else ()
|
|
set(CBLAS_FOUND "NO")
|
|
endif ()
|
|
|
|
|
|
if (CBLAS_FOUND)
|
|
if (NOT CBLAS_FIND_QUIETLY)
|
|
message(STATUS "Found a CBLAS library: ${CBLAS_LIBRARIES}")
|
|
endif ()
|
|
else ()
|
|
if (CBLAS_FIND_REQUIRED)
|
|
message(FATAL_ERROR "Could not find a CBLAS library")
|
|
endif ()
|
|
endif ()
|
|
|
|
# Deprecated declarations.
|
|
set (NATIVE_CBLAS_INCLUDE_PATH ${CBLAS_INCLUDE_DIR} )
|
|
get_filename_component (NATIVE_CBLAS_LIB_PATH ${CBLAS_LIBRARY} PATH)
|
|
|
|
mark_as_advanced(
|
|
CBLAS_LIBRARY
|
|
CBLAS_INCLUDE_DIR
|
|
)
|