-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
50 lines (40 loc) · 1.07 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
50
cmake_minimum_required(VERSION 2.8)
project(MPITC C)
set(GKLIB_PATH "GKlib" CACHE PATH "path to GKlib")
set(SHARED FALSE CACHE BOOL "build a shared library")
if(MSVC)
set(ORION_INSTALL FALSE)
else()
set(ORION_INSTALL TRUE)
endif()
# Add GKlib's cmake settings
include(${GKLIB_PATH}/GKlibSystem.cmake)
# Source files
file(GLOB mpitc_sources *.c)
# Include directories
include_directories(${GKLIB_PATH})
include_directories(.)
include_directories(~/local/include)
# Link directories
link_directories(~/local/lib)
# Build
add_executable(mpitc ${GKlib_sources} ${mpitc_sources})
foreach(prog mpitc)
target_link_libraries(${prog} m)
endforeach(prog)
# Install
if(ORION_INSTALL)
install(TARGETS mpitc
RUNTIME DESTINATION bin)
endif()
# Try to find subversion revision.
set(SVNREV "")
file(TO_NATIVE_PATH ${PROJECT_SOURCE_DIR}/.svn svn_dir)
if(IS_DIRECTORY ${svn_dir})
include(FindSubversion)
if(Subversion_FOUND)
Subversion_WC_INFO(${PROJECT_SOURCE_DIR} metis)
set(SVNREV ${metis_WC_REVISION})
endif(Subversion_FOUND)
endif()
add_definitions(-DSVNINFO="${SVNREV}")