Commit 691af922 authored by PRUVOST Florent's avatar PRUVOST Florent
Browse files

avoid to compare to 1 when a simple if on the variable is enough --> was...

avoid to compare to 1 when a simple if on the variable is enough --> was causing strange behaviors in FindSTARPU.cmake for example (without MPI, STARPU_starpu_mpi.h_INCLUDE_DIRS-NOTFOUND was appending in the list of STARPU_INCLUDE_DIRS even if mpi was not required)
parent cdbe8c8a
......@@ -62,7 +62,7 @@ endif()
# try to find it specified as COMPONENTS during the call
if (CBLAS_FIND_COMPONENTS)
foreach( component ${CBLAS_FIND_COMPONENTS} )
if(${CBLAS_FIND_REQUIRED_${component}} STREQUAL 1)
if(CBLAS_FIND_REQUIRED_${component})
find_package(${component} REQUIRED)
else()
find_package(${component})
......
......@@ -58,7 +58,7 @@ endif()
# Try to find CHAMELEON dependencies if specified as COMPONENTS during the call
if( CHAMELEON_FIND_COMPONENTS )
foreach( component ${CHAMELEON_FIND_COMPONENTS} )
if(${CHAMELEON_FIND_REQUIRED_${component}} STREQUAL 1)
if(CHAMELEON_FIND_REQUIRED_${component})
find_package(${component} REQUIRED)
else()
find_package(${component})
......@@ -105,7 +105,7 @@ if(PKG_CONFIG_EXECUTABLE)
endif()
endif()
if (CHAMELEON_FIND_VERSION_EXACT STREQUAL 1)
if (CHAMELEON_FIND_VERSION_EXACT)
if( NOT (CHAMELEON_FIND_VERSION_MAJOR STREQUAL CHAMELEON_VERSION_MAJOR) OR
NOT (CHAMELEON_FIND_VERSION_MINOR STREQUAL CHAMELEON_VERSION_MINOR) )
if(NOT CHAMELEON_FIND_QUIETLY)
......@@ -278,12 +278,12 @@ if(NOT CHAMELEON_FOUND OR NOT CHAMELEON_LIBRARIES)
set(MPI_C_COMPILER mpicc)
endif()
if (CHAMELEON_FIND_REQUIRED_MPI)
if(${CHAMELEON_FIND_REQUIRED_MPI} STREQUAL 1)
if(CHAMELEON_FIND_REQUIRED_MPI)
list(APPEND STARPU_COMPONENT_LIST "MPI")
endif()
endif()
if (CHAMELEON_FIND_REQUIRED_CUDA)
if(${CHAMELEON_FIND_REQUIRED_CUDA} STREQUAL 1)
if(CHAMELEON_FIND_REQUIRED_CUDA)
list(APPEND STARPU_COMPONENT_LIST "CUDA")
endif()
endif()
......
......@@ -60,7 +60,7 @@ endif()
# try to find it specified as COMPONENTS during the call
if (LAPACKE_FIND_COMPONENTS)
foreach( component ${LAPACKE_FIND_COMPONENTS} )
if(${LAPACKE_FIND_REQUIRED_${component}} STREQUAL 1)
if(LAPACKE_FIND_REQUIRED_${component})
find_package(${component} REQUIRED)
else()
find_package(${component})
......
......@@ -55,7 +55,7 @@ endif(NOT MAGMA_FOUND)
# try to find it specified as COMPONENTS during the call
if( MAGMA_FIND_COMPONENTS )
foreach( component ${MAGMA_FIND_COMPONENTS} )
if(${MAGMA_FIND_REQUIRED_${component}} STREQUAL 1)
if(MAGMA_FIND_REQUIRED_${component})
find_package(${component} REQUIRED)
else()
find_package(${component})
......@@ -130,7 +130,7 @@ if(PKG_CONFIG_EXECUTABLE)
endif()
endif()
if (MAGMA_FIND_VERSION_EXACT STREQUAL 1)
if (MAGMA_FIND_VERSION_EXACT)
if( NOT (MAGMA_FIND_VERSION_MAJOR STREQUAL MAGMA_VERSION_MAJOR) OR
NOT (MAGMA_FIND_VERSION_MINOR STREQUAL MAGMA_VERSION_MINOR) )
if(NOT MAGMA_FIND_QUIETLY)
......
......@@ -54,7 +54,7 @@ endif()
# try to find it specified as COMPONENTS during the call
if( PARMETIS_FIND_COMPONENTS )
foreach( component ${PARMETIS_FIND_COMPONENTS} )
if(${PARMETIS_FIND_REQUIRED_${component}} STREQUAL 1)
if(PARMETIS_FIND_REQUIRED_${component})
find_package(${component} REQUIRED)
else()
find_package(${component})
......
......@@ -60,7 +60,7 @@ endif()
# Try to find PASTIX dependencies if specified as COMPONENTS during the call
if( PASTIX_FIND_COMPONENTS )
foreach( component ${PASTIX_FIND_COMPONENTS} )
if(${PASTIX_FIND_REQUIRED_${component}} STREQUAL 1)
if(PASTIX_FIND_REQUIRED_${component})
find_package(${component} REQUIRED)
else()
find_package(${component})
......@@ -107,7 +107,7 @@ if(PKG_CONFIG_EXECUTABLE)
endif()
endif()
if (PASTIX_FIND_VERSION_EXACT STREQUAL 1)
if (PASTIX_FIND_VERSION_EXACT)
if( NOT (PASTIX_FIND_VERSION_MAJOR STREQUAL PASTIX_VERSION_MAJOR) OR
NOT (PASTIX_FIND_VERSION_MINOR STREQUAL PASTIX_VERSION_MINOR) )
if(NOT PASTIX_FIND_QUIETLY)
......@@ -278,12 +278,12 @@ if(NOT PASTIX_FOUND OR NOT PASTIX_LIBRARIES)
set(MPI_C_COMPILER mpicc)
endif()
if (PASTIX_FIND_REQUIRED_MPI)
if(${PASTIX_FIND_REQUIRED_MPI} STREQUAL 1)
if(PASTIX_FIND_REQUIRED_MPI)
list(APPEND STARPU_COMPONENT_LIST "MPI")
endif()
endif()
if (PASTIX_FIND_REQUIRED_CUDA)
if(${PASTIX_FIND_REQUIRED_CUDA} STREQUAL 1)
if(PASTIX_FIND_REQUIRED_CUDA)
list(APPEND STARPU_COMPONENT_LIST "CUDA")
endif()
endif()
......
......@@ -55,7 +55,7 @@ endif()
# try to find it specified as COMPONENTS during the call
if( PTSCOTCH_FIND_COMPONENTS )
foreach( component ${PTSCOTCH_FIND_COMPONENTS} )
if(${PTSCOTCH_FIND_REQUIRED_${component}} STREQUAL 1)
if(PTSCOTCH_FIND_REQUIRED_${component})
find_package(${component} REQUIRED)
else()
find_package(${component})
......
......@@ -55,7 +55,7 @@ endif()
# try to find it specified as COMPONENTS during the call
if( QUARK_FIND_COMPONENTS )
foreach( component ${QUARK_FIND_COMPONENTS} )
if(${QUARK_FIND_REQUIRED_${component}} STREQUAL 1)
if(QUARK_FIND_REQUIRED_${component})
find_package(${component} REQUIRED)
else()
find_package(${component})
......
......@@ -55,7 +55,7 @@ endif()
# try to find it specified as COMPONENTS during the call
if( SCOTCH_FIND_COMPONENTS )
foreach( component ${SCOTCH_FIND_COMPONENTS} )
if(${SCOTCH_FIND_REQUIRED_${component}} STREQUAL 1)
if(SCOTCH_FIND_REQUIRED_${component})
find_package(${component} REQUIRED)
else()
find_package(${component})
......
......@@ -74,7 +74,7 @@ if( STARPU_FIND_COMPONENTS )
elseif(${component} STREQUAL "MAGMA")
set(STARPU_LOOK_FOR_MAGMA TRUE)
endif()
if(${STARPU_FIND_REQUIRED_${component}} STREQUAL 1)
if(STARPU_FIND_REQUIRED_${component})
find_package(${component} REQUIRED)
else()
find_package(${component})
......@@ -157,7 +157,7 @@ if(PKG_CONFIG_EXECUTABLE)
endif()
endif()
if (STARPU_FIND_VERSION_EXACT STREQUAL 1)
if (STARPU_FIND_VERSION_EXACT)
if( NOT (STARPU_FIND_VERSION_MAJOR STREQUAL STARPU_VERSION_MAJOR) OR
NOT (STARPU_FIND_VERSION_MINOR STREQUAL STARPU_VERSION_MINOR) )
if(STARPU_FIND_REQUIRED AND NOT STARPU_FIND_QUIETLY)
......@@ -277,7 +277,7 @@ if( (NOT STARPU_SHM_FOUND) OR (NOT STARPU_SHM_LIBRARIES) OR
if (STARPU_starpu_config.h_INCLUDE_DIRS)
GET_VERSION("STARPU" "${STARPU_starpu_config.h_INCLUDE_DIRS}/starpu_config.h")
if (STARPU_VERSION_MAJOR AND STARPU_VERSION_MINOR)
if (STARPU_FIND_VERSION_EXACT STREQUAL 1)
if (STARPU_FIND_VERSION_EXACT)
if (STARPU_FIND_VERSION_MAJOR AND STARPU_FIND_VERSION_MINOR)
if( NOT (STARPU_FIND_VERSION_MAJOR STREQUAL STARPU_VERSION_MAJOR) OR
NOT (STARPU_FIND_VERSION_MINOR STREQUAL STARPU_VERSION_MINOR) )
......@@ -368,7 +368,7 @@ if( (NOT STARPU_SHM_FOUND) OR (NOT STARPU_SHM_LIBRARIES) OR
message(STATUS "Looking for starpu -- ${starpu_hdr} not found")
endif()
if(starpu_hdr STREQUAL "starpu_mpi.h")
if(NOT ${STARPU_FIND_REQUIRED_MPI} STREQUAL 1)
if(NOT STARPU_FIND_REQUIRED_MPI)
if (NOT STARPU_FIND_QUIETLY)
message(STATUS "Looking for starpu -- ${starpu_hdr} not required")
endif()
......@@ -376,7 +376,7 @@ if( (NOT STARPU_SHM_FOUND) OR (NOT STARPU_SHM_LIBRARIES) OR
list(APPEND STARPU_INCLUDE_DIRS "${STARPU_${starpu_hdr}_INCLUDE_DIRS}" )
endif()
elseif( (starpu_hdr STREQUAL "starpu_cuda.h") OR (starpu_hdr STREQUAL "starpu_scheduler.h") )
if(NOT ${STARPU_FIND_REQUIRED_CUDA} STREQUAL 1)
if(NOT STARPU_FIND_REQUIRED_CUDA)
if (NOT STARPU_FIND_QUIETLY)
message(STATUS "Looking for starpu -- ${starpu_hdr} not required")
endif()
......@@ -496,7 +496,7 @@ if( (NOT STARPU_SHM_FOUND) OR (NOT STARPU_SHM_LIBRARIES) OR
message(STATUS "Looking for starpu -- lib ${starpu_lib} not found")
endif()
if(starpu_lib STREQUAL "starpumpi-${STARPU_VERSION_STRING}" AND
NOT ${STARPU_FIND_REQUIRED_MPI} STREQUAL 1)
NOT STARPU_FIND_REQUIRED_MPI)
# if MPI optional, not a problem: no NOTFOUND in list of MPI LIBRARIES
if(NOT STARPU_FIND_QUIETLY)
message(STATUS "Looking for starpu -- lib ${starpu_lib} not required")
......
......@@ -64,7 +64,7 @@ endif (NOT _LANGUAGES_ MATCHES Fortran)
# try to find it specified as COMPONENTS during the call
if (TMG_FIND_COMPONENTS)
foreach( component ${TMG_FIND_COMPONENTS} )
if(${TMG_FIND_REQUIRED_${component}} STREQUAL 1)
if(TMG_FIND_REQUIRED_${component})
find_package(${component} REQUIRED)
else()
find_package(${component})
......
Supports Markdown
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