Commit 8b8078af authored by PRUVOST Florent's avatar PRUVOST Florent

remove cmake_modules, they are located in trunk/morse_distrib and we have to...

remove cmake_modules, they are located in trunk/morse_distrib and we have to give the path to it to configure with MORSE_DISTRIB_DIR, ex: MORSE_DISTRIB_DIR=~/morse/trunk/morse_distrib - this to avoid duplication of these cmake modules between projects (chameleon, pastix, maphys, scallfmm) - for releases the directory should be copied in the root of the project, ex: ~/chameleon-1.0/cmake_modules/
parent 70c02408
This diff is collapsed.
###
#
# @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.
#
###
#
# @file GenPkgConfig.cmake
#
# @project MORSE
# MORSE is a software package provided by:
# Inria Bordeaux - Sud-Ouest,
# Univ. of Tennessee,
# King Abdullah Univesity of Science and Technology
# Univ. of California Berkeley,
# Univ. of Colorado Denver.
#
# @version 0.9.0
# @author Cedric Castagnede
# @author Emmanuel Agullo
# @author Mathieu Faverge
# @author Florent Pruvost
# @date 10-11-2014
#
###
###
#
# GENERATE_PKGCONFIG_FILE: generate a file .pc according to the options
#
###
MACRO(GENERATE_PKGCONFIG_FILE _file)
# The link flags specific to this package and any required libraries
# that don't support PkgConfig
set(CHAMELEON_PKGCONFIG_LIBS "")
# The link flags for private libraries required by this package but not
# exposed to applications
set(CHAMELEON_PKGCONFIG_LIBS_PRIVATE "")
# A list of packages required by this package
set(CHAMELEON_PKGCONFIG_REQUIRED "")
# A list of private packages required by this package but not exposed to
# applications
set(CHAMELEON_PKGCONFIG_REQUIRED_PRIVATE "")
list(APPEND CHAMELEON_PKGCONFIG_LIBS -lchameleon)
if(CHAMELEON_SCHED_STARPU)
list(APPEND CHAMELEON_PKGCONFIG_LIBS -lchameleon_starpu)
if ( CHAMELEON_USE_MPI )
list(APPEND CHAMELEON_PKGCONFIG_REQUIRED
starpumpi-${CHAMELEON_STARPU_VERSION})
else()
list(APPEND CHAMELEON_PKGCONFIG_REQUIRED
starpu-${CHAMELEON_STARPU_VERSION})
endif()
elseif(CHAMELEON_SCHED_QUARK)
list(APPEND CHAMELEON_PKGCONFIG_LIBS -lchameleon_quark)
list(APPEND CHAMELEON_PKGCONFIG_LIBS "-l${QUARK_quark_LIBRARY}")
endif()
if(NOT CHAMELEON_SIMULATION)
if(CHAMELEON_USE_CUDA)
list(APPEND CHAMELEON_PKGCONFIG_LIBS ${CUDA_LIBRARIES})
endif()
if(CHAMELEON_USE_MAGMA)
list(APPEND CHAMELEON_PKGCONFIG_REQUIRED magma)
endif()
list(APPEND CHAMELEON_PKGCONFIG_LIBS
-lcoreblas
${LAPACKE_LIBRARIES}
${CBLAS_LIBRARIES}
${EXTRA_LIBRARIES}
)
list(APPEND CHAMELEON_PKGCONFIG_REQUIRED hwloc)
else(NOT CHAMELEON_SIMULATION)
list(APPEND CHAMELEON_PKGCONFIG_LIBS
-lcoreblas
-lsimulapacke
-lsimucblas
${EXTRA_LIBRARIES}
)
list(APPEND CHAMELEON_PKGCONFIG_REQUIRED hwloc)
endif(NOT CHAMELEON_SIMULATION)
# Define required package
# -----------------------
set(CHAMELEON_PKGCONFIG_LIBS_CPY "${CHAMELEON_PKGCONFIG_LIBS}")
set(CHAMELEON_PKGCONFIG_LIBS "")
foreach(_dep ${CHAMELEON_PKGCONFIG_LIBS_CPY})
get_filename_component(dep_we ${_dep} NAME)
STRING(REPLACE "lib" "-l" dep_we "${dep_we}")
STRING(REPLACE ".so" "" dep_we "${dep_we}")
STRING(REPLACE ".a" "" dep_we "${dep_we}")
STRING(REPLACE ".dylib" "" dep_we "${dep_we}")
STRING(REPLACE ".dll" "" dep_we "${dep_we}")
list(APPEND CHAMELEON_PKGCONFIG_LIBS ${dep_we})
endforeach()
list(REMOVE_DUPLICATES CHAMELEON_PKGCONFIG_LIBS)
list(REMOVE_DUPLICATES CHAMELEON_PKGCONFIG_LIBS_PRIVATE)
list(REMOVE_DUPLICATES CHAMELEON_PKGCONFIG_REQUIRED)
list(REMOVE_DUPLICATES CHAMELEON_PKGCONFIG_REQUIRED_PRIVATE)
STRING(REPLACE ";" " " CHAMELEON_PKGCONFIG_LIBS "${CHAMELEON_PKGCONFIG_LIBS}")
STRING(REPLACE ";" " " CHAMELEON_PKGCONFIG_LIBS_PRIVATE "${CHAMELEON_PKGCONFIG_LIBS_PRIVATE}")
STRING(REPLACE ";" " " CHAMELEON_PKGCONFIG_REQUIRED "${CHAMELEON_PKGCONFIG_REQUIRED}")
STRING(REPLACE ";" " " CHAMELEON_PKGCONFIG_REQUIRED_PRIVATE "${CHAMELEON_PKGCONFIG_REQUIRED_PRIVATE}")
# Create .pc file
# ---------------
SET(_output_file "${CMAKE_BINARY_DIR}/chameleon.pc")
# TODO: add url of MORSE releases in .pc file
CONFIGURE_FILE("${_file}" "${_output_file}" @ONLY)
# installation
# ------------
INSTALL(FILES ${_output_file} DESTINATION lib/pkgconfig)
ENDMACRO(GENERATE_PKGCONFIG_FILE)
##
## @end file GenPkgConfig.cmake
##
###
#
# @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.
#
###
#
# @file PrintOpts.cmake
#
# @project MORSE
# MORSE is a software package provided by:
# Inria Bordeaux - Sud-Ouest,
# Univ. of Tennessee,
# King Abdullah Univesity of Science and Technology
# Univ. of California Berkeley,
# Univ. of Colorado Denver.
#
# @version 0.9.0
# @author Florent Pruvost
# @date 10-11-2014
#
###
set(dep_message "\nConfiguration of Chameleon:\n"
" BUILDNAME ...........: ${BUILDNAME}\n"
" SITE ................: ${SITE}\n"
"\n"
" Compiler: C .........: ${CMAKE_C_COMPILER} (${CMAKE_C_COMPILER_ID})\n"
" Compiler: Fortran ...: ${CMAKE_Fortran_COMPILER} (${CMAKE_Fortran_COMPILER_ID})\n")
if(CHAMELEON_USE_MPI)
set(dep_message "${dep_message}"
" Compiler: MPI .......: ${MPI_C_COMPILER}\n"
" compiler flags ......: ${MPI_C_COMPILE_FLAGS}\n")
endif()
set(dep_message "${dep_message}"
" Linker: .............: ${CMAKE_LINKER}\n"
"\n"
" Build type ..........: ${CMAKE_BUILD_TYPE}\n"
" Build shared ........: ${BUILD_SHARED_LIBS}\n"
" CFlags ..............: ${CMAKE_C_FLAGS}\n"
" LDFlags .............: ${CMAKE_C_LINK_FLAGS}\n"
"\n"
" Implementation paradigm\n"
" CUDA ................: ${CHAMELEON_USE_CUDA}\n"
" MPI .................: ${CHAMELEON_USE_MPI}\n"
"\n"
" Runtime specific\n"
" QUARK ...............: ${CHAMELEON_SCHED_QUARK}\n"
" StarPU ..............: ${CHAMELEON_SCHED_STARPU}\n"
" FxT .................: ${CHAMELEON_USE_FXT}\n"
"\n"
" Kernels specific\n"
" BLAS ................: ${BLA_VENDOR}\n"
" MAGMA ...............: ${CHAMELEON_USE_MAGMA}\n"
"\n"
" Simulation mode .....: ${CHAMELEON_SIMULATION}\n"
"\n"
" Binaries to build\n"
" documentation ........: ${CHAMELEON_ENABLE_DOCS}\n"
" example ..............: ${CHAMELEON_ENABLE_EXAMPLE}\n"
" testing ..............: ${CHAMELEON_ENABLE_TESTING}\n"
" timing ...............: ${CHAMELEON_ENABLE_TIMING}\n"
"\n"
" CHAMELEON dependencies :\n")
foreach (_dep ${CHAMELEON_DEP})
set(dep_message "${dep_message}"
" ${_dep}\n")
endforeach ()
set(dep_message "${dep_message}"
"\n"
" Definitions: ${CHAMELEON_DEFINITIONS_LIST}\n")
set(dep_message "${dep_message}"
"\n"
" INSTALL_PREFIX ......: ${CMAKE_INSTALL_PREFIX}\n\n")
string(REPLACE ";" " " dep_message_wsc "${dep_message}")
#message(${dep_message})
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/config.log "${dep_message_wsc}")
message(STATUS "Configuration is done - A summary of the current configuration"
"has been written in ${CMAKE_CURRENT_BINARY_DIR}/config.log")
# installation
# ------------
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/config.log DESTINATION share/chameleon)
#-------------------------------------------------------------------
macro( array2d_get_item out_value offset )
math( EXPR _finalindex "${_array2d_index}+${offset}" )
list( GET _array2d_array ${_finalindex} _item )
set( ${out_value} "${_item}" )
endmacro()
#-------------------------------------------------------------------
macro( array2d_begin_loop out_advanced array width var_names )
set( _array2d_out_advanced ${out_advanced} )
set( _array2d_index 0 )
set( _array2d_array ${array} )
set( _array2d_width ${width} )
set( _array2d_var_names ${var_names} )
array2d_advance()
endmacro()
#-------------------------------------------------------------------
macro( array2d_advance )
if( NOT _array2d_array )
set( ${_array2d_out_advanced} false )
else()
list( LENGTH _array2d_array _size )
math( EXPR _remaining "${_size}-${_array2d_index}" )
if( (_array2d_width LESS 1) OR (_size LESS _array2d_width) OR (_remaining LESS _array2d_width) )
set( ${_array2d_out_advanced} false )
else()
math( EXPR _adjusted_width "${_array2d_width}-1" )
foreach( offset RANGE ${_adjusted_width} )
list( GET _array2d_var_names ${offset} _var_name )
array2d_get_item( ${_var_name} ${offset} )
endforeach()
math( EXPR _index "${_array2d_index}+${_array2d_width}" )
set( _array2d_index ${_index} )
set( ${_array2d_out_advanced} true )
endif()
endif()
endmacro()
#-------------------------------------------------------------------
\ No newline at end of file
###
#
# @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.
#
###
#
# @file AuxilaryFlags.cmake
#
# @project MORSE
# MORSE is a software package provided by:
# Inria Bordeaux - Sud-Ouest,
# Univ. of Tennessee,
# King Abdullah Univesity of Science and Technology
# Univ. of California Berkeley,
# Univ. of Colorado Denver.
#
# @version 0.9.0
# @author Xavier Lacoste
# @date 30-01-2015
#
# Define auxilary variables:
# - CMAKE_Fortran_PREPROCESS_FLAGS : force C preprocessor.
# - CMAKE_Fortran_FREEFORM_FLAG : Force free format.
###
IF(CMAKE_Fortran_COMPILER_ID MATCHES GNU)
list(APPEND CMAKE_Fortran_FLAGS "-cpp -ffree-form")
ELSEIF(CMAKE_Fortran_COMPILER_ID MATCHES Intel)
list(APPEND CMAKE_Fortran_PREPROCESS_FLAG "-fpp")
ENDIF()
###
#
# @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.
#
###
#
# @file ColorizeMessage.cmake
#
# @project MORSE
# MORSE is a software package provided by:
# Inria Bordeaux - Sud-Ouest,
# Univ. of Tennessee,
# King Abdullah Univesity of Science and Technology
# Univ. of California Berkeley,
# Univ. of Colorado Denver.
#
# @version 0.9.0
# @author Cedric Castagnede
# @author Emmanuel Agullo
# @author Mathieu Faverge
# @author Florent Pruvost
# @date 13-07-2012
#
###
# 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()
# 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()
##
## @end file ColorizeMessage.cmake
##
###
#
# @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.
#
###
#
# @file FindHeadersAndLibs.cmake
#
# @project MORSE
# MORSE is a software package provided by:
# Inria Bordeaux - Sud-Ouest,
# Univ. of Tennessee,
# King Abdullah Univesity of Science and Technology
# Univ. of California Berkeley,
# Univ. of Colorado Denver.
#
# @version 0.9.0
# @author Cedric Castagnede
# @author Emmanuel Agullo
# @author Mathieu Faverge
# @author Florent Pruvost
# @date 13-07-2012
#
###
# Add the path where we handle our FindFOO.cmake to seek for liraries
list(APPEND CMAKE_MODULE_PATH ${MORSE_CMAKE_MODULE_PATH}/find)
# Some macros to print status when search for headers and libs
# PrintFindStatus.cmake is in cmake_modules/morse/find directory
include(PrintFindStatus)
function(FindHeader _libname _header_to_find)
# save _libname upper and lower case
string(TOUPPER ${_libname} LIBNAME)
string(TOLOWER ${_libname} libname)
# Looking for include
# -------------------
# Add system include paths to search include
# ------------------------------------------
unset(_inc_env)
if(WIN32)
string(REPLACE ":" ";" _inc_env "$ENV{INCLUDE}")
else()
string(REPLACE ":" ";" _path_env "$ENV{INCLUDE}")
list(APPEND _inc_env "${_path_env}")
string(REPLACE ":" ";" _path_env "$ENV{C_INCLUDE_PATH}")
list(APPEND _inc_env "${_path_env}")
string(REPLACE ":" ";" _path_env "$ENV{CPATH}")
list(APPEND _inc_env "${_path_env}")
string(REPLACE ":" ";" _path_env "$ENV{INCLUDE_PATH}")
list(APPEND _inc_env "${_path_env}")
endif()
list(APPEND _inc_env "${CMAKE_PLATFORM_IMPLICIT_INCLUDE_DIRECTORIES}")
list(APPEND _inc_env "${CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES}")
list(REMOVE_DUPLICATES _inc_env)
# Try to find the _header_to_find in the given paths
# --------------------------------------------------
# call cmake macro to find the header path
if(${LIBNAME}_INCDIR)
set(${LIBNAME}_${_header_to_find}_DIRS "${LIBNAME}_${_header_to_find}_DIRS-NOTFOUND")
find_path(${LIBNAME}_${_header_to_find}_DIRS
NAMES ${_header_to_find}
HINTS ${${LIBNAME}_INCDIR})
elseif(${LIBNAME}_DIR)
set(${LIBNAME}_${_header_to_find}_DIRS "${LIBNAME}_${_header_to_find}_DIRS-NOTFOUND")
find_path(${LIBNAME}_${_header_to_find}_DIRS
NAMES ${_header_to_find}
HINTS ${${LIBNAME}_DIR}
PATH_SUFFIXES include)
else()
set(${LIBNAME}_${_header_to_find}_DIRS "${LIBNAME}_${_header_to_find}_DIRS-NOTFOUND")
find_path(${LIBNAME}_${_header_to_find}_DIRS
NAMES ${_header_to_find}
HINTS ${_inc_env})
endif()
mark_as_advanced(${LIBNAME}_${_header_to_find}_DIRS)
# Print status if not found
# -------------------------
if (NOT ${LIBNAME}_${_header_to_find}_DIRS)
Print_Find_Header_Status(${libname} ${_header_to_find})
endif ()
endfunction(FindHeader)
##
## @end file FindHeadersAndLibs.cmake
##
###
#
# @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.
#
###
#
# @file MorseInit.cmake
#
# @project MORSE
# MORSE is a software package provided by:
# Inria Bordeaux - Sud-Ouest,
# Univ. of Tennessee,
# King Abdullah Univesity of Science and Technology
# Univ. of California Berkeley,
# Univ. of Colorado Denver.
#
# @version 0.9.0
# @author Cedric Castagnede
# @author Emmanuel Agullo
# @author Mathieu Faverge
# @author Florent Pruvost
# @date 13-07-2012
#
###
# This include is required to check symbols of libs in the main CMakeLists.txt
include(CheckFunctionExists)
# To colorize messages
include(ColorizeMessage)
# To find headers and libs
include(FindHeadersAndLibs)
# Some macros to print status when search for headers and libs
# PrintFindStatus.cmake is in cmake_modules/morse/find directory
include(PrintFindStatus)
# Define some auxilary flags
include(AuxilaryFlags)
# 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_VERBOSE_FIND_PACKAGE "Add additional messages concerning no found packages" OFF)
message("-- ${BoldGreen}MORSE_VERBOSE_FIND_PACKAGE is set to OFF, turn it ON to get"
"information about packages not found${ColourReset}")
##
## @end file MorseInit.cmake
##
###
#
# @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.
#
###
#
# @file ParseArguments.cmake
#
# @project MORSE
# MORSE is a software package provided by:
# Inria Bordeaux - Sud-Ouest,
# Univ. of Tennessee,
# King Abdullah Univesity of Science and Technology
# Univ. of California Berkeley,
# Univ. of Colorado Denver.
#
# @version 0.9.0
# @author Cedric Castagnede
# @author Emmanuel Agullo
# @author Mathieu Faverge
# @date 13-07-2012
#
###
MACRO(PARSE_ARGUMENTS prefix arg_names option_names)
set(DEFAULT_ARGS)
foreach(arg_name ${arg_names})
set(${prefix}_${arg_name})
endforeach(arg_name)
foreach(option ${option_names})
set(${prefix}_${option} FALSE)
endforeach(option)
set(current_arg_name DEFAULT_ARGS)
set(current_arg_list)
foreach(arg ${ARGN})
set(larg_names ${arg_names})
list(FIND larg_names "${arg}" is_arg_name)
if(is_arg_name GREATER -1)
set(${prefix}_${current_arg_name} ${current_arg_list})
set(current_arg_name ${arg})
set(current_arg_list)
else(is_arg_name GREATER -1)
set(loption_names ${option_names})
list(FIND loption_names "${arg}" is_option)
if(is_option GREATER -1)
set(${prefix}_${arg} TRUE)
else(is_option GREATER -1)
set(current_arg_list ${current_arg_list} ${arg})
endif(is_option GREATER -1)
endif(is_arg_name GREATER -1)
endforeach(arg)
set(${prefix}_${current_arg_name} ${current_arg_list})
ENDMACRO(PARSE_ARGUMENTS)
MACRO(CAR var)
set(${var} ${ARGV1})
ENDMACRO(CAR)
MACRO(CDR var junk)
set(${var} ${ARGN})
ENDMACRO(CDR)
##
## @end file ParseArguments.cmake
##
###
#
# @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.
#
###
#
# - Some macros to print status when search for headers and libs
# Main parameters of macros
# _libname: name of the lib you seek, foo for example
# _header_to_find: name of the header you seek, foo.h for example
# _lib_to_find: name of the library you seek, libfoo for example
# _pc_to_find: name of the pkg-config file zyou seek, foo.pc for example
#=============================================================================
# Copyright 2012-2013 Inria
# Copyright 2012-2013 Emmanuel Agullo
# Copyright 2012-2013 Mathieu Faverge
# Copyright 2012 Cedric Castagnede
# Copyright 2013 Florent Pruvost
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file MORSE-Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of Morse, substitute the full
# License text for the above reference.)
# 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()
# This macro informs why the _header_to_find file has not been found
macro(Print_Find_Header_Status _libname _header_to_find)
# save _libname upper and lower case
string(TOUPPER ${_libname} LIBNAME)
string(TOLOWER ${_libname} libname)
# print status
#message(" ")
if(${LIBNAME}_INCDIR)
message("${Blue}${LIBNAME}_INCDIR is defined but ${_header_to_find}"
"has not been found in ${${LIBNAME}_INCDIR}${ColourReset}")
else()
if(${LIBNAME}_DIR)
message("${Blue}${LIBNAME}_DIR is defined but"
"${_header_to_find} has not been found in"
"${${LIBNAME}_DIR}/include${ColourReset}")
else()
message("${Blue}${_header_to_find} not found."
"Nor ${LIBNAME}_DIR neither ${LIBNAME}_INCDIR"
"are defined so that we looked for ${_header_to_find} in"
"system paths (INCLUDE, CPATH, C_INCLUDE_PATH,"
"INCLUDE_PATH, CMAKE_PLATFORM_IMPLICIT_INCLUDE_DIRECTORIES"
", CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES)${ColourReset}")
if(_inc_env)
message("${Blue}${_header_to_find} has not been found in"
"${_inc_env}${ColourReset}")
endif()
endif()
endif()
message("${BoldBlue}Please indicate where to find ${_header_to_find}. You have three options:\n"
"- Option 1: Provide the root directory of the library with cmake option: -D${LIBNAME}_DIR=your/path/to/${libname}/\n"
"- Option 2: Provide the directory where to find the headers with cmake option: -D${LIBNAME}_INCDIR=your/path/to/${libname}/include/\n"
"- Option 3: Update your environment variable (INCLUDE or CPATH)\n"
"- Option 4: If your library provides a PkgConfig file, make sure pkg-config finds your library${ColourReset}")
#message(" ")
endmacro()
# This macro informs why the _lib_to_find file has not been found
macro(Print_Find_Library_Status _libname _lib_to_find)
# save _libname upper/lower case
string(TOUPPER ${_libname} LIBNAME)
string(TOLOWER ${_libname} libname)
# print status
#message(" ")
if(${LIBNAME}_LIBDIR)
message("${Yellow}${LIBNAME}_LIBDIR is defined but ${_lib_to_find}"