Commit 39d7363d authored by Praetorius, Simon's avatar Praetorius, Simon

Merge branch 'feature/debian_package' into 'master'

Feature/debian package

See merge request !20
parents c39480e2 80714787
Pipeline #685 canceled with stages
in 44 minutes and 12 seconds
...@@ -5,7 +5,6 @@ stages: ...@@ -5,7 +5,6 @@ stages:
- build - build
- demo - demo
- test - test
- package
# compile amdis # compile amdis
...@@ -19,7 +18,7 @@ build:9-debug-gcc: ...@@ -19,7 +18,7 @@ build:9-debug-gcc:
name: "$CI_BUILD_NAME" name: "$CI_BUILD_NAME"
expire_in: 6 hrs expire_in: 6 hrs
only: only:
- develop - master
build:9-release-gcc: build:9-release-gcc:
stage: build stage: build
...@@ -31,7 +30,7 @@ build:9-release-gcc: ...@@ -31,7 +30,7 @@ build:9-release-gcc:
name: "$CI_BUILD_NAME" name: "$CI_BUILD_NAME"
expire_in: 6 hrs expire_in: 6 hrs
only: only:
- develop - master
build:9-parallel-debug-gcc: build:9-parallel-debug-gcc:
stage: build stage: build
...@@ -43,7 +42,7 @@ build:9-parallel-debug-gcc: ...@@ -43,7 +42,7 @@ build:9-parallel-debug-gcc:
name: "$CI_BUILD_NAME" name: "$CI_BUILD_NAME"
expire_in: 6 hrs expire_in: 6 hrs
only: only:
- develop - master
build:9-parallel-release-gcc: build:9-parallel-release-gcc:
stage: build stage: build
...@@ -55,7 +54,7 @@ build:9-parallel-release-gcc: ...@@ -55,7 +54,7 @@ build:9-parallel-release-gcc:
name: "$CI_BUILD_NAME" name: "$CI_BUILD_NAME"
expire_in: 6 hrs expire_in: 6 hrs
only: only:
- develop - master
# compile the demos # compile the demos
...@@ -66,7 +65,7 @@ demo:9-debug-gcc: ...@@ -66,7 +65,7 @@ demo:9-debug-gcc:
dependencies: dependencies:
- build:9-debug-gcc - build:9-debug-gcc
only: only:
- develop - master
demo:9-release-gcc: demo:9-release-gcc:
stage: demo stage: demo
...@@ -75,7 +74,7 @@ demo:9-release-gcc: ...@@ -75,7 +74,7 @@ demo:9-release-gcc:
dependencies: dependencies:
- build:9-release-gcc - build:9-release-gcc
only: only:
- develop - master
demo:9-parallel-debug-gcc: demo:9-parallel-debug-gcc:
stage: demo stage: demo
...@@ -84,7 +83,7 @@ demo:9-parallel-debug-gcc: ...@@ -84,7 +83,7 @@ demo:9-parallel-debug-gcc:
dependencies: dependencies:
- build:9-parallel-debug-gcc - build:9-parallel-debug-gcc
only: only:
- develop - master
demo:9-parallel-release-gcc: demo:9-parallel-release-gcc:
stage: demo stage: demo
...@@ -93,7 +92,7 @@ demo:9-parallel-release-gcc: ...@@ -93,7 +92,7 @@ demo:9-parallel-release-gcc:
dependencies: dependencies:
- build:9-parallel-release-gcc - build:9-parallel-release-gcc
only: only:
- develop - master
# compiel and run the tests # compiel and run the tests
...@@ -104,7 +103,7 @@ test:9-debug-gcc: ...@@ -104,7 +103,7 @@ test:9-debug-gcc:
dependencies: dependencies:
- build:9-debug-gcc - build:9-debug-gcc
only: only:
- develop - master
test:9-release-gcc: test:9-release-gcc:
stage: test stage: test
...@@ -113,7 +112,7 @@ test:9-release-gcc: ...@@ -113,7 +112,7 @@ test:9-release-gcc:
dependencies: dependencies:
- build:9-release-gcc - build:9-release-gcc
only: only:
- develop - master
test:9-parallel-debug-gcc: test:9-parallel-debug-gcc:
stage: test stage: test
...@@ -122,7 +121,7 @@ test:9-parallel-debug-gcc: ...@@ -122,7 +121,7 @@ test:9-parallel-debug-gcc:
dependencies: dependencies:
- build:9-parallel-debug-gcc - build:9-parallel-debug-gcc
only: only:
- develop - master
test:9-parallel-release-gcc: test:9-parallel-release-gcc:
stage: test stage: test
...@@ -131,47 +130,4 @@ test:9-parallel-release-gcc: ...@@ -131,47 +130,4 @@ test:9-parallel-release-gcc:
dependencies: dependencies:
- build:9-parallel-release-gcc - build:9-parallel-release-gcc
only: only:
- develop
# compiel and run the tests
package:9-debug-gcc:
stage: package
script:
- cmake -DCONFIG=Debug -DCOMPONENT=SEQUENTIAL -P tools/packaging/debian/create_package.cmake
artifacts:
paths:
- debian_package/amdis-dbg/amdis*.deb
only:
- master - master
package:9-release-gcc:
stage: package
script:
- cmake -DCONFIG=Release -DCOMPONENT=SEQUENTIAL -P tools/packaging/debian/create_package.cmake
artifacts:
paths:
- debian_package/amdis/amdis*.deb
only:
- master
package:9-parallel-debug-gcc:
stage: package
script:
- cmake -DCONFIG=Debug -DCOMPONENT=PARALLEL -P tools/packaging/debian/create_package.cmake
artifacts:
paths:
- debian_package/amdis-dbg/amdis-par-dbg*.deb
only:
- master
package:9-parallel-release-gcc:
stage: package
script:
- cmake -DCONFIG=Release -DCOMPONENT=PARALLEL -P tools/packaging/debian/create_package.cmake
artifacts:
paths:
- debian_package/amdis-dbg/amdis-par*.deb
only:
- master
...@@ -8,8 +8,8 @@ set(BASE_DIR ${AMDiS_SOURCE_DIR}) ...@@ -8,8 +8,8 @@ set(BASE_DIR ${AMDiS_SOURCE_DIR})
set(SOURCE_DIR ${BASE_DIR}/src) set(SOURCE_DIR ${BASE_DIR}/src)
if (NOT CMAKE_BUILD_TYPE) if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Debug CACHE STRING set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." "Choose the type of build, options are: None Debug Release [RelWithDebInfo] MinSizeRel."
FORCE) FORCE)
endif () endif ()
......
...@@ -243,6 +243,7 @@ endforeach () ...@@ -243,6 +243,7 @@ endforeach ()
file(GLOB CMAKE_MACROS "${BASE_DIR}/cmake/enable_*.cmake") file(GLOB CMAKE_MACROS "${BASE_DIR}/cmake/enable_*.cmake")
install(FILES ${CMAKE_MACROS} DESTINATION share/amdis/) install(FILES ${CMAKE_MACROS} DESTINATION share/amdis/)
install(FILES ${BASE_DIR}/cmake3/parse_zoltan_makefile.cmake DESTINATION share/amdis/)
install(DIRECTORY ${BASE_DIR}/lib/mtl4/ DESTINATION include/amdis/mtl4/ install(DIRECTORY ${BASE_DIR}/lib/mtl4/ DESTINATION include/amdis/mtl4/
FILES_MATCHING PATTERN "*.hpp" FILES_MATCHING PATTERN "*.hpp"
......
...@@ -61,7 +61,8 @@ macro(enable_petsc _FLAGS_ _INC_DIRS_ _LIBS_) ...@@ -61,7 +61,8 @@ macro(enable_petsc _FLAGS_ _INC_DIRS_ _LIBS_)
# if not valid, search again # if not valid, search again
if (NOT PETSC_VALID) if (NOT PETSC_VALID)
find_package(PETSc REQUIRED) message(WARNING " ---> pkg-config of PETSc is broken!")
find_package(PETSc REQUIRED CXX)
set(PETSC_INCLUDE_DIRS ${PETSC_INCLUDES}) set(PETSC_INCLUDE_DIRS ${PETSC_INCLUDES})
set(PETSC_LIBRARY_DIRS ${PETSC_LIB_DIR}) set(PETSC_LIBRARY_DIRS ${PETSC_LIB_DIR})
message(STATUS " Found PETSc, version ${PETSC_VERSION}") message(STATUS " Found PETSc, version ${PETSC_VERSION}")
......
...@@ -9,12 +9,21 @@ macro(enable_png _FLAGS_ _INC_DIRS_ _LIBS_) ...@@ -9,12 +9,21 @@ macro(enable_png _FLAGS_ _INC_DIRS_ _LIBS_)
HINTS ENV CPATH /usr/include HINTS ENV CPATH /usr/include
DOC "headerfile png.h for PNG-READER") DOC "headerfile png.h for PNG-READER")
if (_PNG_H) if (NOT _PNG_H)
get_filename_component(PNG_PATH ${_PNG_H} PATH)
list(APPEND ${_INC_DIRS_} ${PNG_PATH})
else()
message(FATAL_ERROR "Could not find the PNG header png.h.") message(FATAL_ERROR "Could not find the PNG header png.h.")
endif() else ()
file(STRINGS ${_PNG_H} PNG_VERSION_LINE REGEX "#define PNG_LIBPNG_VER_STRING")
string(REGEX MATCH "\"([0-9]+[.][0-9]+([.][0-9]+)?)\"" PNG_VERSION_LINE ${PNG_VERSION_LINE})
set(PNG_VERSION ${CMAKE_MATCH_1})
message(STATUS "Libpng version: ${PNG_VERSION}")
if (NOT PNG_VERSION VERSION_LESS "1.6" OR NOT PNG_VERSION VERSION_GREATER "1.2")
message(FATAL_ERROR "Incompatible libpng version. Requires 1.2.x")
endif ()
endif ()
get_filename_component(PNG_PATH ${_PNG_H} PATH)
list(APPEND ${_INC_DIRS_} ${PNG_PATH})
if (LINK_EXECUTABLE) if (LINK_EXECUTABLE)
find_library(_PNG_LIB png find_library(_PNG_LIB png
......
include(parse_zoltan_makefile)
macro(enable_zoltan _FLAGS_ _INC_DIRS_ _LIBS_) macro(enable_zoltan _FLAGS_ _INC_DIRS_ _LIBS_)
if (${ARGC} GREATER 3) if (${ARGC} GREATER 3)
set(LINK_EXECUTABLE ON) set(LINK_EXECUTABLE ON)
...@@ -5,22 +6,55 @@ macro(enable_zoltan _FLAGS_ _INC_DIRS_ _LIBS_) ...@@ -5,22 +6,55 @@ macro(enable_zoltan _FLAGS_ _INC_DIRS_ _LIBS_)
set(LINK_EXECUTABLE OFF) set(LINK_EXECUTABLE OFF)
endif () endif ()
find_file(ZOLTAN_HEADER_FILE "zoltan_cpp.h" HINTS ${ZOLTAN_DIR}/include ${PETSC_INCLUDE_DIRS}) find_package(Zoltan QUIET)
if (ZOLTAN_HEADER_FILE) if (Zoltan_FOUND)
get_filename_component(ZOLTAN_HEADER_DIR "${ZOLTAN_HEADER_FILE}" PATH CACHE) find_file(ZOLTAN_HEADER_FILE "zoltan.h" PATHS ${Zoltan_INCLUDE_DIRS})
list(APPEND ${_INC_DIRS_} ${ZOLTAN_HEADER_DIR}) list(APPEND ${_INC_DIRS_} ${Zoltan_INCLUDE_DIRS})
else()
message(FATAL_ERROR "Could not find Zoltan include file 'zoltan_cpp.h'!") if (LINK_EXECUTABLE)
endif(ZOLTAN_HEADER_FILE) foreach (LIB_NAME ${Zoltan_LIBRARIES})
find_library(_ZOLTAN_LIB ${LIB_NAME} HINTS ${Zoltan_LIBRARY_DIRS})
if (NOT _ZOLTAN_LIB)
message(FATAL_ERROR "Could not find library \"${LIB_NAME}\" in directories ${Zoltan_LIBRARY_DIRS}!")
else ()
list(APPEND ${_LIBS_} ${_ZOLTAN_LIB})
endif ()
unset(_ZOLTAN_LIB CACHE)
endforeach(LIB_NAME)
endif (LINK_EXECUTABLE)
else (Zoltan_FOUND)
find_file(ZOLTAN_HEADER_FILE "zoltan.h" HINTS ${ZOLTAN_DIR}/include ${PETSC_INCLUDE_DIRS})
if (ZOLTAN_HEADER_FILE)
get_filename_component(ZOLTAN_HEADER_DIR "${ZOLTAN_HEADER_FILE}" PATH CACHE)
list(APPEND ${_INC_DIRS_} ${ZOLTAN_HEADER_DIR})
else()
message(FATAL_ERROR "Could not find Zoltan include file 'zoltan_cpp.h'!")
endif(ZOLTAN_HEADER_FILE)
if (LINK_EXECUTABLE)
find_library(ZOLTAN_LIB zoltan
HINTS ENV LIBRARY_PATH DOC "Full path to the zoltan library")
if (NOT ZOLTAN_LIB)
message(FATAL_ERROR "Could not find zoltan library!")
endif (NOT ZOLTAN_LIB)
list(APPEND ${_LIBS_} ${ZOLTAN_LIB})
if (LINK_EXECUTABLE) find_file(ZOLTAN_CONFIG_FILE "Makefile.export.zoltan" HINTS ${ZOLTAN_HEADER_DIR})
find_library(ZOLTAN_LIB zoltan if (ZOLTAN_CONFIG_FILE)
HINTS ENV LIBRARY_PATH DOC "Full path to the zoltan library") parse_zoltan_makefile(${ZOLTAN_CONFIG_FILE} ${_TARGET_} ${_SCOPE_})
if (NOT ZOLTAN_LIB) else ()
message(FATAL_ERROR "Could not find zoltan library!") message(WARNING "Zoltan configuration file Makefile.export.zoltan not found!")
endif (NOT ZOLTAN_LIB) endif ()
list(APPEND ${_LIBS_} ${ZOLTAN_LIB}) endif (LINK_EXECUTABLE)
endif (LINK_EXECUTABLE) endif (Zoltan_FOUND)
if (ZOLTAN_HEADER_FILE)
file(STRINGS ${ZOLTAN_HEADER_FILE} ZOLTAN_VERSION_LINE REGEX "#define ZOLTAN_VERSION_NUMBER")
string(REGEX MATCH "([0-9]+[.][0-9]+)" ZOLTAN_VERSION_REGEX ${ZOLTAN_VERSION_LINE})
set(ZOLTAN_VERSION ${CMAKE_MATCH_1})
unset(ZOLTAN_HEADER_FILE CACHE)
message(STATUS "Zoltan version: ${ZOLTAN_VERSION}")
endif (ZOLTAN_HEADER_FILE)
list(APPEND ${_FLAGS_} "-DHAVE_ZOLTAN=1") list(APPEND ${_FLAGS_} "-DHAVE_ZOLTAN=1")
endmacro(enable_zoltan) endmacro(enable_zoltan)
macro(parse_zoltan_makefile _FILE_ _LIBS_)
file(STRINGS ${_FILE_} ZOLTAN_MAKEFILE_LINE REGEX "ZOLTAN_EXTRA_LIBS")
get_filename_component(ZOLTAN_MAKEFILE_DIR "${ZOLTAN_MAKEFILE}" PATH CACHE)
string(STRIP "${ZOLTAN_MAKEFILE_LINE}" LINE)
if ("${LINE}" MATCHES "^ZOLTAN_EXTRA_LIBS[ ]*=[ ]*([a-zA-Z0-9_/. -]+)$")
string(REGEX REPLACE " " ";" ZOLTAN_EXTRA_LIBS_LIST "${CMAKE_MATCH_1}")
set(ZOLTAN_LIB_DIRS "")
foreach(LIBS ${ZOLTAN_EXTRA_LIBS_LIST})
string(STRIP "${LIBS}" LIBS)
string(SUBSTRING "${LIBS}" 0 2 LIB_PREFIX)
string(SUBSTRING "${LIBS}" 2 -1 LIB_NAME)
if ("${LIB_PREFIX}" STREQUAL "-L")
list(APPEND ZOLTAN_LIB_DIRS ${LIB_NAME})
elseif ("${LIB_PREFIX}" STREQUAL "-l")
find_library(_ZOLTAN_EXTERN_LIB ${LIB_NAME} HINTS ${ZOLTAN_LIB_DIRS})
if (NOT _ZOLTAN_EXTERN_LIB)
message(FATAL_ERROR "Could not find library \"${LIB_NAME}\" in directories ${ZOLTAN_LIB_DIRS}!")
else ()
list(APPEND ${_LIBS_} ${_ZOLTAN_EXTERN_LIB})
endif ()
unset(_ZOLTAN_EXTERN_LIB CACHE)
else ()
message(WARNING "Unknown link parameter \"${LIBS}\"")
endif ()
endforeach (LIBS)
endif()
endmacro(parse_zoltan_makefile)
...@@ -181,6 +181,9 @@ endif (AMDIS_HAS_PARALLEL_DOMAIN) ...@@ -181,6 +181,9 @@ endif (AMDIS_HAS_PARALLEL_DOMAIN)
# Zoltan library # Zoltan library
# -------------- # --------------
if (AMDIS_NEED_ZOLTAN) if (AMDIS_NEED_ZOLTAN)
if (NOT DEFINED ZOLTAN_DIR)
set(ZOLTAN_DIR "@ZOLTAN_DIR@")
endif ()
target_enable_zoltan(amdis_base INTERFACE ON) target_enable_zoltan(amdis_base INTERFACE ON)
endif () endif ()
......
...@@ -210,6 +210,7 @@ endforeach () ...@@ -210,6 +210,7 @@ endforeach ()
file(GLOB CMAKE_MACROS "${BASE_DIR}/cmake3/target_enable_*.cmake") file(GLOB CMAKE_MACROS "${BASE_DIR}/cmake3/target_enable_*.cmake")
install(FILES ${CMAKE_MACROS} DESTINATION share/amdis/) install(FILES ${CMAKE_MACROS} DESTINATION share/amdis/)
install(FILES ${BASE_DIR}/cmake3/parse_zoltan_makefile.cmake DESTINATION share/amdis/)
install(DIRECTORY ${BASE_DIR}/lib/mtl4/ DESTINATION include/amdis/mtl4/ install(DIRECTORY ${BASE_DIR}/lib/mtl4/ DESTINATION include/amdis/mtl4/
FILES_MATCHING PATTERN "*.hpp" FILES_MATCHING PATTERN "*.hpp"
......
macro(parse_zoltan_makefile _FILE_ _TARGET_ _SCOPE_)
# parse zoltan extra libs AND ld flags
file(STRINGS ${_FILE_} ZOLTAN_EXTRA_LIBS_LINE REGEX "ZOLTAN_EXTRA_LIBS")
file(STRINGS ${_FILE_} ZOLTAN_LDFLAGS_LINE REGEX "ZOLTAN_LDFLAGS")
get_filename_component(ZOLTAN_MAKEFILE_DIR "${ZOLTAN_MAKEFILE}" PATH CACHE)
string(STRIP "${ZOLTAN_EXTRA_LIBS_LINE}" ZOLTAN_EXTRA_LIBS_LINE)
string(STRIP "${ZOLTAN_LDFLAGS_LINE}" ZOLTAN_LDFLAGS_LINE)
if ("${ZOLTAN_EXTRA_LIBS_LINE}" MATCHES "^ZOLTAN_EXTRA_LIBS[ ]*=[ ]*([a-zA-Z0-9_/. -]+)*$")
string(REGEX REPLACE " " ";" ZOLTAN_EXTRA_LIBS_LIST "${CMAKE_MATCH_1}")
if ("${ZOLTAN_LDFLAGS_LINE}" MATCHES "^ZOLTAN_LDFLAGS[ ]*=[ ]*([a-zA-Z0-9_/. -]+)*$")
string(REGEX REPLACE " " ";" ZOLTAN_LDFLAGS_LIST "${CMAKE_MATCH_1}")
set(COMBINED_LIST ${ZOLTAN_LDFLAGS_LIST} ${ZOLTAN_EXTRA_LIBS_LIST})
set(ZOLTAN_LIB_DIRS "")
foreach(LIBS ${COMBINED_LIST})
string(STRIP "${LIBS}" LIBS)
string(SUBSTRING "${LIBS}" 0 2 LIB_PREFIX)
string(SUBSTRING "${LIBS}" 2 -1 LIB_NAME)
if ("${LIB_PREFIX}" STREQUAL "-L")
list(APPEND ZOLTAN_LIB_DIRS ${LIB_NAME})
elseif ("${LIB_PREFIX}" STREQUAL "-l")
find_library(_ZOLTAN_EXTERN_LIB ${LIB_NAME} HINTS ${ZOLTAN_LIB_DIRS})
if (NOT _ZOLTAN_EXTERN_LIB)
message(FATAL_ERROR "Could not find library \"${LIB_NAME}\" in directories ${ZOLTAN_LIB_DIRS}!")
else ()
target_link_libraries(${_TARGET_} ${_SCOPE_} ${_ZOLTAN_EXTERN_LIB})
endif ()
unset(_ZOLTAN_EXTERN_LIB CACHE)
else ()
message(WARNING "Unknown link parameter \"${LIBS}\"")
endif ()
endforeach (LIBS)
endif()
endif()
endmacro(parse_zoltan_makefile)
...@@ -61,7 +61,8 @@ macro(target_enable_petsc _TARGET_ _SCOPE_) ...@@ -61,7 +61,8 @@ macro(target_enable_petsc _TARGET_ _SCOPE_)
# if not valid, search again # if not valid, search again
if (NOT PETSC_VALID) if (NOT PETSC_VALID)
find_package(PETSc REQUIRED) message(WARNING " ---> pkg-config of PETSc is broken!")
find_package(PETSc REQUIRED CXX)
set(PETSC_INCLUDE_DIRS ${PETSC_INCLUDES}) set(PETSC_INCLUDE_DIRS ${PETSC_INCLUDES})
set(PETSC_LIBRARY_DIRS ${PETSC_LIB_DIR}) set(PETSC_LIBRARY_DIRS ${PETSC_LIB_DIR})
message(STATUS " Found PETSc, version ${PETSC_VERSION}") message(STATUS " Found PETSc, version ${PETSC_VERSION}")
......
...@@ -9,12 +9,21 @@ macro(target_enable_png _TARGET_ _SCOPE_) ...@@ -9,12 +9,21 @@ macro(target_enable_png _TARGET_ _SCOPE_)
HINTS ENV CPATH /usr/include HINTS ENV CPATH /usr/include
DOC "headerfile png.h for PNG-READER") DOC "headerfile png.h for PNG-READER")
if (_PNG_H) if (NOT _PNG_H)
get_filename_component(PNG_PATH ${_PNG_H} PATH)
target_include_directories(${_TARGET_} ${_SCOPE_} ${PNG_PATH})
else()
message(FATAL_ERROR "Could not find the PNG header png.h.") message(FATAL_ERROR "Could not find the PNG header png.h.")
endif() else ()
file(STRINGS ${_PNG_H} PNG_VERSION_LINE REGEX "#define PNG_LIBPNG_VER_STRING")
string(REGEX MATCH "\"([0-9]+[.][0-9]+([.][0-9]+)?)\"" PNG_VERSION_LINE ${PNG_VERSION_LINE})
set(PNG_VERSION ${CMAKE_MATCH_1})
message(STATUS "Libpng version: ${PNG_VERSION}")
if (NOT PNG_VERSION VERSION_LESS "1.6" OR NOT PNG_VERSION VERSION_GREATER "1.2")
message(FATAL_ERROR "Incompatible libpng version. Requires 1.2.x")
endif ()
endif ()
get_filename_component(PNG_PATH ${_PNG_H} PATH)
target_include_directories(${_TARGET_} ${_SCOPE_} ${PNG_PATH})
if (LINK_EXECUTABLE) if (LINK_EXECUTABLE)
find_library(_PNG_LIB png find_library(_PNG_LIB png
......
include(parse_zoltan_makefile)
macro(target_enable_zoltan _TARGET_ _SCOPE_) macro(target_enable_zoltan _TARGET_ _SCOPE_)
if (${ARGC} GREATER 2) if (${ARGC} GREATER 2)
set(LINK_EXECUTABLE ON) set(LINK_EXECUTABLE ON)
...@@ -5,22 +6,55 @@ macro(target_enable_zoltan _TARGET_ _SCOPE_) ...@@ -5,22 +6,55 @@ macro(target_enable_zoltan _TARGET_ _SCOPE_)
set(LINK_EXECUTABLE OFF) set(LINK_EXECUTABLE OFF)
endif () endif ()
find_file(ZOLTAN_HEADER_FILE "zoltan_cpp.h" HINTS ${ZOLTAN_DIR}/include ${PETSC_INCLUDE_DIRS}) find_package(Zoltan QUIET)
if (ZOLTAN_HEADER_FILE) if (Zoltan_FOUND)
get_filename_component(ZOLTAN_HEADER_DIR "${ZOLTAN_HEADER_FILE}" PATH CACHE) find_file(ZOLTAN_HEADER_FILE "zoltan.h" PATHS ${Zoltan_INCLUDE_DIRS})
target_include_directories(${_TARGET_} ${_SCOPE_} ${ZOLTAN_HEADER_DIR}) target_include_directories(${_TARGET_} ${_SCOPE_} ${Zoltan_INCLUDE_DIRS})
else()
message(FATAL_ERROR "Could not find Zoltan include file 'zoltan_cpp.h'!") if (LINK_EXECUTABLE)
endif(ZOLTAN_HEADER_FILE) foreach (LIB_NAME ${Zoltan_LIBRARIES})
find_library(_ZOLTAN_LIB ${LIB_NAME} HINTS ${Zoltan_LIBRARY_DIRS})
if (NOT _ZOLTAN_LIB)
message(FATAL_ERROR "Could not find library \"${LIB_NAME}\" in directories ${Zoltan_LIBRARY_DIRS}!")
else ()
target_link_libraries(${_TARGET_} ${_SCOPE_} ${_ZOLTAN_LIB})
endif ()
unset(_ZOLTAN_LIB CACHE)
endforeach(LIB_NAME)
endif (LINK_EXECUTABLE)
else (Zoltan_FOUND)
find_file(ZOLTAN_HEADER_FILE "zoltan.h" HINTS ${ZOLTAN_DIR}/include ${PETSC_INCLUDE_DIRS})
if (ZOLTAN_HEADER_FILE)
get_filename_component(Zoltan_INCLUDE_DIR "${ZOLTAN_HEADER_FILE}" PATH CACHE)
target_include_directories(${_TARGET_} ${_SCOPE_} ${Zoltan_INCLUDE_DIR})
else()
message(FATAL_ERROR "Could not find Zoltan include file 'zoltan.h'!")
endif(ZOLTAN_HEADER_FILE)
if (LINK_EXECUTABLE)
find_library(ZOLTAN_LIB zoltan
HINTS ${Zoltan_INCLUDE_DIR}/../lib DOC "Full path to the zoltan library")
if (NOT ZOLTAN_LIB)
message(FATAL_ERROR "Could not find zoltan library!")
endif (NOT ZOLTAN_LIB)
target_link_libraries(${_TARGET_} ${_SCOPE_} ${ZOLTAN_LIB})
if (LINK_EXECUTABLE) find_file(ZOLTAN_CONFIG_FILE "Makefile.export.zoltan" HINTS ${Zoltan_INCLUDE_DIR})
find_library(ZOLTAN_LIB zoltan if (ZOLTAN_CONFIG_FILE)
HINTS ENV LIBRARY_PATH DOC "Full path to the zoltan library") parse_zoltan_makefile(${ZOLTAN_CONFIG_FILE} ${_TARGET_} ${_SCOPE_})
if (NOT ZOLTAN_LIB) else ()
message(FATAL_ERROR "Could not find zoltan library!") message(WARNING "Zoltan configuration file Makefile.export.zoltan not found!")
endif (NOT ZOLTAN_LIB)