CMakeLists.txt 1.4 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( SCALFMM_USE_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
21
22
23
24
25
26
#
if(SCALFMM_USE_CBLAS )
OPTION( SCALFMM_USE_MKL "Set to ON to build MKL CBLAS" OFF )
  IF (    SCALFMM_USE_MKL ) 
     SET(CBLAS_LIBRARIES "-L$ENV{MKLROOT}/lib  -lmkl_intel_lp64 -lmkl_sequential -lmkl_core")
  ELSE (    SCALFMM_USE_MKL ) 
      FIND_PACKAGE(BLAS)
      SET(CBLAS_LIBRARIES "-lcblas")
  ENDIF (    SCALFMM_USE_MKL)
ENDIF(SCALFMM_USE_CBLAS)
#
berenger-bramas's avatar
berenger-bramas committed
27
ADD_DEFINITIONS(-O2 -Wall -Wshadow -Wpointer-arith -Wcast-qual)
berenger-bramas's avatar
berenger-bramas committed
28

29
30
CONFIGURE_FILE( ${CMAKE_SOURCE_DIR}/Sources/ScalFMM_config.h.cmake 
		${CMAKE_BINARY_DIR}/Sources/ScalFMM_config.h  )
berenger-bramas's avatar
berenger-bramas committed
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# 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
45
46
47

# Build - doc
add_subdirectory(Doc)