commit 9bf64855752b8115d3d41870a9da9c04f0f494f8 parent 6d232375d68fa3676c42896ab5706230b2693cef Author: Vincent Forest <vincent.forest@meso-star.com> Date: Mon, 30 Oct 2023 15:08:40 +0100 Remove CMake support POSIX make is now the only supported build system. Diffstat:
| D | cmake/CMakeLists.txt | | | 131 | ------------------------------------------------------------------------------- |
| D | cmake/doc/CMakeLists.txt | | | 60 | ------------------------------------------------------------ |
| D | cmake/htcp/CMakeLists.txt | | | 62 | -------------------------------------------------------------- |
| D | cmake/les2htcp/CMakeLists.txt | | | 66 | ------------------------------------------------------------------ |
| D | cmake/les2htcp/FindNetCDF.cmake | | | 119 | ------------------------------------------------------------------------------- |
5 files changed, 0 insertions(+), 438 deletions(-)
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt @@ -1,131 +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(htcp) -enable_testing() - -option(NO_TEST "Do not build tests" OFF) - -set(HTCP_SOURCE_DIR ${PROJECT_SOURCE_DIR}/../src) -set(NETCDF_PATH ${PROJECT_SOURCE_DIR}/../ CACHE PATH - "Path where the NetCDF test files are stored.") - -################################################################################ -# Prerequisites -################################################################################ -find_package(RCMake 0.3 REQUIRED) -find_package(RSys 0.6 REQUIRED) - -set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${RCMAKE_SOURCE_DIR}) -include(rcmake) -include(rcmake_runtime) - -include_directories(${RSys_INCLUDE_DIR}) - -if(CMAKE_COMPILER_IS_GNUCC) - set(MATH_LIB m) -endif() - -################################################################################ -# Test utilities -################################################################################ -if(NOT NO_TEST) - function(build_test _name) - add_executable(${_name} - ${HTCP_SOURCE_DIR}/${_name}.c) - target_link_libraries(${_name} htcp ${ARGN}) - endfunction() - - function(new_test _name) - build_test(${_name}) - add_test(${_name} ${_name}) - endfunction() -endif() - -################################################################################ -# Sub projects -################################################################################ -set(VERSION_MAJOR 0) -set(VERSION_MINOR 0) -set(VERSION_PATCH 5) -set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}) - -add_subdirectory(doc) -add_subdirectory(htcp) -add_subdirectory(les2htcp) - -################################################################################ -# Test both the les2htcp utility and the htcp library. -################################################################################ -if(NOT NO_TEST) - build_test(test_htcp_load_from_file ${MATH_LIB}) - - set(TEST_FILES - CEN2D.1.ARMCU.008.diaKCL - CERK4.1.ARMCu.008 - DZVAR.1.ARMCU.008.diaKCL - L25km.1.ARMCU.008.diaKCL - L51km.1.ARMCu.008) - - set(VAR_LISTS RVT RCT PABST THT) - - set(_script_data ${HTCP_SOURCE_DIR}/dump_netcdf_data.sh) - set(_script_desc ${HTCP_SOURCE_DIR}/dump_netcdf_desc.sh) - foreach(_file IN LISTS TEST_FILES) - set(_netcdf ${NETCDF_PATH}/${_file}.nc) - - if(EXISTS ${_netcdf}) - set(_output_base ${CMAKE_CURRENT_BINARY_DIR}/${_file}) - - add_custom_command( - OUTPUT ${_output_base}.htcp - COMMAND les2htcp -m 1000 -i ${_netcdf} -fo ${_output_base}.htcp - DEPENDS les2htcp - COMMENT "${_file}.nc: convert to HTCP fileformat" - VERBATIM) - add_custom_target(les2htcp-${_file}.nc ALL DEPENDS ${_output_base}.htcp) - - add_custom_command( - OUTPUT ${_output_base}_desc - COMMAND sh ${_script_desc} ${_netcdf} - DEPENDS ${_script_desc} - COMMENT "${_file}.nc: dump descriptor" - VERBATIM) - add_custom_target(dump-desc-${_file}.nc ALL DEPENDS ${_output_base}_desc) - - set(_ref_files) - set(_cmds) - foreach(_var IN LISTS VAR_LISTS) - set(_cmds ${_cmds} COMMAND sh ${_script_data} ${_var} ${_netcdf}) - set(_ref_files ${_ref_files} ${_output_base}_${_var}) - endforeach() - - add_custom_command( - OUTPUT ${_ref_files} - ${_cmds} - DEPENDS ${_script_data} - COMMENT "${_file}.nc: dump raw data" - VERBATIM) - add_custom_target(dump-data-${_file}.nc ALL DEPENDS ${_ref_files}) - - add_test(test_htcp_load_from_file_${_file} - test_htcp_load_from_file ${_output_base}.htcp ${CMAKE_CURRENT_BINARY_DIR}) - endif() - endforeach() -endif() - diff --git a/cmake/doc/CMakeLists.txt b/cmake/doc/CMakeLists.txt @@ -1,60 +0,0 @@ -# Copyright (C) 2018, 2020-2022 |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/>. - -set(HTCP_DOC_DIR ${PROJECT_SOURCE_DIR}/../doc) - -################################################################################ -# Look for the a2x program -################################################################################ -find_program(SCDOC NAMES scdoc) -if(NOT SCDOC) - message(WARNING - "The `scdoc' program is missing. " - "The High-Tune Cloud Properties man pages cannot be generated.") - return() -endif() - -################################################################################ -# ROFF man pages -################################################################################ -set(MAN_NAMES htcp.5 les2htcp.1) -set(MAN5_FILES) -set(MAN1_FILES) - -foreach(_man IN LISTS MAN_NAMES) - set(_src ${HTCP_DOC_DIR}/${_man}.scd) - add_custom_command( - OUTPUT ${_man} - COMMAND ${SCDOC} < ${_src} > ${_man} - DEPENDS ${_src} - COMMENT "Build ROFF man page ${_man}" - VERBATIM) - list(APPEND MAN_FILES ${_man}) - - string(REGEX MATCH "^.*.5$" _man5 ${_man}) - string(REGEX MATCH "^.*.1$" _man1 ${_man}) - if(_man1) - list(APPEND MAN1_FILES ${CMAKE_CURRENT_BINARY_DIR}/${_man1}) - elseif(_man5) - list(APPEND MAN5_FILES ${CMAKE_CURRENT_BINARY_DIR}/${_man5}) - else() - message(FATAL_ERROR "Unexpected man type") - endif() -endforeach() -add_custom_target(man-roff ALL DEPENDS ${MAN_NAMES}) -install(FILES ${MAN1_FILES} DESTINATION share/man/man1) -install(FILES ${MAN5_FILES} DESTINATION share/man/man5) diff --git a/cmake/htcp/CMakeLists.txt b/cmake/htcp/CMakeLists.txt @@ -1,62 +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(htcp-library C) - -################################################################################ -# Configure and define targets -################################################################################ -set(HTCP_FILES_SRC htcp.c) -set(HTCP_FILES_INC ) -set(HTCP_FILES_INC_API htcp.h) -set(HTCP_FILES_DOC COPYING) - -# Prepend each file in the `HTCP_FILES_<SRC|INC>' list by `HTCP_SOURCE_DIR' -rcmake_prepend_path(HTCP_FILES_SRC ${HTCP_SOURCE_DIR}) -rcmake_prepend_path(HTCP_FILES_INC ${HTCP_SOURCE_DIR}) -rcmake_prepend_path(HTCP_FILES_INC_API ${HTCP_SOURCE_DIR}) -rcmake_prepend_path(HTCP_FILES_DOC ${PROJECT_SOURCE_DIR}/../../) - -add_library(htcp SHARED ${HTCP_FILES_SRC} ${HTCP_FILES_INC} ${HTCP_FILES_INC_API}) -target_link_libraries(htcp RSys) - -set_target_properties(htcp PROPERTIES - DEFINE_SYMBOL HTCP_SHARED_BUILD - VERSION ${VERSION} - SOVERSION ${VERSION_MAJOR}) - -rcmake_setup_devel(htcp HTCP ${VERSION} high_tune/htcp_version.h) - -################################################################################ -# Add tests -################################################################################ -if(NOT NO_TEST) - new_test(test_htcp) - new_test(test_htcp_load) -endif() - -################################################################################ -# Define output & install directories -################################################################################ -install(TARGETS htcp - ARCHIVE DESTINATION bin - LIBRARY DESTINATION lib - RUNTIME DESTINATION bin) -install(FILES ${HTCP_FILES_INC_API} DESTINATION include/high_tune) -install(FILES ${HTCP_FILES_DOC} DESTINATION share/doc/htcp) - diff --git a/cmake/les2htcp/CMakeLists.txt b/cmake/les2htcp/CMakeLists.txt @@ -1,66 +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) 208 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(les2htcp C) - -# Required by netcdf.h header that some versions contains C99 comments -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu89") - -################################################################################ -# Check dependencies -################################################################################ -get_filename_component(_current_source_dir ${CMAKE_CURRENT_LIST_FILE} PATH) -set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${_current_source_dir}) - -find_package(NetCDF REQUIRED) - -include_directories( - ${NETCDF_C_INCLUDE_DIRS} - ${CMAKE_CURRENT_BINARY_DIR}) - -################################################################################ -# Generate files -################################################################################ -configure_file(${HTCP_SOURCE_DIR}/les2htcp.h.in - ${CMAKE_CURRENT_BINARY_DIR}/les2htcp.h @ONLY) - -################################################################################ -# Configure and define targets -################################################################################ -set(LES2HTCP_FILES_SRC les2htcp.c) -set(LES2HTCP_FILES_INC les2htcp.h.in) -set(LES2HTCP_FILES_DOC COPYING) - -# Prepend each file in the `HTNC_FILES_<SRC|INC>' list by `HTCP_SOURCE_DIR' -rcmake_prepend_path(LES2HTCP_FILES_SRC ${HTCP_SOURCE_DIR}) -rcmake_prepend_path(LES2HTCP_FILES_INC ${HTCP_SOURCE_DIR}) -rcmake_prepend_path(LES2HTCP_FILES_DOC ${PROJECT_SOURCE_DIR}/../../) - -add_executable(les2htcp ${LES2HTCP_FILES_SRC}) -target_link_libraries(les2htcp RSys ${NETCDF_C_LIBRARIES} m) - -set_target_properties(les2htcp PROPERTIES - VERSION ${VERSION} - SOVERSION ${VERSION_MAJOR}) - -################################################################################ -# Define output & install directories -################################################################################ -install(TARGETS les2htcp RUNTIME DESTINATION bin) -install(FILES ${LES2HTCP_FILES_DOC} DESTINATION share/doc/les2htcp) - diff --git a/cmake/les2htcp/FindNetCDF.cmake b/cmake/les2htcp/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)