commit last state
[ppam-mpi.git] / code / src / CMakeLists.txt
CommitLineData
81923e5c
BA
1cmake_minimum_required(VERSION 2.8.5)
2project(ppam_mpi)
3
4include("${CMAKE_SOURCE_DIR}/../shared_CMakeLists.txt")
5
6#ppam executable (serialize, cluster, classif)
7
8#cds
9find_path(CDS_INCLUDE_PATH "cds/cds.h")
10find_library(CDS_LIBRARY cds)
11include_directories(${CDS_INCLUDE_PATH})
12
13#GSL: standard location
14find_path(GSL_INCLUDE_PATH "gsl/gsl_linalg.h")
15include_directories(${GSL_INCLUDE_PATH})
16find_library(GSL_LIBRARY gsl)
17find_library(GSLCBLAS_LIBRARY gslcblas)
18set(GSL_LIBRARIES ${GSL_LIBRARY} ${GSLCBLAS_LIBRARY})
19
20#MPI: standard location
21find_package(MPI REQUIRED)
22include_directories(${MPI_INCLUDE_PATH})
23
24#LibXml2: standard location
25find_package(LibXml2 REQUIRED)
26include_directories(${LIBXML2_INCLUDE_DIR})
27
28file(GLOB_RECURSE ppam_src "${CMAKE_SOURCE_DIR}/*.c")
29add_executable(ppam.exe ${ppam_src})
30add_library(ppam SHARED ${ppam_src})
31target_link_libraries(ppam.exe m cds ${MPI_LIBRARIES} ${LIBXML2_LIBRARIES} ${GSL_LIBRARIES} ${CDS_LIBRARY})
32target_link_libraries(ppam m cds ${MPI_LIBRARIES} ${LIBXML2_LIBRARIES} ${GSL_LIBRARIES} ${CDS_LIBRARY})
33
34if (MPI_COMPILE_FLAGS)
35 set_target_properties(ppam.exe PROPERTIES
36 COMPILE_FLAGS "${MPI_COMPILE_FLAGS}")
37endif()
38if (MPI_LINK_FLAGS)
39 set_target_properties(ppam.exe PROPERTIES
40 LINK_FLAGS "${MPI_LINK_FLAGS}")
41endif()