| 1 | cmake_minimum_required(VERSION 2.8.5) |
| 2 | project(ppam_mpi) |
| 3 | |
| 4 | set(CMAKE_C_FLAGS "-std=gnu99") |
| 5 | set(CMAKE_C_FLAGS_DEBUG "-g3") |
| 6 | set(CMAKE_C_FLAGS_RELEASE "-O3") |
| 7 | |
| 8 | #already by default... ?! |
| 9 | include_directories("${CMAKE_SOURCE_DIR}") |
| 10 | |
| 11 | #ppam executable (serialize, cluster, classif) |
| 12 | |
| 13 | #cds |
| 14 | set(CGDS_INCLUDE_PATH "/usr/local/include/cgds") |
| 15 | #set(CGDS_LIBRARY "/usr/local/lib/libcgds.so") |
| 16 | #find_path(CDS_INCLUDE_PATH "cgds/cgds.h") |
| 17 | #find_library(CGDS_LIBRARY cgds) |
| 18 | include_directories(${CGDS_INCLUDE_PATH}) |
| 19 | |
| 20 | #GSL: standard location |
| 21 | find_path(GSL_INCLUDE_PATH "gsl/gsl_linalg.h") |
| 22 | include_directories(${GSL_INCLUDE_PATH}) |
| 23 | find_library(GSL_LIBRARY gsl) |
| 24 | find_library(GSLCBLAS_LIBRARY gslcblas) |
| 25 | set(GSL_LIBRARIES ${GSL_LIBRARY} ${GSLCBLAS_LIBRARY}) |
| 26 | |
| 27 | #MPI: standard location |
| 28 | find_package(MPI REQUIRED) |
| 29 | include_directories(${MPI_INCLUDE_PATH}) |
| 30 | |
| 31 | #LibXml2: standard location |
| 32 | find_package(LibXml2 REQUIRED) |
| 33 | include_directories(${LIBXML2_INCLUDE_DIR}) |
| 34 | |
| 35 | file(GLOB_RECURSE ppam_src "${CMAKE_SOURCE_DIR}/*.c") |
| 36 | add_executable(ppam.exe ${ppam_src}) |
| 37 | add_library(ppam SHARED ${ppam_src}) |
| 38 | target_link_libraries(ppam.exe m cgds ${MPI_LIBRARIES} ${LIBXML2_LIBRARIES} ${GSL_LIBRARIES})# ${CGDS_LIBRARY}) |
| 39 | target_link_libraries(ppam m cgds ${MPI_LIBRARIES} ${LIBXML2_LIBRARIES} ${GSL_LIBRARIES})# ${CGDS_LIBRARY}) |
| 40 | |
| 41 | if (MPI_COMPILE_FLAGS) |
| 42 | set_target_properties(ppam.exe PROPERTIES |
| 43 | COMPILE_FLAGS "${MPI_COMPILE_FLAGS}") |
| 44 | endif() |
| 45 | if (MPI_LINK_FLAGS) |
| 46 | set_target_properties(ppam.exe PROPERTIES |
| 47 | LINK_FLAGS "${MPI_LINK_FLAGS}") |
| 48 | endif() |