ThirdPartyMetis.cmake 1.21 KB
Newer Older
1
SET(THIRDPARTY_BUILD_METIS ON CACHE BOOL
2 3 4 5 6
    "Build ModMetis library from ThirdParty")

IF (THIRDPARTY_BUILD_METIS)
    INCLUDE(ExternalProject)
    EXTERNALPROJECT_ADD(
7
        modmetis-5.1.0
8
        PREFIX ${TPSRC}
Dave Moxey's avatar
Dave Moxey committed
9
        URL ${TPURL}/modmetis-5.1.0_2.tar.bz2
10
        URL_MD5 "8a1f1afd39b46a4477c1ea15464cdf89"
11
        STAMP_DIR ${TPBUILD}/stamp
12
        DOWNLOAD_DIR ${TPSRC}
13 14 15 16
        SOURCE_DIR ${TPSRC}/modmetis-5.1.0
        BINARY_DIR ${TPBUILD}/modmetis-5.1.0
        TMP_DIR ${TPBUILD}/modmetis-5.1.0-tmp
        INSTALL_DIR ${TPDIST}
17 18 19
        CONFIGURE_COMMAND ${CMAKE_COMMAND}
            -DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER}
            -DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER}
20
            -DCMAKE_INSTALL_PREFIX:PATH=${TPDIST}
21
            -DCMAKE_C_FLAGS:STRING=-fPIC
22 23
            -DGKLIB_PATH:PATH=${TPSRC}/modmetis-5.1.0/GKlib
            ${TPSRC}/modmetis-5.1.0
24
    )
25
    SET(METIS_LIB metis CACHE FILEPATH
26
        "METIS library" FORCE)
27
    MARK_AS_ADVANCED(METIS_LIB)
28 29 30
    LINK_DIRECTORIES(${TPDIST}/lib)
    INCLUDE_DIRECTORIES(${TPDIST}/include)
    MESSAGE(STATUS "Build Metis: ${TPDIST}/lib/lib${METIS_LIB}.a")
31 32 33 34
ELSE (THIRDPARTY_BUILD_METIS)
    INCLUDE (FindMetis)
ENDIF (THIRDPARTY_BUILD_METIS)