-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
329 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
@PACKAGE_INIT@ | ||
|
||
## Define exported variables | ||
set(METIS_IDXTYPEWIDTH @METIS_IDXTYPEWIDTH@) | ||
set(METIS_REALTYPEWIDTH @METIS_REALTYPEWIDTH@) | ||
|
||
## Add all exported targets | ||
include(${CMAKE_CURRENT_LIST_DIR}/METISTargets.cmake) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
set_package_properties(GKlib PROPERTIES | ||
URL https://github.com/KarypisLab/GKlib | ||
DESCRIPTION "A library of various helper routines and frameworks used by many of the KarypisLab's software" | ||
TYPE REQUIRED | ||
PURPOSE "Utilties library" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Name: @PROJECT_NAME@ | ||
Description: @PROJECT_DESCRIPTION@ | ||
Version: @PROJECT_VERSION@ | ||
|
||
Libs: -L@CMAKE_INSTALL_FULL_LIBDIR@ -lmetis | ||
Cflags: -I@CMAKE_INSTALL_FULL_INCLUDEDIR@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,37 @@ | ||
if(METIS_INSTALL) | ||
install(FILES metis.h DESTINATION include) | ||
endif() | ||
# Generate metis.h file with appropriate exported macros | ||
if (METIS_IDX64) | ||
set(IDXTYPEWIDTH 64) | ||
else () | ||
set(IDXTYPEWIDTH 32) | ||
endif () | ||
if (METIS_REAL64) | ||
set(REALTYPEWIDTH 64) | ||
else () | ||
set(REALTYPEWIDTH 32) | ||
endif () | ||
configure_file(metis.h.in metis.h @ONLY) | ||
|
||
# Configure main target to consume the metis.h | ||
# TODO: Move to FILE_SET for cmake 3.23 | ||
set_target_properties(METIS_METIS PROPERTIES | ||
PUBLIC_HEADER ${CMAKE_CURRENT_SOURCE_DIR}/metis.h | ||
) | ||
target_include_directories(METIS_METIS PUBLIC | ||
# Add the path to the generated metis.h | ||
"$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>" | ||
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>" | ||
) | ||
|
||
# Set namespaced variables to be exported | ||
set(METIS_IDXTYPEWIDTH ${IDXTYPEWIDTH}) | ||
set(METIS_REALTYPEWIDTH ${REALTYPEWIDTH}) | ||
if (CMAKE_VERSION VERSION_LESS 3.25) | ||
# TODO: Remove when cmake 3.25 is commonly distributed | ||
set(METIS_IDXTYPEWIDTH ${METIS_IDXTYPEWIDTH} PARENT_SCOPE) | ||
set(METIS_REALTYPEWIDTH ${METIS_IDXTYPEWIDTH} PARENT_SCOPE) | ||
else () | ||
return(PROPAGATE | ||
METIS_IDXTYPEWIDTH | ||
METIS_REALTYPEWIDTH | ||
) | ||
endif () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,49 @@ | ||
# Add this directory for internal users. | ||
set(METIS_NAME "metis" CACHE INTERNAL "") | ||
target_sources(METIS_METIS PRIVATE | ||
auxapi.c | ||
balance.c | ||
bucketsort.c | ||
checkgraph.c | ||
coarsen.c | ||
compress.c | ||
contig.c | ||
debug.c | ||
fm.c | ||
fortran.c | ||
frename.c | ||
gklib.c | ||
graph.c | ||
initpart.c | ||
kmetis.c | ||
kwayfm.c | ||
kwayrefine.c | ||
mcutil.c | ||
mesh.c | ||
meshpart.c | ||
minconn.c | ||
mincover.c | ||
mmd.c | ||
ometis.c | ||
options.c | ||
parmetis.c | ||
pmetis.c | ||
refine.c | ||
separator.c | ||
sfm.c | ||
srefine.c | ||
stat.c | ||
timing.c | ||
util.c | ||
wspace.c | ||
) | ||
target_link_libraries(METIS_METIS PRIVATE GKLib::GKLib) | ||
|
||
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../include) | ||
|
||
# Find sources. | ||
file(GLOB metis_sources *.h *.c) | ||
|
||
# Build libmetis. | ||
add_library(${METIS_NAME} ${METIS_LIBRARY_TYPE} ${metis_sources}) | ||
|
||
if(GKLIB_NAME) | ||
target_link_libraries(${METIS_NAME} ${GKLIB_NAME}) | ||
add_dependencies(${METIS_NAME} ${GKLIB_NAME}) | ||
endif() | ||
|
||
if(METIS_INSTALL) | ||
install(TARGETS ${METIS_NAME} | ||
LIBRARY DESTINATION lib | ||
RUNTIME DESTINATION lib | ||
ARCHIVE DESTINATION lib) | ||
endif() | ||
# Install | ||
if (METIS_INSTALL) | ||
install(TARGETS METIS_METIS | ||
EXPORT METISTargets | ||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT METIS_Runtime NAMELINK_COMPONENT METIS_Development | ||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT METIS_Development | ||
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT METIS_Development | ||
RUNTIME DESTINATION ${CMAKE_INSTALL_RUNTIMEDIR} COMPONENT METIS_Runtime | ||
) | ||
endif () |
Oops, something went wrong.