From a314ef266c65ca11bbc5e288bd144860df06bcd1 Mon Sep 17 00:00:00 2001 From: Robert Underwood Date: Thu, 20 Feb 2020 12:21:59 -0500 Subject: [PATCH] build fixes to support fortran in CMake --- CMakeLists.txt | 1 + sz.pc.in | 2 +- sz/CMakeLists.txt | 7 +++++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d9e0a937..4fd4014b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -102,6 +102,7 @@ option(BUILD_PASTRI "build the pastri code" OFF) option(BUILD_TIMECMPR "build the time based compression code" OFF) option(BUILD_RANDOMACCESS "build the random access code" OFF) option(BUILD_DOCKER_CONTAINERS "build docker containers for testing" OFF) +option(BUILD_FORTRAN "build the fortran interface" OFF) if(BUILD_DOCKER_CONTAINERS) foreach(CONTAINER Centos Fedora Ubuntu Travis CentosPackaged) diff --git a/sz.pc.in b/sz.pc.in index 77ea8e31..324a8932 100644 --- a/sz.pc.in +++ b/sz.pc.in @@ -1,4 +1,4 @@ -includedir=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_INCLUDEDIR@ +includedir=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_INCLUDEDIR@/sz libdir=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@ Name: SZ diff --git a/sz/CMakeLists.txt b/sz/CMakeLists.txt index 248cfdf8..19ae57db 100644 --- a/sz/CMakeLists.txt +++ b/sz/CMakeLists.txt @@ -85,6 +85,13 @@ endif() if(BUILD_RANDOMACCESS) target_compile_definitions(SZ PUBLIC HAVE_RANDOMACCESS) endif() +if(BUILD_FORTRAN) + enable_language(Fortran) + target_sources(SZ PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/src/rw_interface.F90 + ${CMAKE_CURRENT_SOURCE_DIR}/src/sz_interface.F90 + ) +endif() install (TARGETS SZ ${thirdparty_export} EXPORT SZConfig ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}