CMakeLists.txt 883 Bytes
Newer Older
1 2
cmake_minimum_required(VERSION 2.6)

3 4 5 6 7 8
# 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 scalfmm/Build and tapes cmake ../")
endif(insource)

9 10 11 12
# Configuration du projet
project(Lib_scalfmm)
set(LIBRARY_OUTPUT_PATH ../lib/${CMAKE_BUILD_TYPE})

13 14 15 16 17 18 19
# Test if openmp is here
include(FindOpenMP)
if(OPENMP_FOUND)
	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
	set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
endif()

20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
# Searching all cpp file
file(
	GLOB_RECURSE
	source_lib_files
	./*.cpp
)

# Adding cpp files to project
add_library(
	scalfmm
	STATIC
	${source_lib_files}
)

# Adding the entire project dir as an include dir
INCLUDE_DIRECTORIES(
berenger-bramas's avatar
berenger-bramas committed
36
     ${CMAKE_BINARY_DIR}/Src 
37 38
)