Commit 3e16f992 authored by Arnaud's avatar Arnaud
parents 3fdab1fe 825a65b5
cmake_minimum_required (VERSION 2.8.3)
cmake_minimum_required (VERSION 2.8.3 FATAL_ERROR)
# check if compiling into source directories
STRING(COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" insource)
......@@ -6,6 +6,19 @@ if(insource)
MESSAGE(FATAL_ERROR "${PROJECT_NAME} requires an out of source build. Goto ./Build and tapes cmake ../")
endif(insource)
# Project Infos
project(ScalFMM)
#===========================================================================
# Version Number
#===========================================================================
# ScalFMM version number. An even minor number corresponds to releases.
SET(ScalFMM_MAJOR_VERSION 1)
SET(ScalFMM_MINOR_VERSION 0)
SET(ScalFMM_BUILD_VERSION 0)
SET(ScalFMM_VERSION "${ScalFMM_MAJOR_VERSION}.${ScalFMM_MINOR_VERSION}.${ScalFMM_BUILD_VERSION}"
)
# MPI option has to be set before project, cannot be changed in the cache!
if( SCALFMM_USE_MPI )
include(CMakeForceCompiler)
......@@ -14,16 +27,14 @@ if( SCALFMM_USE_MPI )
else()
MESSAGE(STATUS "Remove CMake cache and run cmake .. -DSCALFMM_USE_MPI=ON to enable MPI" )
endif(SCALFMM_USE_MPI)
# Project Infos
project(scalfmm)
#
# Active language
# -----------------------
ENABLE_LANGUAGE(CXX )
MESSAGE(STATUS " CXX ${CMAKE_CXX_COMPILER_ID}" )
# Options
OPTION( SCALFMM_USE_MPI "Set to ON to build ScaFMM with MPI" OFF )
OPTION( SCALFMM_USE_BLAS "Set to ON to build ScaFMM with BLAS" ON )
OPTION( SCALFMM_USE_TRACE "Set to ON to print trace or use itac trace" OFF )
OPTION( SCALFMM_BUILD_TESTS "Set to ON to build fonctionnalities Tests" ON )
......@@ -33,7 +44,8 @@ OPTION( SCALFMM_USE_MEM_STATS "Set to ON to profile memory" OFF )
OPTION( SCALFMM_USE_DOUBLE_PRECISION "Set to ON to compile in double precision" ON )
OPTION( SCALFMM_ATTACHE_SOURCE "Set to ON to compile with -g" OFF )
OPTION( SCALFMM_USE_ADDONS "Set to ON to compile add ons" OFF )
#
SET(SCALFMM_LIBRARIES "")
# Test if openmp is here
find_package (OpenMP)
......@@ -85,6 +97,7 @@ if( SCALFMM_USE_BLAS )
INCLUDE(FindBLAS)
INCLUDE(FindLAPACK)
endif()
SET(SCALFMM_LIBRARIES "${SCALFMM_LIBRARIES} ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES}")
endif()
# Compile option
......@@ -139,3 +152,18 @@ if("${CMAKE_GENERATOR}" MATCHES "Make")
COMMENT "Cleaning Build dir and CMake cache, then do cmake.."
)
endif()
#
#
#===========================================================================
# Build and export cmake files
#===========================================================================
#
MESSAGE(WARNING "ScalFMM_BINARY_DIR: "${Scalfmm_BINARY_DIR})
CONFIGURE_FILE(${ScalFMM_SOURCE_DIR}/ScalFMMConfig.cmake.in
${ScalFMM_BINARY_DIR}/ScalFMMConfig.cmake
@ONLY IMMEDIATE
)
INSTALL(FILES
${ScalFMM_BINARY_DIR}/ScalFMMConfig.cmake
DESTINATION lib/
)
#-----------------------------------------------------------------------------
#
# ScalFMMConfig.cmake - ScalFMM CMake configuration file for external projects.
#
# This file is configured by ScalFMM and used by the ScalFMM.cmake module
# to load ScalFMM's settings for an external project.
#
@ScalFMM_CONFIG_INSTALL_ONLY@
#
SET(ScalFMM_VERSION_MAJOR "@ScalFMM_MAJOR_VERSION@")
SET(ScalFMM_VERSION_MINOR "@ScalFMM_MINOR_VERSION@")
SET(ScalFMM_VERSION_BUILD "@ScalFMM_BUILD_VERSION@")
#
SET(ScalFMM_INCLUDE_DIR "@CMAKE_INSTALL_PREFIX@/include")
SET(ScalFMM_LIBRARIES_DIR "@CMAKE_INSTALL_PREFIX@/lib")
SET(ScalFMM_LIBRARIES "@SCALFMM_LIBRARIES@")
SET(ScalFMM_LIBRARY_NAME "@scalfmm_lib@")
#
SET(ScalFMM_SOURCE_DIR "@ScalFMM_SOURCE_DIR@")
SET(ScalFMM_BUILD_SHARED_LIBS "@BUILD_SHARED_LIBS@")
SET(ScalFMM_USE_FILE "@ScalFMM_USE_FILE@")
#
SET(ScalFMM_BUILD_TYPE "@CMAKE_BUILD_TYPE@")
#
# ScalFMM Options
#
SET(ScalLFMM_USE_MPI "@SCALFMM_USE_MPI@")
SET(ScalFMM_USE_BLAS "@SCALFMM_USE_BLAS@")
SET(ScalFMM_USE_MKL "@SCALFMM_USE_MKL_AS_BLAS@")
SET(ScalFMM_USE_DOUBLE_PRECISION "@SCALFMM_USE_DOUBLE_PRECISION@")
SET(ScalFMM_USE_MEM_STATS "@SCALFMM_USE_MEM_STATS@")
#SCALFMM_BUILD_TESTS => OFF
#SCALFMM_BUILD_UTESTS => OFF
\ No newline at end of file
......@@ -58,8 +58,7 @@ foreach(exec ${source_tests_files})
target_link_libraries(
${execname}
${scalfmm_lib}
${BLAS_LIBRARIES}
${LAPACK_LIBRARIES}
${SCALFMM_LIBRARIES}
)
endif()
endforeach(exec)
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