-
Notifications
You must be signed in to change notification settings - Fork 15
/
CMakeLists.txt
43 lines (38 loc) · 1.73 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
CMAKE_MINIMUM_REQUIRED(VERSION 3.10)
PROJECT(GraphMining)
INCLUDE_DIRECTORIES(include)
#SET(CMAKE_C_COMPILER "/opt/gcc-7.3.0/bin/gcc")
SET(CMAKE_BUILD_TYPE RELEASE)
SET(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -O0 -Wall -g -ggdb")
SET(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -O3 -Wall")
SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/libs)
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
ADD_COMPILE_OPTIONS(-std=c++11)
find_package(OpenMP REQUIRED)
if(OPENMP_FOUND)
message("OPENMP FOUND")
INCLUDE_DIRECTORIES(${OpenMP_INCLUDE_DIRS})
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}" )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}" )
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${OpenMP_CXX_FLAGS}" )
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${OpenMP_CXX_FLAGS}" )
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}" )
set(CMAKE_SHARE_LINKER_FLAGS "${CMAKE_SHARE_LINKER_FLAGS} ${OpenMP_SHARE_LINKER_FLAGS}" )
#TARGET_COMPILE_OPTIONS(graph_mining PRIVATE -Wall ${OpenMP_CXX_FLAGS})
endif()
find_package(MPI REQUIRED)
if(MPI_FOUND)
SET(CMAKE_CXX_COMPILER mpicxx)
endif()
ADD_SUBDIRECTORY(src)
#ADD_SUBDIRECTORY(test)
ADD_SUBDIRECTORY(tianhe)
MESSAGE("CMAKE_C_FLAGS = " ${CMAKE_C_FLAGS})
MESSAGE("CMAKE_CXX_FLAGS = " ${CMAKE_CXX_FLAGS})
MESSAGE("CMAKE_CXX_FLAGS_RELEASE = " ${CMAKE_CXX_FLAGS_RELEASE})
MESSAGE("CMAKE_CXX_FLAGS_DEBUG = " ${CMAKE_CXX_FLAGS_DEBUG})
MESSAGE("CMAKE_EXE_LINKER_FLAGS" = ${CMAKE_EXE_LINKER_FLAGS})
MESSAGE("PROJECT BINARY DIR = " ${PROJECT_BINARY_DIR})
MESSAGE("INCLUDE DIRECTORIES = " ${CPLUS_INCLUDE_PATH})
MESSAGE("CMAKE_BUILD_TYPE = " ${CMAKE_BUILD_TYPE})
MESSAGE("CMAKE_INSTALL_PREFIX = " ${CMAKE_INSTALL_PREFIX})