Skip to content
Snippets Groups Projects
Commit 0d4cd12e authored by Andreas Schenk's avatar Andreas Schenk
Browse files

Refactored borked FindFFTW.cmake to correctly handle fftw threads lib

Refactored FindEigen.cmake to adhere to cmake guidelines
Adapted master CMakeLists.txt to changes in find modules
parent 5b9c3a02
Branches
Tags
No related merge requests found
......@@ -285,10 +285,10 @@ endif()
# basic environment
include_directories(${Boost_INCLUDE_DIRS}
${FFTW_INCLUDE_PATH}
${EIGEN2_INCLUDE_DIR}
${TIFF_INCLUDE_DIR}
${PNG_INCLUDE_DIR}
${FFTW_INCLUDE_DIRS}
${EIGEN2_INCLUDE_DIRS}
${TIFF_INCLUDE_DIRS}
${PNG_INCLUDE_DIRS}
)
if(USE_NUMPY)
include_directories(${PYTHON_NUMPY_INCLUDE_DIR})
......
......@@ -2,26 +2,13 @@
# Once done this will define
#
# EIGEN2_FOUND - system has eigen lib
# EIGEN2_INCLUDE_DIR - the eigen include directory
# EIGEN2_INCLUDE_DIRS - the eigen include directories
# Copyright (c) 2006, 2007 Montel Laurent, <montel@kde.org>
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
#adapted for OpenStructure by Juergen Haas <juergen.haas@unibas.ch>
find_path(EIGEN2_INCLUDE_DIR NAMES Eigen/Core
PATH_SUFFIXES eigen2
)
if (EIGEN2_INCLUDE_DIR)
# in cache already
set(EIGEN2_FOUND TRUE)
else (EIGEN2_INCLUDE_DIR)
find_path(EIGEN2_INCLUDE_DIR NAMES Eigen/Core
PATH_SUFFIXES eigen2
HINTS
${INCLUDE_INSTALL_DIR}
)
endif(EIGEN2_INCLUDE_DIR)
set(EIGEN2_INCLUDE_DIRS ${EIGEN2_INCLUDE_DIR})
include (FindPackageHandleStandardArgs)
find_package_handle_standard_args (EIGEN DEFAULT_MSG EIGEN2_INCLUDE_DIR)
......
# Try to find FFTW
# adapted from FINDEIGEN.cmake of OpenStructure by Juergen Haas <juergen.haas@unibas.ch>
# license see FINDEIGEN.cmake
#
# Once done this will define
# - Find FFTW
# Find the native FFTW includes and library
#
# FFTW_INCLUDE_PATH - where to find gsl/gsl_*.h, etc.
# FFTW_LIBRARIES - List of libraries when using FFTW.
# FFTW_FOUND - True if FFTW found.
if (FFTW_INCLUDE_PATH)
set(FFTW_FOUND TRUE)
else (FFTW_INCLUDE_PATH)
find_path (FFTW_INCLUDE_PATH fftw3.h)
if (_DOUBLE_PREC)
find_library (FFTW_LIBRARIES NAMES fftw3)
find_library (FFTW_THREADS_LIB NAMES fftw3_threads)
elseif(NOT _DOUBLE_PREC)
find_library (FFTW_LIBRARIES NAMES fftw3f)
find_library (FFTW_THREADS_LIB NAMES fftw3f_threads)
endif()
if(FFTW_THREADS_LIB)
SET(FFTW_USE_THREADS TRUE)
SET(FFTW_LIBRARIES ${FFTW_LIBRARIES} ${FFTW_THREADS_LIB} )
else(FFTW_THREADS_LIB)
endif(FFTW_THREADS_LIB)
endif (FFTW_INCLUDE_PATH)
# FFTW_INCLUDE_DIRS - FFTW include dirs.
# FFTW_LIBRARIES - List of libraries when using FFTW.
# FFTW_FOUND - True if FFTW found.
find_path (FFTW_INCLUDE_DIR fftw3.h)
if (_DOUBLE_PREC)
find_library (FFTW_LIBRARY NAMES fftw3)
find_library (FFTW_THREADS_LIB NAMES fftw3_threads)
elseif(NOT _DOUBLE_PREC)
find_library (FFTW_LIBRARY NAMES fftw3f)
find_library (FFTW_THREADS_LIBRARY NAMES fftw3f_threads)
endif()
if(FFTW_THREADS_LIBRARY)
set(FFTW_USE_THREADS TRUE)
set(FFTW_LIBRARIES ${FFTW_LIBRARY} ${FFTW_THREADS_LIBRARY} )
else(FFTW_THREADS_LIBRARY)
set(FFTW_LIBRARIES ${FFTW_LIBRARY} )
endif(FFTW_THREADS_LIBRARY)
set(FFTW_INCLUDE_DIRS ${FFTW_INCLUDE_DIR})
# handle the QUIETLY and REQUIRED arguments and set FFTW_FOUND to TRUE if
# all listed variables are TRUE
include (FindPackageHandleStandardArgs)
find_package_handle_standard_args (FFTW DEFAULT_MSG FFTW_LIBRARIES FFTW_INCLUDE_PATH)
find_package_handle_standard_args (FFTW DEFAULT_MSG FFTW_LIBRARY FFTW_INCLUDE_DIR)
mark_as_advanced (FFTW_LIBRARIES FFTW_INCLUDE_PATH)
mark_as_advanced (FFTW_LIBRARY FFTW_THREADS_LIBRARY FFTW_INCLUDE_DIR)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment