Skip to content

Commit

Permalink
Make source headers consistent (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
aradi committed Feb 25, 2024
1 parent 4b692d6 commit 7938c81
Show file tree
Hide file tree
Showing 19 changed files with 100 additions and 24 deletions.
56 changes: 32 additions & 24 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# This file is part of Fortuno.
# Licensed under the BSD-2-Clause Plus Patent license.
# SPDX-License-Identifier: BSD-2-Clause-Patent

# The CMake config files were created based on the public template at
# https://github.com/LecrisUT/CMake-Template


#[=================================================================================================[
# Basic project definition #
]=================================================================================================]
Expand Down Expand Up @@ -41,7 +49,7 @@ list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
include(FortunoHelpers)

if (FORTUNO_INSTALL)
include(CMakePackageConfigHelpers)
include(CMakePackageConfigHelpers)
include(GNUInstallDirs)
endif ()

Expand All @@ -51,10 +59,10 @@ set(BUILD_SHARED_LIBS ${FORTUNO_BUILD_SHARED_LIBS})
# Report configuration
feature_summary(
FILENAME ${CMAKE_CURRENT_BINARY_DIR}/Fortuno.info
VAR Fortuno_Info
DESCRIPTION "Fortuno features and external libraries"
FATAL_ON_MISSING_REQUIRED_PACKAGES
WHAT ALL
VAR Fortuno_Info
DESCRIPTION "Fortuno features and external libraries"
FATAL_ON_MISSING_REQUIRED_PACKAGES
WHAT ALL
)
message(STATUS ${Fortuno_Info})

Expand Down Expand Up @@ -86,16 +94,16 @@ endif ()

if (FORTUNO_INSTALL)

# pkg-config files
configure_file(cmake/fortuno.pc.in fortuno.pc @ONLY)
install(
# pkg-config files
configure_file(cmake/fortuno.pc.in fortuno.pc @ONLY)
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/fortuno.pc
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
COMPONENT Fortuno_development
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
COMPONENT Fortuno_development
)

# cmake export files
write_basic_package_version_file(
write_basic_package_version_file(
${CMAKE_CURRENT_BINARY_DIR}/FortunoConfigVersion.cmake
VERSION ${PROJECT_VERSION}
# COMPATIBILITY SameMajorVersion
Expand Down Expand Up @@ -131,21 +139,21 @@ endif ()
# Make project available for FetchContent
if (NOT PROJECT_IS_TOP_LEVEL)
# Propagate variables
if (CMAKE_VERSION VERSION_LESS 3.25)
# TODO: Remove when required minimum cmake version is >= 3.25
set(Fortuno_VERSION ${Fortuno_VERSION} PARENT_SCOPE)
set(Fortuno_VERSION_MAJOR ${Fortuno_VERSION_MAJOR} PARENT_SCOPE)
set(Fortuno_VERSION_MINOR ${Fortuno_VERSION_MINOR} PARENT_SCOPE)
set(Fortuno_VERSION_PATCH ${Fortuno_VERSION_PATCH} PARENT_SCOPE)
set(Fortuno_VERSION_TWEAK ${Fortuno_VERSION_TWEAK} PARENT_SCOPE)
else ()
return(
if (CMAKE_VERSION VERSION_LESS 3.25)
# TODO: Remove when required minimum cmake version is >= 3.25
set(Fortuno_VERSION ${Fortuno_VERSION} PARENT_SCOPE)
set(Fortuno_VERSION_MAJOR ${Fortuno_VERSION_MAJOR} PARENT_SCOPE)
set(Fortuno_VERSION_MINOR ${Fortuno_VERSION_MINOR} PARENT_SCOPE)
set(Fortuno_VERSION_PATCH ${Fortuno_VERSION_PATCH} PARENT_SCOPE)
set(Fortuno_VERSION_TWEAK ${Fortuno_VERSION_TWEAK} PARENT_SCOPE)
else ()
return(
PROPAGATE
Fortuno_VERSION
Fortuno_VERSION_MAJOR
Fortuno_VERSION_MINOR
Fortuno_VERSION_PATCH
Fortuno_VERSION_TWEAK
)
endif ()
Fortuno_VERSION_PATCH
Fortuno_VERSION_TWEAK
)
endif ()
endif ()
4 changes: 4 additions & 0 deletions cmake/FortunoHelpers.cmake
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# This file is part of Fortuno.
# Licensed under the BSD-2-Clause Plus Patent license.
# SPDX-License-Identifier: BSD-2-Clause-Patent

# Sets up the build type.
function (fortuno_setup_build_type default_build_type)

Expand Down
Empty file removed cmake/config.cmake
Empty file.
4 changes: 4 additions & 0 deletions example/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# This file is part of Fortuno.
# Licensed under the BSD-2-Clause Plus Patent license.
# SPDX-License-Identifier: BSD-2-Clause-Patent

list(APPEND CMAKE_MESSAGE_CONTEXT Example)

add_library(Fortuno_example_mylib)
Expand Down
4 changes: 4 additions & 0 deletions example/meson.build
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# This file is part of Fortuno.
# Licensed under the BSD-2-Clause Plus Patent license.
# SPDX-License-Identifier: BSD-2-Clause-Patent

example_mylib_lib = library(
'mylib',
sources: ['mylib.f90'],
Expand Down
4 changes: 4 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# This file is part of Fortuno.
# Licensed under the BSD-2-Clause Plus Patent license.
# SPDX-License-Identifier: BSD-2-Clause-Patent

project(
'fortuno',
'fortran',
Expand Down
4 changes: 4 additions & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
# This file is part of Fortuno.
# Licensed under the BSD-2-Clause Plus Patent license.
# SPDX-License-Identifier: BSD-2-Clause-Patent

option('build_examples', type: 'boolean', value: false, description: 'Build examples')
4 changes: 4 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# This file is part of Fortuno.
# Licensed under the BSD-2-Clause Plus Patent license.
# SPDX-License-Identifier: BSD-2-Clause-Patent

target_sources(
Fortuno PRIVATE
fortuno.f90
Expand Down
4 changes: 4 additions & 0 deletions src/fortuno/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# This file is part of Fortuno.
# Licensed under the BSD-2-Clause Plus Patent license.
# SPDX-License-Identifier: BSD-2-Clause-Patent

target_sources(
Fortuno PRIVATE
argumentparser.f90
Expand Down
4 changes: 4 additions & 0 deletions src/fortuno/meson.build
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# This file is part of Fortuno.
# Licensed under the BSD-2-Clause Plus Patent license.
# SPDX-License-Identifier: BSD-2-Clause-Patent

sources += files(
'argumentparser.f90',
'basetypes.f90',
Expand Down
4 changes: 4 additions & 0 deletions src/fortuno/serial/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# This file is part of Fortuno.
# Licensed under the BSD-2-Clause Plus Patent license.
# SPDX-License-Identifier: BSD-2-Clause-Patent

target_sources(
Fortuno PRIVATE
serialbasetypes.f90
Expand Down
4 changes: 4 additions & 0 deletions src/fortuno/serial/meson.build
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# This file is part of Fortuno.
# Licensed under the BSD-2-Clause Plus Patent license.
# SPDX-License-Identifier: BSD-2-Clause-Patent

sources += files(
'serialbasetypes.f90',
'serialcase.f90',
Expand Down
4 changes: 4 additions & 0 deletions src/meson.build
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# This file is part of Fortuno.
# Licensed under the BSD-2-Clause Plus Patent license.
# SPDX-License-Identifier: BSD-2-Clause-Patent

sources += files(
'fortuno.f90'
)
Expand Down
4 changes: 4 additions & 0 deletions test/export/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# This file is part of Fortuno.
# Licensed under the BSD-2-Clause Plus Patent license.
# SPDX-License-Identifier: BSD-2-Clause-Patent

cmake_minimum_required(VERSION 3.22...3.28)

project(
Expand Down
4 changes: 4 additions & 0 deletions test/export/app/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
# This file is part of Fortuno.
# Licensed under the BSD-2-Clause Plus Patent license.
# SPDX-License-Identifier: BSD-2-Clause-Patent

target_sources(testapp PRIVATE testapp.f90)
target_link_libraries(testapp PRIVATE Fortuno::Fortuno)
4 changes: 4 additions & 0 deletions test/export/app/meson.build
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# This file is part of Fortuno.
# Licensed under the BSD-2-Clause Plus Patent license.
# SPDX-License-Identifier: BSD-2-Clause-Patent

sources += files(
'testapp.f90'
)
4 changes: 4 additions & 0 deletions test/export/app/testapp.f90
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
! This file is part of Fortuno.
! Licensed under the BSD-2-Clause Plus Patent license.
! SPDX-License-Identifier: BSD-2-Clause-Patent

!> Test app driving Fortuno unit tests.
program testapp
use fortuno, only : execute_serial_cmd_app, is_equal, test => serial_case_item,&
Expand Down
4 changes: 4 additions & 0 deletions test/export/meson.build
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# This file is part of Fortuno.
# Licensed under the BSD-2-Clause Plus Patent license.
# SPDX-License-Identifier: BSD-2-Clause-Patent

project(
'fortuno_test_export',
'fortran',
Expand Down
4 changes: 4 additions & 0 deletions test/export/meson_options.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# This file is part of Fortuno.
# Licensed under the BSD-2-Clause Plus Patent license.
# SPDX-License-Identifier: BSD-2-Clause-Patent

option(
'fortuno_subproject',
type: 'boolean',
Expand Down

0 comments on commit 7938c81

Please sign in to comment.