commit 0abc83b55b3033c8b5c8db55b6e8d74c5c6c1bc9
parent 77b69ca9853e9b5e4223f1725c311644bb626e95
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Mon, 30 Oct 2023 16:00:13 +0100
Remove CMake support
POSIX make is now the only supported build system.
Diffstat:
| D | cmake/CMakeLists.txt | | | 172 | ------------------------------------------------------------------------------- |
| D | cmake/FindNetCDF.cmake | | | 119 | ------------------------------------------------------------------------------- |
2 files changed, 0 insertions(+), 291 deletions(-)
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
@@ -1,172 +0,0 @@
-# Copyright (C) 2018, 2020-2023 |Méso|Star> (contact@meso-star.com)
-# Copyright (C) 2018 Centre National de la Recherche Scientifique
-# Copyright (C) 2018 Université Paul Sabatier
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-cmake_minimum_required(VERSION 3.1)
-project(htmie)
-enable_testing()
-
-option(NO_TEST "Do not build tests" OFF)
-
-set(HTMIE_SOURCE_DIR ${PROJECT_SOURCE_DIR}/../src)
-
-################################################################################
-# Prerequisites
-################################################################################
-get_filename_component(_current_source_dir ${CMAKE_CURRENT_LIST_FILE} PATH)
-set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${_current_source_dir})
-
-find_package(RCMake 0.3 REQUIRED)
-find_package(RSys 0.6 REQUIRED)
-find_package(NetCDF REQUIRED)
-
-set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${RCMAKE_SOURCE_DIR})
-include(rcmake)
-include(rcmake_runtime)
-
-include_directories(
- ${NETCDF_C_INCLUDE_DIRS}
- ${RSys_INCLUDE_DIR})
-
-# Required by the netcdf.h header that in some versions contains C99 comments
-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu89")
-
-if(CMAKE_COMPILER_IS_GNUCC)
- set(MATH_LIB m)
-endif()
-
-################################################################################
-# Configure and define targets
-################################################################################
-set(VERSION_MAJOR 0)
-set(VERSION_MINOR 0)
-set(VERSION_PATCH 4)
-set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH})
-
-set(HTMIE_FILES_SRC htmie.c)
-set(HTMIE_FILES_INC )
-set(HTMIE_FILES_INC_API htmie.h)
-set(HTMIE_FILES_DOC README.md COPYING)
-
-# Prepend each file in the `HTCP_FILES_<SRC|INC>' list by `HTCP_SOURCE_DIR'
-rcmake_prepend_path(HTMIE_FILES_SRC ${HTMIE_SOURCE_DIR})
-rcmake_prepend_path(HTMIE_FILES_INC ${HTMIE_SOURCE_DIR})
-rcmake_prepend_path(HTMIE_FILES_INC_API ${HTMIE_SOURCE_DIR})
-rcmake_prepend_path(HTMIE_FILES_DOC ${PROJECT_SOURCE_DIR}/../)
-
-add_library(htmie SHARED ${HTMIE_FILES_SRC} ${HTMIE_FILES_INC} ${HTMIE_FILES_INC_API})
-target_link_libraries(htmie RSys ${NETCDF_C_LIBRARIES} ${MATH_LIB})
-
-set_target_properties(htmie PROPERTIES
- DEFINE_SYMBOL HTMIE_SHARED_BUILD
- VERSION ${VERSION}
- SOVERSION ${VERSION_MAJOR})
-
-rcmake_setup_devel(htmie HTMIE ${VERSION} high_tune/htmie_version.h)
-
-################################################################################
-# Man pages
-################################################################################
-find_program(SCDOC NAMES scdoc)
-if(NOT SCDOC)
- message(WARNING
- "The `scdoc' program is missing. "
- "The High-Tune Mie man page cannot be generated.")
-else()
- set(_src ${PROJECT_SOURCE_DIR}/../doc/htmie.5.scd)
- add_custom_command(
- OUTPUT htmie.5
- COMMAND ${SCDOC} < ${_src} > htmie.5
- DEPENDS ${_src}
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
- COMMENT "Buid ROFF man page htmie.5"
- VERBATIM)
- add_custom_target(man-roff ALL DEPENDS htmie.5)
- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/htmie.5 DESTINATION share/man/man5)
-endif()
-
-################################################################################
-# Test utilities
-################################################################################
-if(NOT NO_TEST)
- function(build_test _name)
- add_executable(${_name}
- ${HTMIE_SOURCE_DIR}/${_name}.c)
- target_link_libraries(${_name} htmie)
- endfunction()
-
- function(new_test _name)
- build_test(${_name})
- add_test(${_name} ${_name})
- endfunction()
-
- new_test(test_htmie)
-
- find_program(_ncdump ncdump)
-
- if(NOT _ncdump)
- message(WARNING
- "The ncdump program is missing. Could not test the loading of a htmie "
- "file.")
- else()
- build_test(test_htmie_load)
-
- set(TEST_FILES Mie_LUT_Cloud)
-
- foreach(_file IN LISTS TEST_FILES)
- set(_netcdf ${PROJECT_SOURCE_DIR}/../${_file}.nc)
- set(_script ${HTMIE_SOURCE_DIR}/dump_netcdf_data.sh)
- set(_output_base ${CMAKE_CURRENT_BINARY_DIR}/${_file})
- add_custom_command(
- OUTPUT
- ${_output_base}_lambda
- ${_output_base}_macs
- ${_output_base}_mscs
- ${_output_base}_rmod
- ${_output_base}_smod
- ${_output_base}_g
- COMMAND sh ${_script} lambda ${_netcdf}
- COMMAND sh ${_script} macs ${_netcdf}
- COMMAND sh ${_script} mscs ${_netcdf}
- COMMAND sh ${_script} rmod ${_netcdf}
- COMMAND sh ${_script} smod ${_netcdf}
- COMMAND sh ${_script} g ${_netcdf}
- DEPENDS ${_script}
- COMMENT "Dump data of the ${_file} NetCDF"
- VERBATIM)
- add_test(test_htmie_load_${_file}
- test_htmie_load ${_netcdf} ${CMAKE_CURRENT_BINARY_DIR})
- add_custom_target(dump-${_file}.nc ALL DEPENDS
- ${_output_base}_lambda
- ${_output_base}_macs
- ${_output_base}_mscs
- ${_output_base}_rmod
- ${_output_base}_smod
- ${_output_base}_g)
- endforeach()
- endif()
-endif()
-
-################################################################################
-# Define output & install directories
-################################################################################
-install(TARGETS htmie
- ARCHIVE DESTINATION bin
- LIBRARY DESTINATION lib
- RUNTIME DESTINATION bin)
-install(FILES ${HTMIE_FILES_INC_API} DESTINATION include/high_tune)
-install(FILES ${HTMIE_FILES_DOC} DESTINATION share/doc/htmie)
-
diff --git a/cmake/FindNetCDF.cmake b/cmake/FindNetCDF.cmake
@@ -1,119 +0,0 @@
-# - Find NetCDF
-# Find the native NetCDF includes and library
-#
-# NETCDF_INCLUDE_DIR - user modifiable choice of where netcdf headers are
-# NETCDF_LIBRARY - user modifiable choice of where netcdf libraries are
-#
-# Your package can require certain interfaces to be FOUND by setting these
-#
-# NETCDF_CXX - require the C++ interface and link the C++ library
-# NETCDF_F77 - require the F77 interface and link the fortran library
-# NETCDF_F90 - require the F90 interface and link the fortran library
-#
-# Or equivalently by calling FindNetCDF with a COMPONENTS argument containing one or
-# more of "CXX;F77;F90".
-#
-# When interfaces are requested the user has access to interface specific hints:
-#
-# NETCDF_${LANG}_INCLUDE_DIR - where to search for interface header files
-# NETCDF_${LANG}_LIBRARY - where to search for interface libraries
-#
-# This module returns these variables for the rest of the project to use.
-#
-# NETCDF_FOUND - True if NetCDF found including required interfaces (see below)
-# NETCDF_LIBRARIES - All netcdf related libraries.
-# NETCDF_INCLUDE_DIRS - All directories to include.
-# NETCDF_HAS_INTERFACES - Whether requested interfaces were found or not.
-# NETCDF_${LANG}_INCLUDE_DIRS/NETCDF_${LANG}_LIBRARIES - C/C++/F70/F90 only interface
-#
-# Normal usage would be:
-# set (NETCDF_F90 "YES")
-# find_package (NetCDF REQUIRED)
-# target_link_libraries (uses_everthing ${NETCDF_LIBRARIES})
-# target_link_libraries (only_uses_f90 ${NETCDF_F90_LIBRARIES})
-
-#search starting from user editable cache var
-if (NETCDF_INCLUDE_DIR AND NETCDF_LIBRARY)
- # Already in cache, be silent
- set (NETCDF_FIND_QUIETLY TRUE)
-endif ()
-
-set(USE_DEFAULT_PATHS "NO_DEFAULT_PATH")
-if(NETCDF_USE_DEFAULT_PATHS)
- set(USE_DEFAULT_PATHS "")
-endif()
-
-find_path (NETCDF_INCLUDE_DIR netcdf.h
- PATHS "${NETCDF_DIR}/include")
-mark_as_advanced (NETCDF_INCLUDE_DIR)
-set (NETCDF_C_INCLUDE_DIRS ${NETCDF_INCLUDE_DIR})
-
-find_library (NETCDF_LIBRARY NAMES netcdf
- PATHS "${NETCDF_DIR}/lib"
- HINTS "${NETCDF_INCLUDE_DIR}/../lib")
-mark_as_advanced (NETCDF_LIBRARY)
-
-set (NETCDF_C_LIBRARIES ${NETCDF_LIBRARY})
-
-#start finding requested language components
-set (NetCDF_libs "")
-set (NetCDF_includes "${NETCDF_INCLUDE_DIR}")
-
-get_filename_component (NetCDF_lib_dirs "${NETCDF_LIBRARY}" PATH)
-set (NETCDF_HAS_INTERFACES "YES") # will be set to NO if we're missing any interfaces
-
-macro (NetCDF_check_interface lang header libs)
- if (NETCDF_${lang})
- #search starting from user modifiable cache var
- find_path (NETCDF_${lang}_INCLUDE_DIR NAMES ${header}
- HINTS "${NETCDF_INCLUDE_DIR}"
- HINTS "${NETCDF_${lang}_ROOT}/include"
- ${USE_DEFAULT_PATHS})
-
- find_library (NETCDF_${lang}_LIBRARY NAMES ${libs}
- HINTS "${NetCDF_lib_dirs}"
- HINTS "${NETCDF_${lang}_ROOT}/lib"
- ${USE_DEFAULT_PATHS})
-
- mark_as_advanced (NETCDF_${lang}_INCLUDE_DIR NETCDF_${lang}_LIBRARY)
-
- #export to internal varS that rest of project can use directly
- set (NETCDF_${lang}_LIBRARIES ${NETCDF_${lang}_LIBRARY})
- set (NETCDF_${lang}_INCLUDE_DIRS ${NETCDF_${lang}_INCLUDE_DIR})
-
- if (NETCDF_${lang}_INCLUDE_DIR AND NETCDF_${lang}_LIBRARY)
- list (APPEND NetCDF_libs ${NETCDF_${lang}_LIBRARY})
- list (APPEND NetCDF_includes ${NETCDF_${lang}_INCLUDE_DIR})
- else ()
- set (NETCDF_HAS_INTERFACES "NO")
- message (STATUS "Failed to find NetCDF interface for ${lang}")
- endif ()
- endif ()
-endmacro ()
-
-list (FIND NetCDF_FIND_COMPONENTS "CXX" _nextcomp)
-if (_nextcomp GREATER -1)
- set (NETCDF_CXX 1)
-endif ()
-list (FIND NetCDF_FIND_COMPONENTS "F77" _nextcomp)
-if (_nextcomp GREATER -1)
- set (NETCDF_F77 1)
-endif ()
-list (FIND NetCDF_FIND_COMPONENTS "F90" _nextcomp)
-if (_nextcomp GREATER -1)
- set (NETCDF_F90 1)
-endif ()
-NetCDF_check_interface (CXX netcdfcpp.h netcdf_c++)
-NetCDF_check_interface (F77 netcdf.inc netcdff)
-NetCDF_check_interface (F90 netcdf.mod netcdff)
-
-#export accumulated results to internal varS that rest of project can depend on
-list (APPEND NetCDF_libs "${NETCDF_C_LIBRARIES}")
-set (NETCDF_LIBRARIES ${NetCDF_libs})
-set (NETCDF_INCLUDE_DIRS ${NetCDF_includes})
-
-# handle the QUIETLY and REQUIRED arguments and set NETCDF_FOUND to TRUE if
-# all listed variables are TRUE
-include (FindPackageHandleStandardArgs)
-find_package_handle_standard_args (NetCDF
- DEFAULT_MSG NETCDF_LIBRARIES NETCDF_INCLUDE_DIRS NETCDF_HAS_INTERFACES)