Skip to content

Commit

Permalink
Fix minor issues
Browse files Browse the repository at this point in the history
  • Loading branch information
aradi committed Oct 9, 2020
1 parent ddf3dbc commit 79d8ca3
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 11 deletions.
8 changes: 5 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,15 @@ install:

script:
- >
FC=gfortran cmake -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} -B _build .
FC=gfortran cmake -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS}
-DCMAKE_INSTALL_PREFIX=${PWD}/_install
-B _build .
&& cmake --build _build -- -j
&& cmake --install _build
- >
CMAKE_PREFIX_PATH="${PWD}/_build/install:${CMAKE_PREFIX_PATH}"
CMAKE_PREFIX_PATH="${PWD}/_install:${CMAKE_PREFIX_PATH}"
./test/integration/cmake/runtest.sh _build_cmake
- >
PKG_CONFIG_PATH="${PWD}/_build/install/lib/pkgconfig:${PKG_CONFIG_PATH}"
PKG_CONFIG_PATH="${PWD}/_install/lib/pkgconfig:${PKG_CONFIG_PATH}"
FC=mpifort
./test/integration/pkgconfig/runtest.sh _build_pkgconfig
11 changes: 7 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
cmake_minimum_required(VERSION 3.16)

set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
include(CMakePackageConfigHelpers)

list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
include(MpiFxUtils)

include(${CMAKE_CURRENT_SOURCE_DIR}/config.cmake)

project(MpiFx VERSION 0.1 LANGUAGES Fortran)

include(MpiFxUtils)
setup_build_type()

#
Expand All @@ -20,6 +23,8 @@ endif()
#
# Build instructions
#
include(GNUInstallDirs)

add_subdirectory(lib)
if(NOT BUILD_EXPORTED_TARGETS_ONLY)
add_subdirectory(test)
Expand All @@ -37,7 +42,6 @@ install(EXPORT mpifx-targets
NAMESPACE MpiFx::
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/mpifx")

include(CMakePackageConfigHelpers)
configure_package_config_file(
${CMAKE_CURRENT_SOURCE_DIR}/utils/export/mpifx-config.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/cmake/mpifx-config.cmake
Expand All @@ -53,7 +57,6 @@ install(
${CMAKE_CURRENT_BINARY_DIR}/cmake/mpifx-config-version.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/mpifx)

include(GNUInstallDirs)
GNUInstallDirs_get_absolute_install_dir(CMAKE_INSTALL_FULL_MODULEDIR CMAKE_INSTALL_MODULEDIR)

get_pkgconfig_params(PKGCONFIG_REQUIRES PKGCONFIG_LIBS PKGCONFIG_LIBS_PRIVATE PKGCONFIG_C_FLAGS)
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ Prerequisites

* MPI-library and wrappers for your compiler

* `Fypp preprocessor <https://github.com/aradi/fypp>`_.
* `Fypp preprocessor <https://github.com/aradi/fypp>`_


Building and installing the library
-----------------------------------

The library can be built and installed with the usual CMake-workflow::

FC=gfortran cmake -B _build
FC=gfortran cmake -B _build -DCMAKE_INSTALL_PREFIX=$HOME/opt/mpifx
cmake --build _build
cmake --install _build

Expand Down
4 changes: 2 additions & 2 deletions config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ option(BUILD_SHARED_LIBS "Whether the library should be a shared one" FALSE)

option(INSTALL_INCLUDE_FILES "Whether include / module files should be installed" TRUE)

set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install" CACHE STRING
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/_install" CACHE STRING
"Directory to install the compiled code into")

set(CMAKE_INSTALL_LIBDIR "lib" CACHE PATH "Installation directory for libraries")
#set(CMAKE_INSTALL_LIBDIR "lib" CACHE PATH "Installation directory for libraries")

set(CMAKE_INSTALL_INCLUDEDIR "include/mpifx" CACHE PATH
"Installation directory for header and include files")
Expand Down

0 comments on commit 79d8ca3

Please sign in to comment.