forked from KarypisLab/METIS
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
47 lines (40 loc) · 1.16 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
cmake_minimum_required(VERSION 2.8)
project(METIS C)
set(GKLIB_PATH "${CMAKE_CURRENT_SOURCE_DIR}/GKlib" CACHE PATH "path to GKlib")
set(SHARED FALSE CACHE BOOL "build a shared library")
if(MSVC)
set(METIS_INSTALL FALSE)
else()
set(METIS_INSTALL TRUE)
endif()
# Configure libmetis library.
if(SHARED)
set(METIS_LIBRARY_TYPE SHARED)
else()
set(METIS_LIBRARY_TYPE STATIC)
endif(SHARED)
include(${GKLIB_PATH}/GKlibSystem.cmake)
# METIS' custom options
option(METIS_IDX64 "enable 64 bit ints" OFF)
option(METIS_REAL64 "enable 64 bit floats (i.e., double)" OFF)
if (METIS_IDX64)
set(METIS_IDXTYPEWIDTH 64)
else ()
set(METIS_IDXTYPEWIDTH 32)
endif ()
if (METIS_REAL64)
set(METIS_REALTYPEWIDTH 64)
else ()
set(METIS_REALTYPEWIDTH 32)
endif ()
# Add include directories.
include_directories(${GKLIB_PATH})
configure_file(${PROJECT_SOURCE_DIR}/include/metis.h.in
${PROJECT_BINARY_DIR}/include/metis.h)
include_directories(${PROJECT_BINARY_DIR}/include)
if (METIS_INSTALL)
install(FILES ${PROJECT_BINARY_DIR}/include/metis.h DESTINATION include)
endif ()
# Recursively look for CMakeLists.txt in subdirs.
add_subdirectory("libmetis")
add_subdirectory("programs")