CMakeLists.txt 1.37 KB
Newer Older
berenger-bramas's avatar
berenger-bramas committed
1 2 3
cmake_minimum_required (VERSION 2.6)

# Project Infos
berenger-bramas's avatar
berenger-bramas committed
4 5 6 7 8 9 10
project(scalfmm CXX)

# check if compiling into source directories
STRING(COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" insource)
IF(insource)
    MESSAGE(FATAL_ERROR "${PROJECT_NAME} requires an out of source build. Goto ./Build and tapes cmake ../")
ENDIF(insource)
11

berenger-bramas's avatar
berenger-bramas committed
12
# Options
13
OPTION( FUSE_CBLAS "Set to ON to build ScaFMM with BLAS" ON )
berenger-bramas's avatar
berenger-bramas committed
14 15
OPTION( BUILD_TESTS "Set to ON to build fonctionnalities Tests" ON )
OPTION( BUILD_UTESTS "Set to ON to build UTests" ON )
16

17
#
18 19 20
if( FUSE_CBLAS )
  OPTION( FUSE_MKL_AS_BLAS "Set to ON to use MKL CBLAS" OFF )
  IF( FUSE_MKL_AS_BLAS )
21
     SET(CBLAS_LIBRARIES "-L$ENV{MKLROOT}/lib  -lmkl_intel_lp64 -lmkl_sequential -lmkl_core")
22
  ELSE( FUSE_MKL_AS_BLAS ) 
23 24
      FIND_PACKAGE(BLAS)
      SET(CBLAS_LIBRARIES "-lcblas")
25 26 27
  ENDIF( FUSE_MKL_AS_BLAS )
ENDIF( FUSE_CBLAS )

28
#
berenger-bramas's avatar
berenger-bramas committed
29
ADD_DEFINITIONS(-O2 -Wall -Wshadow -Wpointer-arith -Wcast-qual)
berenger-bramas's avatar
berenger-bramas committed
30

31 32
CONFIGURE_FILE( ${CMAKE_SOURCE_DIR}/Sources/ScalFMM_config.h.cmake 
		${CMAKE_BINARY_DIR}/Sources/ScalFMM_config.h  )
33

berenger-bramas's avatar
berenger-bramas committed
34 35 36 37 38 39 40 41 42 43 44 45 46 47
# Build - lib
add_subdirectory(Sources)

# Build - Tests
MESSAGE( STATUS "BUILD_TESTS = ${BUILD_TESTS}" )
if( ${BUILD_TESTS} STREQUAL "ON" )
	add_subdirectory(Tests)
endif()

# Build - UTests
MESSAGE( STATUS "BUILD_UTESTS = ${BUILD_UTESTS}" )
if( ${BUILD_UTESTS} STREQUAL "ON" )
	add_subdirectory(UTests)
endif()
berenger-bramas's avatar
berenger-bramas committed
48 49 50

# Build - doc
add_subdirectory(Doc)