From: Szilard Pall Date: Mon, 20 Sep 2010 21:26:23 +0000 (+0200) Subject: FindFFT?[F] scripts can use a path provided in FFTWx[F]_ROOT_DIR environment variable... X-Git-Url: http://biod.pnpi.spb.ru/gitweb/?a=commitdiff_plain;h=fe686d3a45a4c16e3b01c7b1f4c18fa8eaab5889;p=alexxy%2Fgromacs.git FindFFT?[F] scripts can use a path provided in FFTWx[F]_ROOT_DIR environment variable when looking for libs/headers --- diff --git a/cmake/FindFFTW2.cmake b/cmake/FindFFTW2.cmake index b41a5818aa..34b6aa8d63 100644 --- a/cmake/FindFFTW2.cmake +++ b/cmake/FindFFTW2.cmake @@ -4,6 +4,8 @@ # FFTW2_INCLUDE_DIR - where to find [d]fftw.h # FFTW2_LIBRARIES - List of libraries when using FFTW. # FFTW2_FOUND - True if FFTW found. +# +# The FFTW2 root installation directory can be provided in the FFTW2_ROOT_DIR if (FFTW2_INCLUDE_DIR) # Already in cache, be silent @@ -12,14 +14,22 @@ endif (FFTW2_INCLUDE_DIR) set(FFTW2_FOUND 0) +file(TO_CMAKE_PATH "$ENV{FFTW2_ROOT_DIR}" _env_FFTW2_ROOT_DIR) foreach(fftw2_name dfftw fftw) string(TOUPPER ${fftw2_name} fftw2_uname) string(REPLACE "fftw" "rfftw" rfftw2_name ${fftw2_name}) if(NOT FFTW2_FOUND) - find_path (FFTW2_INCLUDE_DIR ${fftw2_name}.h) - find_library (CFFTW2_LIBRARIES ${fftw2_name}) - find_library (RFFTW2_LIBRARIES ${rfftw2_name}) + find_path (FFTW2_INCLUDE_DIR + PATHS "${_env_FFTW2_ROOT_DIR}/include" + ${fftw2_name}.h) + CACHE STRING "Path to double precision FFTW2 headers") + find_library (CFFTW2_LIBRARIES ${fftw2_name} + PATHS "${_env_FFTW2_ROOT_DIR}/lib" + CACHE STRING "Double precision CFFTW2 libraries") + find_library (RFFTW2_LIBRARIES ${rfftw2_name} + PATHS "${_env_FFTW2_ROOT_DIR}/lib" + CACHE STRING "Double precision RFFTW2 libraries") TRY_COMPILE(FFTW2_FOUND "${CMAKE_BINARY_DIR}" "${CMAKE_SOURCE_DIR}/cmake/TestFFTW2.c" COMPILE_DEFINITIONS "-I${FFTW2_INCLUDE_DIR} -DDOUBLE -D${fftw2_uname}" ) @@ -36,7 +46,8 @@ endif(FFTW2_FOUND) # 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 (FFTW2 DEFAULT_MSG FFTW2_LIBRARIES FFTW2_INCLUDE_DIR) +set(__MSG "Could not find FFTW2. Provide the fftw2 install directory in the FFTW2_ROOT_DIR environment variable.") +find_package_handle_standard_args (FFTW2 ${__MSG} FFTW2_LIBRARIES FFTW2_INCLUDE_DIR) mark_as_advanced (RFFTW2_LIBRARIES CFFTW2_LIBRARIES FFTW2_LIBRARIES FFTW2_INCLUDE_DIR) diff --git a/cmake/FindFFTW2F.cmake b/cmake/FindFFTW2F.cmake index f04413cd70..23b389f6c7 100644 --- a/cmake/FindFFTW2F.cmake +++ b/cmake/FindFFTW2F.cmake @@ -4,6 +4,9 @@ # FFTW2_INCLUDE_DIR - where to find [d]fftw.h # FFTW2_LIBRARIES - List of libraries when using FFTW. # FFTW2_FOUND - True if FFTW found. +# +# The FFTW2F root installation directory can be provided in the FFTW2F_ROOT_DIR + if (FFTW2_INCLUDE_DIR) # Already in cache, be silent @@ -12,14 +15,22 @@ endif (FFTW2_INCLUDE_DIR) set(FFTW2_FOUND 0) +file(TO_CMAKE_PATH "$ENV{FFTW2F_ROOT_DIR}" _env_FFTW2F_ROOT_DIR) foreach(fftw2_name sfftw fftw) string(TOUPPER ${fftw2_name} fftw2_uname) string(REPLACE "fftw" "rfftw" rfftw2_name ${fftw2_name}) if(NOT FFTW2_FOUND) - find_path (FFTW2_INCLUDE_DIR ${fftw2_name}.h) - find_library (CFFTW2_LIBRARIES ${fftw2_name}) - find_library (RFFTW2_LIBRARIES ${rfftw2_name}) + find_path (FFTW2_INCLUDE_DIR + PATHS "${_env_FFTW2F_ROOT_DIR}/include" + ${fftw2_name}.h + CACHE STRING "Path single precision FFTW2 headers") + find_library (CFFTW2_LIBRARIES ${fftw2_name} + PATHS "${_env_FFTW2F_ROOT_DIR}/lib" + CACHE STRING "Single precision CFFTW2 libraries") + find_library (RFFTW2_LIBRARIES ${rfftw2_name} + PATHS "${_env_FFTW2F_ROOT_DIR}/lib" + CACHE STRING "Single precision RFFTW2 libraries") TRY_COMPILE(FFTW2_FOUND "${CMAKE_BINARY_DIR}" "${CMAKE_SOURCE_DIR}/cmake/TestFFTW2.c" COMPILE_DEFINITIONS "-I${FFTW2_INCLUDE_DIR} -D${fftw2_uname}" ) @@ -36,7 +47,8 @@ endif(FFTW2_FOUND) # 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 (FFTW2 DEFAULT_MSG FFTW2_LIBRARIES FFTW2_INCLUDE_DIR) +set(__MSG "Could not find FFTW2F. Provide the fftw2 install directory in the FFTW2F_ROOT_DIR environment variable.") +find_package_handle_standard_args (FFTW2 ${__MSG} FFTW2_LIBRARIES FFTW2_INCLUDE_DIR) mark_as_advanced (RFFTW2_LIBRARIES CFFTW2_LIBRARIES FFTW2_LIBRARIES FFTW2_INCLUDE_DIR) diff --git a/cmake/FindFFTW3.cmake b/cmake/FindFFTW3.cmake index 616bbbf854..e9a25dc7cd 100644 --- a/cmake/FindFFTW3.cmake +++ b/cmake/FindFFTW3.cmake @@ -4,26 +4,31 @@ # FFTW3_INCLUDE_DIR - where to find fftw3.h # FFTW3_LIBRARIES - List of libraries when using FFTW. # FFTW3_FOUND - True if FFTW found. +# +# The FFTW3 root installation directory can be provided in the FFTW3_ROOT_DIR if (FFTW3_INCLUDE_DIR AND FFTW3_LIBRARIES) # Already in cache, be silent set (FFTW3_FIND_QUIETLY TRUE) endif (FFTW3_INCLUDE_DIR AND FFTW3_LIBRARIES) -find_path (FFTW3_INCLUDE_DIR fftw3.h - CACHE STRING "Path to headers for double precision FFTW3") +file(TO_CMAKE_PATH "$ENV{FFTW3_ROOT_DIR}" _env_FFTW3_ROOT_DIR) +find_path (FFTW3_INCLUDE_DIR fftw3.h + PATHS "${_env_FFTW3_ROOT_DIR}/include" + CACHE STRING "Path to double precision FFTW3 headers") find_library (FFTW3_LIBRARIES NAMES fftw3 - PATHS "${FFTW3_INCLUDE_DIR}/../lib" + PATHS "${_env_FFTW3_ROOT_DIR}/lib" + "${FFTW3_INCLUDE_DIR}/../lib" CACHE STRING "Double precision FFTW3 libraries") - # 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 (FFTW3 DEFAULT_MSG FFTW3_LIBRARIES FFTW3_INCLUDE_DIR) +set(__MSG "Could not find FFTW3. Provide the fftw3 install directory in the FFTW3_ROOT_DIR environment variable.") +find_package_handle_standard_args (FFTW3 ${__MSG} FFTW3_LIBRARIES FFTW3_INCLUDE_DIR) mark_as_advanced (FFTW3_LIBRARIES FFTW3_INCLUDE_DIR) diff --git a/cmake/FindFFTW3F.cmake b/cmake/FindFFTW3F.cmake index 23050153ad..44824dade2 100644 --- a/cmake/FindFFTW3F.cmake +++ b/cmake/FindFFTW3F.cmake @@ -4,23 +4,30 @@ # FFTW3F_INCLUDE_DIR - where to find fftw3.h # FFTW3F_LIBRARIES - List of libraries when using FFTW. # FFTW3F_FOUND - True if FFTW found. +# +# The FFTW3F root installation directory can be provided in the FFTW3F_ROOT_DIR if (FFTW3F_INCLUDE_DIR AND FFTW3F_LIBRARIES) # Already in cache, be silent set (FFTW3F_FIND_QUIETLY TRUE) endif (FFTW3F_INCLUDE_DIR AND FFTW3F_LIBRARIES) +file(TO_CMAKE_PATH "$ENV{FFTW3F_ROOT_DIR}" _env_FFTW3F_ROOT_DIR) + find_path (FFTW3F_INCLUDE_DIR fftw3.h - CACHE STRING "Path to headers for single precision FFTW3") + PATHS "${_env_FFTW3F_ROOT_DIR}/include" + CACHE STRING "Path to single precision FFTW3 headers") find_library (FFTW3F_LIBRARIES NAMES fftw3f - PATHS "${FFTW3F_INCLUDE_DIR}/../lib" + PATHS "${_env_FFTW3F_ROOT_DIR}/lib" + "${FFTW3F_INCLUDE_DIR}/../lib" CACHE STRING "Single precision FFTW3 libraries") # 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 (FFTW3F DEFAULT_MSG FFTW3F_LIBRARIES FFTW3F_INCLUDE_DIR) +set(__MSG "Could not find FFTW3F. Provide the fftw3 install directory in the FFTW3F_ROOT_DIR environment variable.") +find_package_handle_standard_args (FFTW3F ${__MSG} FFTW3F_LIBRARIES FFTW3F_INCLUDE_DIR) mark_as_advanced (FFTW3F_LIBRARIES FFTW3F_INCLUDE_DIR) diff --git a/cmake/FindOpenMM.cmake b/cmake/FindOpenMM.cmake index 5094d1bd94..541b2a453d 100644 --- a/cmake/FindOpenMM.cmake +++ b/cmake/FindOpenMM.cmake @@ -66,8 +66,8 @@ if(NOT IS_DIRECTORY ${OpenMM_ROOT_DIR}) endif() if(NOT IS_DIRECTORY ${OpenMM_ROOT_DIR}) - message(FATAL_ERROR "Can't find OpenMM! Either set the OPENMM_ROOT_DIR environment " - "variable to the path where your OpenMM installation is located or install it to the default location (/usr/local/openmm)!") + message(FATAL_ERROR "Could not find OpenMM! Set the OPENMM_ROOT_DIR environment " + "variable to contain the path of the OpenMM installation.") endif() if(NOT IS_DIRECTORY ${OpenMM_LIBRARY_DIR}) @@ -82,7 +82,7 @@ if(IS_DIRECTORY "${OpenMM_LIBRARY_DIR}/plugins") set(OpenMM_PLUGIN_DIR ${OpenMM_PLUGIN_DIR} CACHE PATH "OpenMM plugins directory") else() message(WARNING "Could not detect the OpenMM plugin directory at the default location (${OpenMM_LIBRARY_DIR}/plugins)." - "Check you OpenMM installation or manually set the OPENMM_PLUGIN_DIR environment variable!") + "Check your OpenMM installation or set the OPENMM_PLUGIN_DIR environment variable!") endif() if(NOT OpenMM_INCLUDE_DIR)