CMakeLists.txt 1.81 KB
Newer Older
1
2
3
4
5
6
# 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)

7
project(EXAMPLES_SCALFMM CXX)
8
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BUILD_TYPE})
9
#ADD_DEFINITIONS( ${SCALFMM_CXX_FLAGS})
10
11
12

# Adding the project sources dir as an include dir
INCLUDE_DIRECTORIES(
13
14
     ${SCALFMM_BINARY_DIR}/Src 
     ${SCALFMM_SOURCE_DIR}/Src 
15
16
     ${SCALFMM_INCLUDES}
     
17
)
18
19
20
21
set(GENERIC_SOURCE_FILES  changeFmaFormat generateDistributions statisticsOnOctree DirectComputation CutOffAlgorithm RotationFMM compareAllPoissonKernels)
if(SCALFMM_USE_BLAS)
    set(GENERIC_SOURCE_FILES ${GENERIC_SOURCE_FILES} ChebyshevInterpolationFMM ChebyshevInterpolationAdaptiveFMM  )
endif(SCALFMM_USE_BLAS)
22

23
24
25
if(SCALFMM_USE_FFT)
    set(GENERIC_SOURCE_FILES ${GENERIC_SOURCE_FILES} UniformInterpolationFMM LagrangeInterpolationAdaptiveFMM  )
else()
COULAUD Olivier's avatar
COULAUD Olivier committed
26
  message(STATUS " &&&&&&&&&&&&&&&&&&&& SCALFMM_USE_FFT ${SCALFMM_USE_FFT}")
27
endif(SCALFMM_USE_FFT)
28

29
30
31
32
33
34
35
if(SCALFMM_USE_MPI)
    set(GENERIC_SOURCE_FILES ${GENERIC_SOURCE_FILES} RotationMPIFMM  )
    if(SCALFMM_USE_BLAS)
        set(GENERIC_SOURCE_FILES ${GENERIC_SOURCE_FILES} ChebyshevInterpolationMPIFMMSplit ChebyshevInterpolationMPIFMM  )
    endif(SCALFMM_USE_BLAS)

    if(SCALFMM_USE_FFT)
COULAUD Olivier's avatar
COULAUD Olivier committed
36
#        set(GENERIC_SOURCE_FILES ${GENERIC_SOURCE_FILES}   )
37
    endif(SCALFMM_USE_FFT)
38

39
endif()
COULAUD Olivier's avatar
COULAUD Olivier committed
40
41
#
MESSAGE(WARNIG "GENERIC_SOURCE_FILES ${GENERIC_SOURCE_FILES}")
42
43
44
45
46
47
48
49
#
#
#
foreach(exec ${GENERIC_SOURCE_FILES})
    add_executable(${exec} ${exec}.cpp)
    SET_TARGET_PROPERTIES(${exec} PROPERTIES ENABLE_EXPORTS TRUE)
    target_link_libraries(${exec} ${scalfmm_lib} ${SCALFMM_LIBRARIES} )
    install( TARGETS ${exec}  DESTINATION bin )
50
endforeach(exec)