Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,10 @@
build/
install/

*.[ao]
*.[aox]
*.mod
*.so
*.exe
*.x

*.swp
configure.upp*
*.a
8 changes: 4 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[submodule "CMakeModules"]
path = CMakeModules
url = https://github.com/noaa-emc/CMakeModules
branch = develop
[submodule "comupp/src/lib/crtm2"]
path = sorc/comlibs/crtm2
url = https://github.com/NCAR/UPP_CRTM
[submodule "cmake"]
path = cmake
url = https://github.com/NOAA-EMC/CMakeModules
branch = release/public-v1
78 changes: 21 additions & 57 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
cmake_minimum_required(VERSION 3.15)

file(STRINGS "VERSION" pVersion)
file(STRINGS "VERSION" pVersion LIMIT_COUNT 1)

project(
ncep_post
nceppost
VERSION ${pVersion}
LANGUAGES Fortran)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/")

if(POLICY CMP0054)
cmake_policy(SET CMP0054 NEW)
endif()
if(POLICY CMP0012)
cmake_policy(SET CMP0012 NEW)
endif()
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/Modules")

option(OPENMP "use OpenMP threading" OFF)
option(BUILD_POSTEXEC "Build NCEPpost executable" ON)
option(BUILD_WITH_WRFLIB "Build NCEPpost with WRF library" OFF)

if(NOT CMAKE_BUILD_TYPE MATCHES "^(Debug|Release|RelWithDebInfo|MinSizeRel)$")
message(STATUS "Setting build type to 'Release' as none was specified.")
Expand All @@ -32,64 +27,33 @@ if(NOT CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel|GNU|Clang|AppleClang)$")
endif()

find_package(MPI REQUIRED)
find_package(PNG REQUIRED)
find_package(Jasper REQUIRED)
find_package(NetCDF MODULE REQUIRED)
find_package(NetCDF REQUIRED COMPONENTS Fortran)

if(OPENMP)
find_package(OpenMP REQUIRED COMPONENTS Fortran)
endif()

set(CMAKE_FIND_PACKAGE_PREFER_CONFIG true)

if(NOT TARGET sigio_4)
find_package(sigio REQUIRED)
endif()

if(NOT TARGET w3nco_4)
find_package(w3nco REQUIRED)
endif()

if(NOT TARGET g2_4)
find_package(g2 REQUIRED)
endif()

if(NOT TARGET g2tmpl)
find_package(g2tmpl REQUIRED)
endif()

if(NOT TARGET bacio_4)
find_package(bacio REQUIRED)
if(BUILD_WITH_WRFLIB)
find_package(wrf REQUIRED)
else()
set(wrf_FOUND FALSE)
endif()

if(NOT TARGET ip_4)
find_package(ip REQUIRED)
endif()

if(NOT TARGET sp_4)
find_package(sp REQUIRED)
endif()
find_package(w3nco REQUIRED)
find_package(g2 REQUIRED)
find_package(g2tmpl REQUIRED)
find_package(bacio REQUIRED)
find_package(ip REQUIRED)
find_package(sp REQUIRED)
find_package(w3emc REQUIRED)
find_package(crtm REQUIRED)

if(NOT TARGET sfcio_4)
if(BUILD_POSTEXEC)
find_package(sigio REQUIRED)
find_package(sfcio REQUIRED)
endif()

if(NOT TARGET nemsio)
find_package(nemsio REQUIRED)
endif()

if(NOT TARGET gfsio_4)
find_package(gfsio REQUIRED)
endif()

if(NOT TARGET w3emc_4)
find_package(w3emc REQUIRED)
endif()

if(NOT TARGET crtm)
find_package(crtm REQUIRED)
endif()

add_subdirectory(sorc)

install(FILES parm/postxconfig-NT-GFS.txt parm/postxconfig-NT-GFS-F00.txt DESTINATION share)
add_subdirectory(parm)
1 change: 1 addition & 0 deletions CMakeModules
Submodule CMakeModules added at fece61
4 changes: 3 additions & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
1.0.0
9.9.9
# This is a placeholder version number.
# It will be replaced with an appropriate version following a discussion within the UPP management.
1 change: 0 additions & 1 deletion cmake
Submodule cmake deleted from b605db
43 changes: 43 additions & 0 deletions cmake/PackageConfig.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
@PACKAGE_INIT@

#@PROJECT_NAME@-config.cmake
#
# Imported interface targets provided:
# * @PROJECT_NAME@::@PROJECT_NAME@ - library target

# Include targets file. This will create IMPORTED target @PROJECT_NAME@
include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@-targets.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@-config-version.cmake")
include(CMakeFindDependencyMacro)

find_dependency(MPI)

# ON/OFF implies @PROJECT_NAME@ was compiled with/without OpenMP
if(@OPENMP@)
find_dependency(OpenMP COMPONENTS Fortran)
endif()

find_dependency(NetCDF COMPONENTS Fortran)

find_dependency(w3nco CONFIG)
find_dependency(g2 CONFIG)
find_dependency(g2tmpl CONFIG)
find_dependency(bacio CONFIG)
find_dependency(ip CONFIG)
find_dependency(sp CONFIG)
find_dependency(w3emc CONFIG)
find_dependency(crtm CONFIG)
Comment thread
aerorahul marked this conversation as resolved.

# nceppost library does not depend on these, the executable does.
#find_dependency(sigio CONFIG)
#find_dependency(sfcio CONFIG)
#find_dependency(nemsio CONFIG)
#find_dependency(gfsio CONFIG)

# Get the build type from library target
get_target_property(@PROJECT_NAME@_BUILD_TYPES @PROJECT_NAME@::@PROJECT_NAME@ IMPORTED_CONFIGURATIONS)

check_required_components("@PROJECT_NAME@")

get_target_property(location @PROJECT_NAME@::@PROJECT_NAME@ LOCATION)
message(STATUS "Found @PROJECT_NAME@: ${location} (found version \"${PACKAGE_VERSION}\")")
5 changes: 5 additions & 0 deletions parm/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
list(APPEND parmfiles
postxconfig-NT-GFS.txt
postxconfig-NT-GFS-F00.txt)

install(FILES ${parmfiles} DESTINATION share)
Loading