84 lines
2.6 KiB
Diff
84 lines
2.6 KiB
Diff
Index: metis-5.1.0/CMakeLists.txt
|
|
===================================================================
|
|
--- metis-5.1.0.orig/CMakeLists.txt
|
|
+++ metis-5.1.0/CMakeLists.txt
|
|
@@ -1,8 +1,9 @@
|
|
cmake_minimum_required(VERSION 2.8)
|
|
project(METIS)
|
|
|
|
-set(GKLIB_PATH "GKlib" CACHE PATH "path to GKlib")
|
|
+set(GKLIB_PATH "${CMAKE_SOURCE_DIR}/GKlib" CACHE PATH "path to GKlib")
|
|
set(SHARED FALSE CACHE BOOL "build a shared library")
|
|
+INCLUDE(GNUInstallDirs)
|
|
|
|
if(MSVC)
|
|
set(METIS_INSTALL FALSE)
|
|
@@ -11,11 +12,11 @@ else()
|
|
endif()
|
|
|
|
# Configure libmetis library.
|
|
-if(SHARED)
|
|
- set(METIS_LIBRARY_TYPE SHARED)
|
|
-else()
|
|
- set(METIS_LIBRARY_TYPE STATIC)
|
|
-endif(SHARED)
|
|
+set(METIS_LIBRARY_TYPE SHARED)
|
|
+
|
|
+set(METIS_MAJOR_VERSION 5)
|
|
+set(METIS_MINOR_VERSION 1)
|
|
+set(METIS_PATCH_VERSION 0)
|
|
|
|
include(${GKLIB_PATH}/GKlibSystem.cmake)
|
|
# Add include directories.
|
|
Index: metis-5.1.0/libmetis/CMakeLists.txt
|
|
===================================================================
|
|
--- metis-5.1.0.orig/libmetis/CMakeLists.txt
|
|
+++ metis-5.1.0/libmetis/CMakeLists.txt
|
|
@@ -4,13 +4,16 @@ include_directories(.)
|
|
file(GLOB metis_sources *.c)
|
|
# Build libmetis.
|
|
add_library(metis ${METIS_LIBRARY_TYPE} ${GKlib_sources} ${metis_sources})
|
|
+SET_TARGET_PROPERTIES(metis PROPERTIES
|
|
+ VERSION ${METIS_MAJOR_VERSION}.${METIS_MINOR_VERSION}.${METIS_PATCH_VERSION}
|
|
+ SOVERSION ${METIS_MAJOR_VERSION})
|
|
if(UNIX)
|
|
target_link_libraries(metis m)
|
|
endif()
|
|
|
|
if(METIS_INSTALL)
|
|
install(TARGETS metis
|
|
- LIBRARY DESTINATION lib
|
|
- RUNTIME DESTINATION lib
|
|
- ARCHIVE DESTINATION lib)
|
|
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
|
+ RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
|
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
|
endif()
|
|
Index: metis-5.1.0/programs/CMakeLists.txt
|
|
===================================================================
|
|
--- metis-5.1.0.orig/programs/CMakeLists.txt
|
|
+++ metis-5.1.0/programs/CMakeLists.txt
|
|
@@ -15,7 +15,7 @@ endforeach(prog)
|
|
|
|
if(METIS_INSTALL)
|
|
install(TARGETS gpmetis ndmetis mpmetis m2gmetis graphchk cmpfillin
|
|
- RUNTIME DESTINATION bin)
|
|
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
|
endif()
|
|
|
|
# Try to find subversion revision.
|
|
Index: metis-5.1.0/GKlib/CMakeLists.txt
|
|
===================================================================
|
|
--- metis-5.1.0.orig/GKlib/CMakeLists.txt
|
|
+++ metis-5.1.0/GKlib/CMakeLists.txt
|
|
@@ -8,6 +8,9 @@ include(GKlibSystem.cmake)
|
|
|
|
include_directories(".")
|
|
add_library(GKlib STATIC ${GKlib_sources})
|
|
+SET_TARGET_PROPERTIES(GKlib PROPERTIES
|
|
+ VERSION ${METIS_MAJOR_VERSION}.${METIS_MINOR_VERSION}.${METIS_PATCH_VERSION}
|
|
+ SOVERSION ${METIS_MAJOR_VERSION})
|
|
if(UNIX)
|
|
target_link_libraries(GKlib m)
|
|
endif(UNIX)
|