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
|
Index: parmetis/libparmetis/CMakeLists.txt
===================================================================
--- parmetis.orig/libparmetis/CMakeLists.txt 2011-07-26 08:59:07.000000000 +1200
+++ parmetis/libparmetis/CMakeLists.txt 2012-08-22 13:12:52.801407858 +1200
@@ -3,12 +3,17 @@
# Find sources.
file(GLOB parmetis_sources *.c)
# Create libparmetis
-add_library(parmetis ${ParMETIS_LIBRARY_TYPE} ${parmetis_sources})
+add_library(parmetis SHARED ${parmetis_sources})
+add_library(parmetis_static STATIC ${parmetis_sources})
+set_target_properties(parmetis_static PROPERTIES OUTPUT_NAME parmetis)
+
# Link with metis and MPI libraries.
target_link_libraries(parmetis metis ${MPI_LIBRARIES})
set_target_properties(parmetis PROPERTIES LINK_FLAGS "${MPI_LINK_FLAGS}")
+target_link_libraries(parmetis_static metis_static ${MPI_LIBRARIES})
+set_target_properties(parmetis_static PROPERTIES LINK_FLAGS "${MPI_LINK_FLAGS}")
-install(TARGETS parmetis
+install(TARGETS parmetis parmetis_static
LIBRARY DESTINATION lib
RUNTIME DESTINATION lib
ARCHIVE DESTINATION lib)
Index: parmetis/metis/libmetis/CMakeLists.txt
===================================================================
--- parmetis.orig/metis/libmetis/CMakeLists.txt 2012-08-22 12:42:17.910939909 +1200
+++ parmetis/metis/libmetis/CMakeLists.txt 2012-08-22 13:14:22.781918446 +1200
@@ -3,13 +3,17 @@
# Find sources.
file(GLOB metis_sources *.c)
# Build libmetis.
-add_library(metis ${METIS_LIBRARY_TYPE} ${GKlib_sources} ${metis_sources})
+add_library(metis SHARED ${GKlib_sources} ${metis_sources})
+add_library(metis_static STATIC ${GKlib_sources} ${metis_sources})
+
+set_target_properties(metis_static PROPERTIES OUTPUT_NAME metis)
if(UNIX)
target_link_libraries(metis m)
+ target_link_libraries(metis_static m)
endif()
if(METIS_INSTALL)
- install(TARGETS metis
+ install(TARGETS metis metis_static
LIBRARY DESTINATION lib
RUNTIME DESTINATION lib
ARCHIVE DESTINATION lib)
|