Commit 9bcebc44 authored by PRUVOST Florent's avatar PRUVOST Florent
Browse files

set _DEP output variables even in PKG_CONFIG case - handle not required...

set _DEP output variables even in PKG_CONFIG case - handle not required COMPONENTS (when OPTIONAL_COMPONENTS is used)
parent 5966d634
......@@ -117,7 +117,7 @@ endif()
# -------------------------------------------------------------------------------------
include(FindPkgConfig)
find_package(PkgConfig QUIET)
if(PKG_CONFIG_EXECUTABLE AND NOT CHAMELEON_DIR)
if(PKG_CONFIG_EXECUTABLE)
pkg_search_module(CHAMELEON chameleon)
if (NOT CHAMELEON_FIND_QUIETLY)
......@@ -156,9 +156,13 @@ if(PKG_CONFIG_EXECUTABLE AND NOT CHAMELEON_DIR)
endif()
endif()
set(CHAMELEON_INCLUDE_DIRS_DEP "${CHAMELEON_INCLUDE_DIRS}")
set(CHAMELEON_LIBRARY_DIRS_DEP "${CHAMELEON_LIBRARY_DIRS}")
set(CHAMELEON_LIBRARIES_DEP "${CHAMELEON_LIBRARIES}")
endif()
if( (NOT PKG_CONFIG_EXECUTABLE AND NOT CHAMELEON_FOUND) OR NOT CHAMELEON_FOUND )
if( (NOT PKG_CONFIG_EXECUTABLE AND NOT CHAMELEON_FOUND) OR NOT CHAMELEON_FOUND OR CHAMELEON_DIR )
if (NOT CHAMELEON_FIND_QUIETLY)
message(STATUS "Looking for CHAMELEON - PkgConfig not used")
......@@ -266,7 +270,7 @@ if( (NOT PKG_CONFIG_EXECUTABLE AND NOT CHAMELEON_FOUND) OR NOT CHAMELEON_FOUND )
# CHAMELEON may depend on CUDA/CUBLAS
#------------------------------------
if (NOT CUDA_FOUND AND CHAMELEON_LOOK_FOR_CUDA)
if (CHAMELEON_FIND_REQUIRED)
if (CHAMELEON_FIND_REQUIRED AND CHAMELEON_FIND_REQUIRED_CUDA)
find_package(CUDA REQUIRED)
else()
find_package(CUDA)
......@@ -286,7 +290,7 @@ if( (NOT PKG_CONFIG_EXECUTABLE AND NOT CHAMELEON_FOUND) OR NOT CHAMELEON_FOUND )
#-------------------------------------------------
if( CUDA_FOUND AND CHAMELEON_LOOK_FOR_MAGMA )
set(CHAMELEON_MAGMA_VERSION "1.4" CACHE STRING "oldest MAGMA version desired")
if (CHAMELEON_FIND_REQUIRED)
if (CHAMELEON_FIND_REQUIRED AND CHAMELEON_FIND_REQUIRED_MAGMA)
find_package(MAGMA ${CHAMELEON_MAGMA_VERSION} REQUIRED)
else()
find_package(MAGMA ${CHAMELEON_MAGMA_VERSION})
......@@ -303,7 +307,7 @@ if( (NOT PKG_CONFIG_EXECUTABLE AND NOT CHAMELEON_FOUND) OR NOT CHAMELEON_FOUND )
if(NOT MPI_C_COMPILER)
set(MPI_C_COMPILER mpicc)
endif()
if (CHAMELEON_FIND_REQUIRED)
if (CHAMELEON_FIND_REQUIRED AND CHAMELEON_FIND_REQUIRED_MPI)
find_package(MPI REQUIRED)
else()
find_package(MPI)
......@@ -339,7 +343,7 @@ if( (NOT PKG_CONFIG_EXECUTABLE AND NOT CHAMELEON_FOUND) OR NOT CHAMELEON_FOUND )
if (CHAMELEON_LOOK_FOR_FXT)
list(APPEND STARPU_COMPONENT_LIST "FXT")
endif()
if (CHAMELEON_FIND_REQUIRED)
if (CHAMELEON_FIND_REQUIRED AND CHAMELEON_FIND_REQUIRED_STARPU)
find_package(STARPU ${CHAMELEON_STARPU_VERSION} REQUIRED
COMPONENTS ${STARPU_COMPONENT_LIST})
else()
......@@ -352,7 +356,7 @@ if( (NOT PKG_CONFIG_EXECUTABLE AND NOT CHAMELEON_FOUND) OR NOT CHAMELEON_FOUND )
if( NOT QUARK_FOUND AND CHAMELEON_LOOK_FOR_QUARK )
# try to find quark runtime
if (CHAMELEON_FIND_REQUIRED)
if (CHAMELEON_FIND_REQUIRED AND CHAMELEON_FIND_REQUIRED_QUARK)
find_package(QUARK REQUIRED COMPONENTS HWLOC)
else()
find_package(QUARK COMPONENTS HWLOC)
......@@ -727,7 +731,7 @@ if( (NOT PKG_CONFIG_EXECUTABLE AND NOT CHAMELEON_FOUND) OR NOT CHAMELEON_FOUND )
set(CMAKE_REQUIRED_LIBRARIES)
endif(CHAMELEON_LIBRARIES)
endif( (NOT PKG_CONFIG_EXECUTABLE AND NOT CHAMELEON_FOUND) OR NOT CHAMELEON_FOUND )
endif( (NOT PKG_CONFIG_EXECUTABLE AND NOT CHAMELEON_FOUND) OR NOT CHAMELEON_FOUND OR CHAMELEON_DIR)
if (CHAMELEON_LIBRARIES AND NOT CHAMELEON_DIR)
if (CHAMELEON_LIBRARY_DIRS)
......
......@@ -129,7 +129,7 @@ if( FFTW_FIND_COMPONENTS )
endif()
if (FFTW_LOOK_FOR_THREADS)
if (FFTW_FIND_REQUIRED)
if (FFTW_FIND_REQUIRED AND FFTW_FIND_REQUIRED_THREADS)
find_package(Threads REQUIRED)
else()
find_package(Threads)
......@@ -137,7 +137,7 @@ if (FFTW_LOOK_FOR_THREADS)
endif()
if (FFTW_LOOK_FOR_OMP)
if (FFTW_FIND_REQUIRED)
if (FFTW_FIND_REQUIRED AND FFTW_FIND_REQUIRED_OMP)
find_package(OpenMP REQUIRED)
else()
find_package(OpenMP)
......
......@@ -54,7 +54,7 @@ endif()
# -------------------------------------------------------------------------------------
include(FindPkgConfig)
find_package(PkgConfig QUIET)
if(PKG_CONFIG_EXECUTABLE AND NOT FXT_DIR)
if(PKG_CONFIG_EXECUTABLE)
pkg_search_module(FXT fxt)
if (NOT FXT_FIND_QUIETLY)
......@@ -74,7 +74,7 @@ if(PKG_CONFIG_EXECUTABLE AND NOT FXT_DIR)
endif()
if( (NOT PKG_CONFIG_EXECUTABLE AND NOT FXT_FOUND) OR NOT FXT_FOUND )
if( (NOT PKG_CONFIG_EXECUTABLE AND NOT FXT_FOUND) OR NOT FXT_FOUND OR FXT_DIR)
if (NOT FXT_FIND_QUIETLY)
message(STATUS "Looking for FXT - PkgConfig not used")
......@@ -248,7 +248,7 @@ if( (NOT PKG_CONFIG_EXECUTABLE AND NOT FXT_FOUND) OR NOT FXT_FOUND )
set(CMAKE_REQUIRED_LIBRARIES)
endif(FXT_LIBRARIES)
endif( (NOT PKG_CONFIG_EXECUTABLE AND NOT FXT_FOUND) OR NOT FXT_FOUND )
endif( (NOT PKG_CONFIG_EXECUTABLE AND NOT FXT_FOUND) OR NOT FXT_FOUND OR FXT_DIR)
if (FXT_LIBRARIES AND NOT FXT_DIR)
if (FXT_LIBRARY_DIRS)
......
......@@ -55,7 +55,7 @@ endif()
# -------------------------------------------------------------------------------------
include(FindPkgConfig)
find_package(PkgConfig QUIET)
if(PKG_CONFIG_EXECUTABLE AND NOT HWLOC_DIR)
if(PKG_CONFIG_EXECUTABLE)
pkg_search_module(HWLOC hwloc)
if (NOT HWLOC_FIND_QUIETLY)
......@@ -75,7 +75,7 @@ if(PKG_CONFIG_EXECUTABLE AND NOT HWLOC_DIR)
endif()
if( (NOT PKG_CONFIG_EXECUTABLE AND NOT HWLOC_FOUND) OR NOT HWLOC_FOUND )
if( (NOT PKG_CONFIG_EXECUTABLE AND NOT HWLOC_FOUND) OR NOT HWLOC_FOUND OR HWLOC_DIR)
if (NOT HWLOC_FIND_QUIETLY)
message(STATUS "Looking for HWLOC - PkgConfig not used")
......@@ -255,7 +255,7 @@ if( (NOT PKG_CONFIG_EXECUTABLE AND NOT HWLOC_FOUND) OR NOT HWLOC_FOUND )
set(CMAKE_REQUIRED_LIBRARIES)
endif(HWLOC_LIBRARIES)
endif( (NOT PKG_CONFIG_EXECUTABLE AND NOT HWLOC_FOUND) OR NOT HWLOC_FOUND )
endif( (NOT PKG_CONFIG_EXECUTABLE AND NOT HWLOC_FOUND) OR NOT HWLOC_FOUND OR HWLOC_DIR)
if (HWLOC_LIBRARIES AND NOT HWLOC_DIR)
if (HWLOC_LIBRARY_DIRS)
......
......@@ -102,7 +102,7 @@ endif()
# -------------------------------------------------------------------------------------
include(FindPkgConfig)
find_package(PkgConfig QUIET)
if(PKG_CONFIG_EXECUTABLE AND NOT MAGMA_DIR)
if(PKG_CONFIG_EXECUTABLE)
pkg_search_module(MAGMA magma)
if (NOT MAGMA_FIND_QUIETLY)
......@@ -148,11 +148,15 @@ if(PKG_CONFIG_EXECUTABLE AND NOT MAGMA_DIR)
set(MAGMA_INCLUDE_DIRS_DEP "")
set(MAGMA_LIBRARY_DIRS_DEP "")
set(MAGMA_LIBRARIES_DEP "")
# replace it anyway: we should update it with dependencies given by pkg-config
set(MAGMA_INCLUDE_DIRS_DEP "${MAGMA_INCLUDE_DIRS}")
set(MAGMA_LIBRARY_DIRS_DEP "${MAGMA_LIBRARY_DIRS}")
set(MAGMA_LIBRARIES_DEP "${MAGMA_LIBRARIES}")
endif()
# if MAGMA is not found using pkg-config
if( (NOT PKG_CONFIG_EXECUTABLE AND NOT MAGMA_FOUND) OR NOT MAGMA_FOUND )
if( (NOT PKG_CONFIG_EXECUTABLE AND NOT MAGMA_FOUND) OR NOT MAGMA_FOUND OR MAGMA_DIR)
if (NOT MAGMA_FIND_QUIETLY)
message(STATUS "Looking for MAGMA - PkgConfig not used")
......@@ -369,7 +373,7 @@ if( (NOT PKG_CONFIG_EXECUTABLE AND NOT MAGMA_FOUND) OR NOT MAGMA_FOUND )
set(CMAKE_REQUIRED_LIBRARIES)
endif(MAGMA_LIBRARIES)
endif( (NOT PKG_CONFIG_EXECUTABLE AND NOT MAGMA_FOUND) OR NOT MAGMA_FOUND )
endif( (NOT PKG_CONFIG_EXECUTABLE AND NOT MAGMA_FOUND) OR NOT MAGMA_FOUND OR MAGMA_DIR)
if (MAGMA_LIBRARIES AND NOT MAGMA_DIR)
if (MAGMA_LIBRARY_DIRS)
......
......@@ -160,7 +160,7 @@ if (NOT MPI_FOUND AND MUMPS_LOOK_FOR_MPI)
if(NOT MPI_C_COMPILER)
set(MPI_C_COMPILER mpicc)
endif()
if (MUMPS_FIND_REQUIRED)
if (MUMPS_FIND_REQUIRED AND MUMPS_FIND_REQUIRED_MPI)
find_package(MPI REQUIRED)
else()
find_package(MPI)
......@@ -178,7 +178,7 @@ if (NOT SCALAPACK_FOUND AND MUMPS_LOOK_FOR_MPI)
message(STATUS "Looking for MUMPS - Try to detect SCALAPACK")
endif()
# SCALAPACK is a required dependency if MPI is used
if (MUMPS_FIND_REQUIRED)
if (MUMPS_FIND_REQUIRED AND MUMPS_FIND_REQUIRED_MPI)
find_package(SCALAPACK REQUIRED)
else()
find_package(SCALAPACK)
......@@ -191,7 +191,7 @@ if (NOT SCOTCH_FOUND AND MUMPS_LOOK_FOR_SCOTCH)
if (NOT MUMPS_FIND_QUIETLY)
message(STATUS "Looking for MUMPS - Try to detect SCOTCH")
endif()
if (MUMPS_FIND_REQUIRED)
if (MUMPS_FIND_REQUIRED AND MUMPS_FIND_REQUIRED_SCOTCH)
find_package(SCOTCH REQUIRED)
else()
find_package(SCOTCH)
......@@ -204,7 +204,7 @@ if (NOT METIS_FOUND AND MUMPS_LOOK_FOR_METIS)
if (NOT MUMPS_FIND_QUIETLY)
message(STATUS "Looking for MUMPS - Try to detect METIS")
endif()
if (MUMPS_FIND_REQUIRED)
if (MUMPS_FIND_REQUIRED AND MUMPS_FIND_REQUIRED_METIS)
find_package(METIS REQUIRED)
else()
find_package(METIS)
......
......@@ -124,7 +124,6 @@ if( PASTIX_FIND_COMPONENTS )
endforeach()
endif()
# Dependencies detection
# ----------------------
......@@ -227,7 +226,7 @@ if (NOT MPI_FOUND AND PASTIX_LOOK_FOR_MPI)
if(NOT MPI_C_COMPILER)
set(MPI_C_COMPILER mpicc)
endif()
if (PASTIX_FIND_REQUIRED)
if (PASTIX_FIND_REQUIRED AND PASTIX_FIND_REQUIRED_MPI)
find_package(MPI REQUIRED)
else()
find_package(MPI)
......@@ -269,7 +268,7 @@ if( NOT STARPU_FOUND AND PASTIX_LOOK_FOR_STARPU)
list(APPEND STARPU_COMPONENT_LIST "FXT")
endif()
# set the list of optional dependencies we may discover
if (PASTIX_FIND_REQUIRED)
if (PASTIX_FIND_REQUIRED AND PASTIX_FIND_REQUIRED_STARPU)
find_package(STARPU ${PASTIX_STARPU_VERSION} REQUIRED
COMPONENTS ${STARPU_COMPONENT_LIST})
else()
......@@ -285,7 +284,7 @@ if (NOT SCOTCH_FOUND AND PASTIX_LOOK_FOR_SCOTCH)
if (NOT PASTIX_FIND_QUIETLY)
message(STATUS "Looking for PASTIX - Try to detect SCOTCH")
endif()
if (PASTIX_FIND_REQUIRED )
if (PASTIX_FIND_REQUIRED AND PASTIX_FIND_REQUIRED_SCOTCH)
find_package(SCOTCH REQUIRED)
else()
find_package(SCOTCH)
......@@ -298,7 +297,7 @@ if (NOT PTSCOTCH_FOUND AND PASTIX_LOOK_FOR_PTSCOTCH)
if (NOT PASTIX_FIND_QUIETLY)
message(STATUS "Looking for PASTIX - Try to detect PTSCOTCH")
endif()
if (PASTIX_FIND_REQUIRED)
if (PASTIX_FIND_REQUIRED AND PASTIX_FIND_REQUIRED_PTSCOTCH)
find_package(PTSCOTCH REQUIRED)
else()
find_package(PTSCOTCH)
......@@ -311,7 +310,7 @@ if (NOT METIS_FOUND AND PASTIX_LOOK_FOR_METIS)
if (NOT PASTIX_FIND_QUIETLY)
message(STATUS "Looking for PASTIX - Try to detect METIS")
endif()
if (PASTIX_FIND_REQUIRED)
if (PASTIX_FIND_REQUIRED AND PASTIX_FIND_REQUIRED_METIS)
find_package(METIS REQUIRED)
else()
find_package(METIS)
......
......@@ -87,7 +87,7 @@ endif()
# QUARK may depend on HWLOC, try to find it
if (NOT HWLOC_FOUND AND QUARK_LOOK_FOR_HWLOC)
if (QUARK_FIND_REQUIRED)
if (QUARK_FIND_REQUIRED AND QUARK_FIND_REQUIRED_HWLOC)
find_package(HWLOC REQUIRED)
else()
find_package(HWLOC)
......
......@@ -101,7 +101,7 @@ endif()
# STARPU may depend on HWLOC, try to find it
if (NOT HWLOC_FOUND AND STARPU_LOOK_FOR_HWLOC)
if (STARPU_FIND_REQUIRED)
if (STARPU_FIND_REQUIRED AND STARPU_FIND_REQUIRED_HWLOC)
find_package(HWLOC REQUIRED)
else()
find_package(HWLOC)
......@@ -110,7 +110,7 @@ endif()
# STARPU may depend on CUDA, try to find it
if (NOT CUDA_FOUND AND STARPU_LOOK_FOR_CUDA)
if (STARPU_FIND_REQUIRED)
if (STARPU_FIND_REQUIRED AND STARPU_FIND_REQUIRED_CUDA)
find_package(CUDA REQUIRED)
else()
find_package(CUDA)
......@@ -126,7 +126,7 @@ endif()
# STARPU may depend on MPI, try to find it
if (NOT MPI_FOUND AND STARPU_LOOK_FOR_MPI)
if (STARPU_FIND_REQUIRED)
if (STARPU_FIND_REQUIRED AND STARPU_FIND_REQUIRED_MPI)
find_package(MPI REQUIRED)
else()
find_package(MPI)
......@@ -139,7 +139,7 @@ endif()
# STARPU may depend on BLAS, try to find it
if (NOT BLAS_FOUND AND STARPU_LOOK_FOR_BLAS)
if (STARPU_FIND_REQUIRED)
if (STARPU_FIND_REQUIRED AND STARPU_FIND_REQUIRED_BLAS)
find_package(BLAS REQUIRED)
else()
find_package(BLAS)
......@@ -148,7 +148,7 @@ endif()
# STARPU may depend on MAGMA, try to find it
if (NOT MAGMA_FOUND AND STARPU_LOOK_FOR_MAGMA)
if (STARPU_FIND_REQUIRED)
if (STARPU_FIND_REQUIRED AND STARPU_FIND_REQUIRED_MAGMA)
find_package(MAGMA REQUIRED)
else()
find_package(MAGMA)
......@@ -157,7 +157,7 @@ endif()
# STARPU may depend on FXT, try to find it
if (NOT FXT_FOUND AND STARPU_LOOK_FOR_FXT)
if (STARPU_FIND_REQUIRED)
if (STARPU_FIND_REQUIRED AND STARPU_FIND_REQUIRED_FXT)
find_package(FXT REQUIRED)
else()
find_package(FXT)
......@@ -169,7 +169,7 @@ endif()
include(FindPkgConfig)
find_package(PkgConfig QUIET)
if(PKG_CONFIG_EXECUTABLE AND NOT STARPU_DIR)
if(PKG_CONFIG_EXECUTABLE)
pkg_search_module(STARPU_SHM libstarpu)
set(STARPU_INCLUDE_DIRS "${STARPU_SHM_INCLUDE_DIRS}")
......@@ -229,12 +229,14 @@ if(PKG_CONFIG_EXECUTABLE AND NOT STARPU_DIR)
else()
set(STARPU_LIBRARIES "STARPU_LIBRARIES-NOTFOUND")
endif()
set(STARPU_INCLUDE_DIRS_DEP "${STARPU_INCLUDE_DIRS}")
set(STARPU_LIBRARY_DIRS_DEP "${STARPU_LIBRARY_DIRS}")
endif()
if( (NOT PKG_CONFIG_EXECUTABLE AND NOT STARPU_FOUND) OR
(NOT STARPU_SHM_FOUND OR (NOT STARPU_MPI_FOUND AND STARPU_LOOK_FOR_MPI))
OR STARPU_DIR
)
# Looking for include
......@@ -768,6 +770,7 @@ if( (NOT PKG_CONFIG_EXECUTABLE AND NOT STARPU_FOUND) OR
endif( (NOT PKG_CONFIG_EXECUTABLE AND NOT STARPU_FOUND) OR
(NOT STARPU_SHM_FOUND OR (NOT STARPU_MPI_FOUND AND STARPU_LOOK_FOR_MPI))
OR STARPU_DIR
)
if (STARPU_LIBRARIES AND NOT STARPU_DIR)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment