Commit b8c53118 authored by PRUVOST Florent's avatar PRUVOST Florent

update cmake modules and clean main CMakeLists a bit

parent 0e0cb337
This diff is collapsed.
......@@ -34,19 +34,19 @@
if (MORSE_ENABLE_WARNING)
if(CMAKE_C_COMPILER_ID MATCHES GNU)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -fdiagnostics-show-option")
elseif(CMAKE_C_COMPILER_ID MATCHES Intel)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w3 -diag-disable:remark")
endif()
if(CMAKE_CXX_COMPILER_ID MATCHES GNU)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fdiagnostics-show-option")
elseif(CMAKE_CXX_COMPILER_ID MATCHES Intel)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w3 -diag-disable:remark")
endif()
if(CMAKE_Fortran_COMPILER_ID MATCHES GNU)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Wall")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Wall -fdiagnostics-show-option")
elseif(CMAKE_Fortran_COMPILER_ID MATCHES Intel)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -warn all -diag-disable:remark")
endif()
......@@ -56,21 +56,21 @@ endif(MORSE_ENABLE_WARNING)
if (MORSE_ENABLE_COVERAGE)
if(CMAKE_C_COMPILER_ID MATCHES GNU)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --coverage")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -fno-inline --coverage")
else()
message(FATAL_ERROR "Code coverage is only available with the GNU C (gcc)"
"\n compiler, please turn MORSE_ENABLE_COVERAGE OFF\n.")
endif()
if(CMAKE_CXX_COMPILER_ID MATCHES GNU)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -fno-inline --coverage")
else()
message(FATAL_ERROR "Code coverage is only available with the GNU CXX"
"\n (g++) compiler, please turn MORSE_ENABLE_COVERAGE OFF\n.")
endif()
if(CMAKE_Fortran_COMPILER_ID MATCHES GNU)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} --coverage")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fPIC -fno-inline --coverage")
else()
message(FATAL_ERROR "Code coverage is only available with the GNU"
"\n Fortran (gfortran) compiler, please turn MORSE_ENABLE_COVERAGE"
......
......@@ -3,7 +3,7 @@
# @copyright (c) 2009-2014 The University of Tennessee and The University
# of Tennessee Research Foundation.
# All rights reserved.
# @copyright (c) 2012-2014 Inria. All rights reserved.
# @copyright (c) 2012-2018 Inria. All rights reserved.
# @copyright (c) 2012-2014 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All rights reserved.
#
###
......@@ -18,7 +18,7 @@
# Univ. of California Berkeley,
# Univ. of Colorado Denver.
#
# @version 0.9.0
# @version 1.0.0
# @author Cedric Castagnede
# @author Emmanuel Agullo
# @author Mathieu Faverge
......@@ -28,51 +28,51 @@
###
# Set some colors
#if(NOT WIN32)
# string(ASCII 27 Esc)
# set(ColourReset "${Esc}[m")
# set(ColourBold "${Esc}[1m")
# set(Red "${Esc}[31m")
# set(Green "${Esc}[32m")
# set(Yellow "${Esc}[33m")
# set(Blue "${Esc}[34m")
# set(Magenta "${Esc}[35m")
# set(Cyan "${Esc}[36m")
# set(White "${Esc}[37m")
# set(BoldRed "${Esc}[1;31m")
# set(BoldGreen "${Esc}[1;32m")
# set(BoldYellow "${Esc}[1;33m")
# set(BoldBlue "${Esc}[1;34m")
# set(BoldMagenta "${Esc}[1;35m")
# set(BoldCyan "${Esc}[1;36m")
# set(BoldWhite "${Esc}[1;37m")
#endif()
if(NOT WIN32)
string(ASCII 27 Esc)
set(ColourReset "${Esc}[m")
set(ColourBold "${Esc}[1m")
set(Red "${Esc}[31m")
set(Green "${Esc}[32m")
set(Yellow "${Esc}[33m")
set(Blue "${Esc}[34m")
set(Magenta "${Esc}[35m")
set(Cyan "${Esc}[36m")
set(White "${Esc}[37m")
set(BoldRed "${Esc}[1;31m")
set(BoldGreen "${Esc}[1;32m")
set(BoldYellow "${Esc}[1;33m")
set(BoldBlue "${Esc}[1;34m")
set(BoldMagenta "${Esc}[1;35m")
set(BoldCyan "${Esc}[1;36m")
set(BoldWhite "${Esc}[1;37m")
# Colorize cmake messages during configure
function(message)
list(GET ARGV 0 MessageType)
if(MessageType STREQUAL FATAL_ERROR OR MessageType STREQUAL SEND_ERROR)
list(REMOVE_AT ARGV 0)
string (REPLACE ";" " " ARGV_STR "${ARGV}")
_message(${MessageType} "${BoldRed}${ARGV_STR}${ColourReset}")
elseif(MessageType STREQUAL WARNING)
list(REMOVE_AT ARGV 0)
string (REPLACE ";" " " ARGV_STR "${ARGV}")
_message(${MessageType} "${BoldYellow}${ARGV_STR}${ColourReset}")
elseif(MessageType STREQUAL AUTHOR_WARNING)
list(REMOVE_AT ARGV 0)
string (REPLACE ";" " " ARGV_STR "${ARGV}")
_message(${MessageType} "${BoldCyan}${ARGV_STR}${ColourReset}")
elseif(MessageType STREQUAL STATUS)
list(REMOVE_AT ARGV 0)
string (REPLACE ";" " " ARGV_STR "${ARGV}")
_message(${MessageType} "${Green}${ARGV_STR}${ColourReset}")
else()
string (REPLACE ";" " " ARGV_STR "${ARGV}")
string (REPLACE "${Esc}[1 " "${Esc}[1;" ARGV_STR "${ARGV_STR}")
_message("${ARGV_STR}")
endif()
endfunction()
# Colorize cmake messages during configure
function(message)
list(GET ARGV 0 MessageType)
if(MessageType STREQUAL FATAL_ERROR OR MessageType STREQUAL SEND_ERROR)
list(REMOVE_AT ARGV 0)
string (REPLACE ";" " " ARGV_STR "${ARGV}")
_message(${MessageType} "${BoldRed}${ARGV_STR}${ColourReset}")
elseif(MessageType STREQUAL WARNING)
list(REMOVE_AT ARGV 0)
string (REPLACE ";" " " ARGV_STR "${ARGV}")
_message(${MessageType} "${BoldYellow}${ARGV_STR}${ColourReset}")
elseif(MessageType STREQUAL AUTHOR_WARNING)
list(REMOVE_AT ARGV 0)
string (REPLACE ";" " " ARGV_STR "${ARGV}")
_message(${MessageType} "${BoldCyan}${ARGV_STR}${ColourReset}")
elseif(MessageType STREQUAL STATUS)
list(REMOVE_AT ARGV 0)
string (REPLACE ";" " " ARGV_STR "${ARGV}")
_message(${MessageType} "${Green}${ARGV_STR}${ColourReset}")
else()
string (REPLACE ";" " " ARGV_STR "${ARGV}")
string (REPLACE "${Esc}[1 " "${Esc}[1;" ARGV_STR "${ARGV_STR}")
_message("${ARGV_STR}")
endif()
endfunction()
endif()
##
## @end file ColorizeMessage.cmake
......
......@@ -3,7 +3,7 @@
# @copyright (c) 2009-2014 The University of Tennessee and The University
# of Tennessee Research Foundation.
# All rights reserved.
# @copyright (c) 2012-2016 Inria. All rights reserved.
# @copyright (c) 2012-2018 Inria. All rights reserved.
# @copyright (c) 2012-2014 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All rights reserved.
#
###
......@@ -18,7 +18,7 @@
# Univ. of California Berkeley,
# Univ. of Colorado Denver.
#
# @version 0.9.0
# @version 1.0.0
# @author Cedric Castagnede
# @author Emmanuel Agullo
# @author Mathieu Faverge
......@@ -27,11 +27,25 @@
#
###
# Global Morse options
option(MORSE_ENABLE_WARNING "Enable warning messages" OFF)
option(MORSE_ENABLE_COVERAGE "Enable flags for coverage test" OFF)
option(MORSE_ENABLE_COLOR_MESSAGE "Enable colors in messages" OFF)
#option(MORSE_VERBOSE_FIND_PACKAGE "Add additional messages concerning packages not found" OFF)
#message(STATUS "MORSE_VERBOSE_FIND_PACKAGE is set to OFF, turn it ON to get"
# " information about packages not found")
# This include is required to check symbols of libs in the main CMakeLists.txt
include(CheckFunctionExists)
# To colorize messages
#include(ColorizeMessage)
# This include is required to check defines in headers
include(CheckIncludeFiles)
if (MORSE_ENABLE_COLOR_MESSAGE)
# colorize messages
include(ColorizeMessage)
endif()
# To find headers and libs
include(FindHeadersAndLibs)
......@@ -49,12 +63,6 @@ include(Ressources)
# Add the path where we handle our FindFOO.cmake to seek for liraries
list(APPEND CMAKE_MODULE_PATH ${MORSE_CMAKE_MODULE_PATH}/find)
option(MORSE_ENABLE_WARNING "Enable warning messages" OFF)
option(MORSE_ENABLE_COVERAGE "Enable flags for coverage test" OFF)
#option(MORSE_VERBOSE_FIND_PACKAGE "Add additional messages concerning packages not found" OFF)
#message(STATUS "MORSE_VERBOSE_FIND_PACKAGE is set to OFF, turn it ON to get"
# " information about packages not found")
##
## @end file MorseInit.cmake
##
......@@ -3,8 +3,7 @@
# @copyright (c) 2009-2014 The University of Tennessee and The University
# of Tennessee Research Foundation.
# All rights reserved.
# @copyright (c) 2012-2014 Inria. All rights reserved.
# @copyright (c) 2012-2014 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All rights reserved.
# @copyright (c) 2012-2016 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All rights reserved.
#
###
#
......@@ -158,6 +157,10 @@ endif()
# the target receives a -DPRECISION_p in its cflags.
#
include(ParseArguments)
# Add a hint to help Cmake to find the correct python version:
# (see https://cmake.org/cmake/help/v3.0/module/FindPythonInterp.html)
set(Python_ADDITIONAL_VERSIONS 2)
find_package(PythonInterp REQUIRED)
MACRO(precisions_rules_py)
......@@ -237,10 +240,9 @@ MACRO(precisions_rules_py)
COMMAND ${CMAKE_COMMAND} -E remove -f ${_dependency_OUTPUT} && ${pythoncmd} && chmod a-w ${_dependency_OUTPUT}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_dependency_INPUT} ${RP_CODEGEN} ${RP_${CMAKE_PROJECT_NAME}_DICTIONNARY})
set_SOURCE_FILES_PROPERTIES(${_dependency_OUTPUT} PROPERTIES COMPILE_FLAGS "-DPRECISION_${_dependency_PREC}" GENERATED 1 IS_IN_BINARY_DIR 1 )
set_source_files_properties(${_dependency_OUTPUT} PROPERTIES COMPILE_FLAGS "-DPRECISION_${_dependency_PREC}" GENERATED 1 IS_IN_BINARY_DIR 1 )
else( generate_out )
set_SOURCE_FILES_PROPERTIES(${_dependency_OUTPUT} PROPERTIES COMPILE_FLAGS "-DPRECISION_${_dependency_PREC}" GENERATED 0 )
set_source_files_properties(${_dependency_OUTPUT} PROPERTIES COMPILE_FLAGS "-DPRECISION_${_dependency_PREC}" GENERATED 0 )
endif( generate_out )
list(APPEND ${OUTPUTLIST} ${_dependency_OUTPUT})
......
This diff is collapsed.
This diff is collapsed.
......@@ -372,6 +372,9 @@ endif(BLAS_FOUND)
if (CBLAS_LIBRARIES)
list(GET CBLAS_LIBRARIES 0 first_lib)
get_filename_component(first_lib_path "${first_lib}" PATH)
if (NOT CBLAS_LIBRARY_DIRS)
set(CBLAS_LIBRARY_DIRS "${first_lib_path}")
endif()
if (${first_lib_path} MATCHES "(/lib(32|64)?$)|(/lib/intel64$|/lib/ia32$)")
string(REGEX REPLACE "(/lib(32|64)?$)|(/lib/intel64$|/lib/ia32$)" "" not_cached_dir "${first_lib_path}")
set(CBLAS_DIR_FOUND "${not_cached_dir}" CACHE PATH "Installation directory of CBLAS library" FORCE)
......
This diff is collapsed.
......@@ -3,7 +3,7 @@
# @copyright (c) 2009-2014 The University of Tennessee and The University
# of Tennessee Research Foundation.
# All rights reserved.
# @copyright (c) 2012-2014 Inria. All rights reserved.
# @copyright (c) 2012-2018 Inria. All rights reserved.
# @copyright (c) 2012-2014 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All rights reserved.
#
###
......@@ -24,6 +24,7 @@
# EZTRACE_INCLUDE_DIRS - eztrace include directories
# EZTRACE_LIBRARY_DIRS - Link directories for eztrace libraries
# EZTRACE_LIBRARIES - eztrace component libraries to be linked
# EZTRACE_FOUND_WITH_PKGCONFIG - True if found with pkg-config
#
# The user can give specific paths where to find the libraries adding cmake
# options at configure (ex: cmake path/to/project -DEZTRACE_DIR=path/to/eztrace):
......@@ -34,11 +35,11 @@
# are not given as cmake variable: EZTRACE_DIR, EZTRACE_INCDIR, EZTRACE_LIBDIR
#=============================================================================
# Copyright 2012-2013 Inria
# Copyright 2012-2018 Inria
# Copyright 2012-2013 Emmanuel Agullo
# Copyright 2012-2013 Mathieu Faverge
# Copyright 2012 Cedric Castagnede
# Copyright 2013 Florent Pruvost
# Copyright 2013-2018 Florent Pruvost
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file MORSE-Copyright.txt for details.
......@@ -82,8 +83,13 @@ if( PKG_CONFIG_EXECUTABLE AND NOT EZTRACE_GIVEN_BY_USER )
#endif()
else()
message(STATUS "${Magenta}Looking for EZTRACE - not found using PkgConfig."
"\n Perhaps you should add the directory containing eztrace.pc to"
"\n the PKG_CONFIG_PATH environment variable.${ColourReset}")
"\n Perhaps you should add the directory containing eztrace.pc to"
"\n the PKG_CONFIG_PATH environment variable.${ColourReset}")
endif()
if (EZTRACE_FOUND AND EZTRACE_LIBRARIES)
set(EZTRACE_FOUND_WITH_PKGCONFIG "TRUE")
else()
set(EZTRACE_FOUND_WITH_PKGCONFIG "FALSE")
endif()
endif()
......@@ -180,15 +186,15 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT EZTRACE_FOUND)
if(EZTRACE_DIR)
set(EZTRACE_eztrace.h_DIRS "EZTRACE_eztrace.h_DIRS-NOTFOUND")
find_path(EZTRACE_eztrace.h_DIRS
NAMES eztrace.h
HINTS ${EZTRACE_DIR}
PATH_SUFFIXES "include" "include/eztrace")
NAMES eztrace.h
HINTS ${EZTRACE_DIR}
PATH_SUFFIXES "include" "include/eztrace")
else()
set(EZTRACE_eztrace.h_DIRS "EZTRACE_eztrace.h_DIRS-NOTFOUND")
find_path(EZTRACE_eztrace.h_DIRS
NAMES eztrace.h
HINTS ${PATH_TO_LOOK_FOR}
PATH_SUFFIXES "eztrace")
NAMES eztrace.h
HINTS ${PATH_TO_LOOK_FOR}
PATH_SUFFIXES "eztrace")
endif()
endif()
mark_as_advanced(EZTRACE_eztrace.h_DIRS)
......@@ -225,9 +231,9 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT EZTRACE_FOUND)
string(REPLACE ":" ";" _lib_env "$ENV{LIB}")
else()
if(APPLE)
string(REPLACE ":" ";" _lib_env "$ENV{DYLD_LIBRARY_PATH}")
string(REPLACE ":" ";" _lib_env "$ENV{DYLD_LIBRARY_PATH}")
else()
string(REPLACE ":" ";" _lib_env "$ENV{LD_LIBRARY_PATH}")
string(REPLACE ":" ";" _lib_env "$ENV{LD_LIBRARY_PATH}")
endif()
list(APPEND _lib_env "${CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES}")
list(APPEND _lib_env "${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}")
......@@ -251,14 +257,14 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT EZTRACE_FOUND)
if(EZTRACE_DIR)
set(EZTRACE_eztrace_LIBRARY "EZTRACE_eztrace_LIBRARY-NOTFOUND")
find_library(EZTRACE_eztrace_LIBRARY
NAMES eztrace
HINTS ${EZTRACE_DIR}
PATH_SUFFIXES lib lib32 lib64)
NAMES eztrace
HINTS ${EZTRACE_DIR}
PATH_SUFFIXES lib lib32 lib64)
else()
set(EZTRACE_eztrace_LIBRARY "EZTRACE_eztrace_LIBRARY-NOTFOUND")
find_library(EZTRACE_eztrace_LIBRARY
NAMES eztrace
HINTS ${PATH_TO_LOOK_FOR})
NAMES eztrace
HINTS ${PATH_TO_LOOK_FOR})
endif()
endif()
mark_as_advanced(EZTRACE_eztrace_LIBRARY)
......@@ -315,10 +321,10 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT EZTRACE_FOUND)
if(NOT EZTRACE_WORKS)
if(NOT EZTRACE_FIND_QUIETLY)
message(STATUS "Looking for eztrace : test of eztrace_topology_init with eztrace library fails")
message(STATUS "CMAKE_REQUIRED_LIBRARIES: ${CMAKE_REQUIRED_LIBRARIES}")
message(STATUS "CMAKE_REQUIRED_INCLUDES: ${CMAKE_REQUIRED_INCLUDES}")
message(STATUS "Check in CMakeFiles/CMakeError.log to figure out why it fails")
message(STATUS "Looking for eztrace : test of eztrace_topology_init with eztrace library fails")
message(STATUS "CMAKE_REQUIRED_LIBRARIES: ${CMAKE_REQUIRED_LIBRARIES}")
message(STATUS "CMAKE_REQUIRED_INCLUDES: ${CMAKE_REQUIRED_INCLUDES}")
message(STATUS "Check in CMakeFiles/CMakeError.log to figure out why it fails")
endif()
endif()
set(CMAKE_REQUIRED_INCLUDES)
......@@ -334,6 +340,7 @@ if (EZTRACE_LIBRARIES)
else()
list(GET EZTRACE_LIBRARIES 0 first_lib)
get_filename_component(first_lib_path "${first_lib}" PATH)
set(EZTRACE_LIBRARY_DIRS "${first_lib_path}")
endif()
if (${first_lib_path} MATCHES "/lib(32|64)?$")
string(REGEX REPLACE "/lib(32|64)?$" "" not_cached_dir "${first_lib_path}")
......
......@@ -7,9 +7,10 @@
# Once done this will define
# FABULOUS_FOUND - System has fabulous
# FABULOUS_INCLUDE_DIRS - The fabulous include directories
# FABULOUS_MODULE_DIRS - The fabulous module directories for Fortran API
# FABULOUS_LIBRARIES - The libraries needed to use fabulous
# FABULOUS_DEFINITIONS - Compiler switches required for using fabulous
#
include(FindPackageHandleStandardArgs)
macro(FABULOUS_FIND_LIBRARIES_FROM_PKGCONFIG_RESULTS _prefix _pc_xprefix)
......@@ -115,6 +116,8 @@ if ((NOT FABULOUS_FOUND) AND (FABULOUS_GIVEN_BY_USER OR (NOT PKG_CONFIG_FOUND)))
endif()
find_path(FABULOUS_INCLUDE_DIRS NAMES fabulous.h HINTS ${FABULOUS_INCDIR})
find_path(FABULOUS_MODULE_DIRS NAMES fabulous_mod.mod HINTS ${FABULOUS_INCDIR}
PATH_SUFFIXES fabulous)
find_library(FABULOUS_STATIC_LIBRARY NAMES libfabulous.a HINTS ${FABULOUS_LIBDIR})
find_library(FABULOUS_SHARED_LIBRARY NAMES libfabulous.so HINTS ${FABULOUS_LIBDIR})
else()
......@@ -127,6 +130,9 @@ if ((NOT FABULOUS_FOUND) AND (FABULOUS_GIVEN_BY_USER OR (NOT PKG_CONFIG_FOUND)))
find_path(FABULOUS_INCLUDE_DIRS NAMES fabulous.h
HINTS ${FABULOUS_DIR}
PATH_SUFFIXES include include/fabulous)
find_path(FABULOUS_MODULE_DIRS NAMES fabulous_mod.mod
HINTS ${FABULOUS_DIR}
PATH_SUFFIXES include include/fabulous)
find_library(FABULOUS_STATIC_LIBRARY NAMES libfabulous.a
HINTS ${FABULOUS_DIR}
PATH_SUFFIXES lib lib32 lib64 lib/fabulous lib32/fabulous lib64/fabulous)
......@@ -139,17 +145,18 @@ if ((NOT FABULOUS_FOUND) AND (FABULOUS_GIVEN_BY_USER OR (NOT PKG_CONFIG_FOUND)))
find_package_handle_standard_args(FABULOUS_SHARED DEFAULT_MSG FABULOUS_SHARED_LIBRARY)
mark_as_advanced(FABULOUS_STATIC_LIBRARY FABULOUS_SHARED_LIBRARY)
if (FABULOUS_FIND_REQUIRED)
find_package(CBLAS REQUIRED)
find_package(LAPACKE REQUIRED)
else()
find_package(CBLAS)
find_package(LAPACKE)
endif()
if (FABULOUS_STATIC_FOUND AND NOT FABULOUS_SHARED_FOUND)
if (FABULOUS_FIND_REQUIRED)
find_package(CBLAS REQUIRED)
find_package(LAPACKE REQUIRED)
else()
find_package(CBLAS)
find_package(LAPACKE)
endif()
set(FABULOUS_LIBRARIES ${FABULOUS_STATIC_LIBRARY} ${CBLAS_LIBRARIES} ${LAPACKE_LIBRARIES})
set(FABULOUS_LIBRARIES ${FABULOUS_STATIC_LIBRARY} ${CBLAS_LIBRARIES} ${LAPACKE_LIBRARIES} "-lstdc++" "-lm")
elseif(FABULOUS_SHARED_FOUND)
set(FABULOUS_LIBRARIES ${FABULOUS_SHARED_LIBRARY})
set(FABULOUS_LIBRARIES ${FABULOUS_SHARED_LIBRARY} ${CBLAS_LIBRARIES} ${LAPACKE_LIBRARIES})
endif()
fabulous_check_function_exists(FABULOUS fabulous_create)
find_package_handle_standard_args(
......
This diff is collapsed.
......@@ -3,7 +3,7 @@
# @copyright (c) 2009-2014 The University of Tennessee and The University
# of Tennessee Research Foundation.
# All rights reserved.
# @copyright (c) 2012-2014 Inria. All rights reserved.
# @copyright (c) 2012-2018 Inria. All rights reserved.
# @copyright (c) 2012-2014 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All rights reserved.
#
###
......@@ -20,6 +20,7 @@
# FXT_INCLUDE_DIRS - fxt include directories
# FXT_LIBRARY_DIRS - Link directories for fxt libraries
# FXT_LIBRARIES - fxt component libraries to be linked
# FXT_FOUND_WITH_PKGCONFIG - True if found with pkg-config
#
# The user can give specific paths where to find the libraries adding cmake
# options at configure (ex: cmake path/to/project -DFXT_DIR=path/to/fxt):
......@@ -30,11 +31,11 @@
# are not given as cmake variable: FXT_DIR, FXT_INCDIR, FXT_LIBDIR
#=============================================================================
# Copyright 2012-2013 Inria
# Copyright 2012-2018 Inria
# Copyright 2012-2013 Emmanuel Agullo
# Copyright 2012-2013 Mathieu Faverge
# Copyright 2012 Cedric Castagnede
# Copyright 2013 Florent Pruvost
# Copyright 2013-2018 Florent Pruvost
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file MORSE-Copyright.txt for details.
......@@ -78,13 +79,19 @@ if(PKG_CONFIG_EXECUTABLE AND NOT FXT_GIVEN_BY_USER)
#endif()
else()
message(STATUS "${Magenta}Looking for FXT - not found using PkgConfig."
"\n Perhaps you should add the directory containing fxt.pc to the"
"\n PKG_CONFIG_PATH environment variable.${ColourReset}")
"\n Perhaps you should add the directory containing fxt.pc to the"
"\n PKG_CONFIG_PATH environment variable.${ColourReset}")
endif()
endif()
set(FXT_C_FLAGS "${FXT_CFLAGS_OTHER}")
if (FXT_FOUND AND FXT_LIBRARIES)
set(FXT_FOUND_WITH_PKGCONFIG "TRUE")
else()
set(FXT_FOUND_WITH_PKGCONFIG "FALSE")
endif()
endif(PKG_CONFIG_EXECUTABLE AND NOT FXT_GIVEN_BY_USER)
if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT FXT_FOUND) OR (FXT_GIVEN_BY_USER) )
......@@ -137,15 +144,15 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT FXT_FOUND) OR
if(FXT_DIR)
set(FXT_fxt.h_DIRS "FXT_fxt.h_DIRS-NOTFOUND")
find_path(FXT_fxt.h_DIRS
NAMES fxt.h
HINTS ${FXT_DIR}
PATH_SUFFIXES "include" "include/fxt")
NAMES fxt.h
HINTS ${FXT_DIR}
PATH_SUFFIXES "include" "include/fxt")
else()
set(FXT_fxt.h_DIRS "FXT_fxt.h_DIRS-NOTFOUND")
find_path(FXT_fxt.h_DIRS
NAMES fxt.h
HINTS ${_inc_env}
PATH_SUFFIXES "fxt")
NAMES fxt.h
HINTS ${_inc_env}
PATH_SUFFIXES "fxt")
endif()
endif()
mark_as_advanced(FXT_fxt.h_DIRS)
......@@ -183,9 +190,9 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT FXT_FOUND) OR
string(REPLACE ":" ";" _lib_env "$ENV{LIB}")
else()
if(APPLE)
string(REPLACE ":" ";" _lib_env "$ENV{DYLD_LIBRARY_PATH}")
string(REPLACE ":" ";" _lib_env "$ENV{DYLD_LIBRARY_PATH}")
else()
string(REPLACE ":" ";" _lib_env "$ENV{LD_LIBRARY_PATH}")
string(REPLACE ":" ";" _lib_env "$ENV{LD_LIBRARY_PATH}")
endif()
list(APPEND _lib_env "${CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES}")
list(APPEND _lib_env "${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}")
......@@ -206,14 +213,14 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT FXT_FOUND) OR
if(FXT_DIR)
set(FXT_fxt_LIBRARY "FXT_fxt_LIBRARY-NOTFOUND")
find_library(FXT_fxt_LIBRARY
NAMES fxt
HINTS ${FXT_DIR}
PATH_SUFFIXES lib lib32 lib64)
NAMES fxt
HINTS ${FXT_DIR}
PATH_SUFFIXES lib lib32 lib64)
else()
set(FXT_fxt_LIBRARY "FXT_fxt_LIBRARY-NOTFOUND")
find_library(FXT_fxt_LIBRARY
NAMES fxt
HINTS ${_lib_env})
NAMES fxt
HINTS ${_lib_env})
endif()
endif()
mark_as_advanced(FXT_fxt_LIBRARY)
......@@ -270,10 +277,10 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT FXT_FOUND) OR
if(NOT FXT_WORKS)
if(NOT FXT_FIND_QUIETLY)
message(STATUS "Looking for fxt : test of fut_keychange with fxt library fails")
message(STATUS "CMAKE_REQUIRED_LIBRARIES: ${CMAKE_REQUIRED_LIBRARIES}")
message(STATUS "CMAKE_REQUIRED_INCLUDES: ${CMAKE_REQUIRED_INCLUDES}")
message(STATUS "Check in CMakeFiles/CMakeError.log to figure out why it fails")
message(STATUS "Looking for fxt : test of fut_keychange with fxt library fails")
message(STATUS "CMAKE_REQUIRED_LIBRARIES: ${CMAKE_REQUIRED_LIBRARIES}")
message(STATUS "CMAKE_REQUIRED_INCLUDES: ${CMAKE_REQUIRED_INCLUDES}")
message(STATUS "Check in CMakeFiles/CMakeError.log to figure out why it fails")
endif()
endif()
set(CMAKE_REQUIRED_INCLUDES)
......@@ -289,6 +296,7 @@ if (FXT_LIBRARIES)
else()
list(GET FXT_LIBRARIES 0 first_lib)
get_filename_component(first_lib_path "${first_lib}" PATH)
set(FXT_LIBRARY_DIRS "${first_lib_path}")
endif()
if (${first_lib_path} MATCHES "/lib(32|64)?$")
string(REGEX REPLACE "/lib(32|64)?$" "" not_cached_dir "${first_lib_path}")
......
......@@ -3,7 +3,7 @@
# @copyright (c) 2009-2014 The University of Tennessee and The University
# of Tennessee Research Foundation.
# All rights reserved.
# @copyright (c) 2012-2017 Inria. All rights reserved.
# @copyright (c) 2012-2018 Inria. All rights reserved.
# @copyright (c) 2012-2014 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All rights reserved.
#
###
......@@ -20,6 +20,7 @@
# GTG_INCLUDE_DIRS - gtg include directories
# GTG_LIBRARY_DIRS - Link directories for gtg libraries
# GTG_LIBRARIES - gtg component libraries to be linked
# GTG_FOUND_WITH_PKGCONFIG - True if found with pkg-config
#
# The user can give specific paths where to find the libraries adding cmake
# options at configure (ex: cmake path/to/project -DGTG_DIR=path/to/gtg):
......@@ -30,11 +31,11 @@
# are not given as cmake variable: GTG_DIR, GTG_INCDIR, GTG_LIBDIR
#=============================================================================
# Copyright 2012-2017 Inria
# Copyright 2012-2018 Inria
# Copyright 2012-2013 Emmanuel Agullo
# Copyright 2012-2013 Mathieu Faverge
# Copyright 2012 Cedric Castagnede
# Copyright 2013-2017 Florent Pruvost
# Copyright 2013-2018 Florent Pruvost
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file MORSE-Copyright.txt for details.
......@@ -78,13 +79,19 @@ if(PKG_CONFIG_EXECUTABLE AND NOT GTG_GIVEN_BY_USER)
#endif()
else()
message(STATUS "${Magenta}Looking for GTG - not found using PkgConfig."
"\n Perhaps you should add the directory containing gtg.pc to the"
"\n PKG_CONFIG_PATH environment variable.${ColourReset}")
"\n Perhaps you should add the directory containing gtg.pc to the"
"\n PKG_CONFIG_PATH environment variable.${ColourReset}")
endif()
endif()
set(GTG_C_FLAGS "${GTG_CFLAGS_OTHER}")
if (GTG_FOUND AND GTG_LIBRARIES)
set(GTG_FOUND_WITH_PKGCONFIG "TRUE")
else()
set(GTG_FOUND_WITH_PKGCONFIG "FALSE")
endif()
endif(PKG_CONFIG_EXECUTABLE AND NOT GTG_GIVEN_BY_USER)
if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT GTG_FOUND) OR (GTG_GIVEN_BY_USER) )
......@@ -137,15 +144,15 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT GTG_FOUND) OR
if(GTG_DIR)
set(GTG_GTG.h_DIRS "GTG_GTG.h_DIRS-NOTFOUND")
find_path(GTG_GTG.h_DIRS
NAMES GTG.h
HINTS ${GTG_DIR}
PATH_SUFFIXES "include" "include/gtg")
NAMES GTG.h
HINTS ${GTG_DIR}
PATH_SUFFIXES "include" "include/gtg")
else()
set(GTG_GTG.h_DIRS "GTG_GTG.h_DIRS-NOTFOUND")
find_path(GTG_GTG.h_DIRS
NAMES GTG.h
HINTS ${_inc_env}
PATH_SUFFIXES "gtg")
NAMES GTG.h
HINTS ${_inc_env}
PATH_SUFFIXES "gtg")
endif()
endif()
mark_as_advanced(GTG_GTG.h_DIRS)
......@@ -183,9 +190,9 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT GTG_FOUND) OR
string(REPLACE ":" ";" _lib_env "$ENV{LIB}")
else()
if(APPLE)
string(REPLACE ":" ";" _lib_env "$ENV{DYLD_LIBRARY_PATH}")
string(REPLACE ":" ";" _lib_env "$ENV{DYLD_LIBRARY_PATH}")
else()
string(REPLACE ":" ";" _lib_env "$ENV{LD_LIBRARY_PATH}")
string(REPLACE ":" ";" _lib_env "$ENV{LD_LIBRARY_PATH}")
endif()
list(APPEND _lib_env "${CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES}")
list(APPEND _lib_env "${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}")
......@@ -206,14 +213,14 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT GTG_FOUND) OR
if(GTG_DIR)
set(GTG_gtg_LIBRARY "GTG_gtg_LIBRARY-NOTFOUND")
find_library(GTG_gtg_LIBRARY
NAMES gtg
HINTS ${GTG_DIR}
PATH_SUFFIXES lib lib32 lib64)
NAMES gtg
HINTS ${GTG_DIR}
PATH_SUFFIXES lib lib32 lib64)
else()
set(GTG_gtg_LIBRARY "GTG_gtg_LIBRARY-NOTFOUND")
find_library(GTG_gtg_LIBRARY
NAMES gtg
HINTS ${_lib_env})
NAMES gtg
HINTS ${_lib_env})
endif()
endif()
mark_as_advanced(GTG_gtg_LIBRARY)
......@@ -270,10 +277,10 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT GTG_FOUND) OR
if(NOT GTG_WORKS)
if(NOT GTG_FIND_QUIETLY)
message(STATUS "Looking for gtg : test of GTG_start with gtg library fails")
message(STATUS "CMAKE_REQUIRED_LIBRARIES: ${CMAKE_REQUIRED_LIBRARIES}")
message(STATUS "CMAKE_REQUIRED_INCLUDES: ${CMAKE_REQUIRED_INCLUDES}")
message(STATUS "Check in CMakeFiles/CMakeError.log to figure out why it fails")
message(STATUS "Looking for gtg : test of GTG_start with gtg library fails")
message(STATUS "CMAKE_REQUIRED_LIBRARIES: ${CMAKE_REQUIRED_LIBRARIES}")
message(STATUS "CMAKE_REQUIRED_INCLUDES: ${CMAKE_REQUIRED_INCLUDES}")
message(STATUS "Check in CMakeFiles/CMakeError.log to figure out why it fails")
endif()
endif()
set(CMAKE_REQUIRED_INCLUDES)
......@@ -289,6 +296,7 @@ if (GTG_LIBRARIES)
else()
list(GET GTG_LIBRARIES 0 first_lib)
get_filename_component(first_lib_path "${first_lib}" PATH)
set(GTG_LIBRARY_DIRS "${first_lib_path}")
endif()
if (${first_lib_path} MATCHES "/lib(32|64)?$")
string(REGEX REPLACE "/lib(32|64)?$" "" not_cached_dir "${first_lib_path}")
......
......@@ -3,7 +3,7 @@
# @copyright (c) 2009-2014 The University of Tennessee and The University
# of Tennessee Research Foundation.
# All rights reserved.
# @copyright (c) 2012-2017 Inria. All rights reserved.