-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
49 lines (41 loc) · 1.96 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
project(multilouvain)
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
set(PROJECT_BINARY_DIR "${CMAKE_CURRENT_SOURCE_DIR}/build/")
set(LIBRARY_OUTPUT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/build/" CACHE PATH "Single directory for all libraries")
set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/build/" CACHE PATH "Single directory for all executables")
# Check for the support of C++11 compliant compilers
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
if(COMPILER_SUPPORTS_CXX11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
elseif(COMPILER_SUPPORTS_CXX0X)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
else()
message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
endif()
set(CMAKE_CXX_FLAGS "-Wall -Wno-deprecated-register -Wno-deprecated-declarations -std=c++11 ${CMAKE_CXX_FLAGS}")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3")
# Specify if matlab support and python wrappers are to be compiled. Default OFF
# MATLAB support needs MEX (Tested on Ubuntu 14.04, Matlab R2013a)
option(MATLAB_SUPPORT "Mex with MATLAB" OFF)
option(OCTAVE_SUPPORT "Oct with Octave mkoctfile" OFF)
if(MATLAB_SUPPORT)
find_package(MyMatlab)
include_directories(${MATLAB_INCLUDE_DIRS})
message(STATUS "Matlab include directory: " ${MATLAB_INCLUDE_DIRS})
add_definitions("-DMATLAB_SUPPORT")
endif()
if(OCTAVE_SUPPORT)
find_package(OCTAVE)
include_directories(${OCTAVE_INCLUDE_DIRS})
message(STATUS "OCTAVE include directory: " ${OCTAVE_INCLUDE_DIRS})
add_definitions("-DOCTAVE_SUPPORT")
endif(OCTAVE_SUPPORT)
find_package(IGraph)
include_directories(${IGRAPH_INCLUDES})
add_definitions("-DIGRAPH_SUPPORT")
include_directories("../paco/src/eigen")
# Add the subdirectory with the source code
add_subdirectory(src)