-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from NOAA-EMC/feature/cleanup
cleanup produtil cmake
- Loading branch information
Showing
18 changed files
with
46 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
build/ | ||
install/ | ||
|
||
*.[aox] | ||
*.mod | ||
*.so | ||
.DS_Store | ||
|
||
*.swp |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,31 @@ | ||
cmake_minimum_required(VERSION 3.15) | ||
project(prod_util VERSION 1.1.1) | ||
set(${PROJECT_NAME}_VERSION ${PROJECT_VERSION} CACHE INTERNAL "${PROJECT_NAME} version number") | ||
|
||
enable_language (Fortran) | ||
if (NOT CMAKE_BUILD_TYPE) | ||
set (CMAKE_BUILD_TYPE RELEASE CACHE STRING | ||
"Choose the type of build, options are: PRODUCTION Debug Release." | ||
FORCE) | ||
endif() | ||
|
||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel") | ||
set(IntelComp true ) | ||
elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU*" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang*") | ||
set(GNUComp true ) | ||
elseif(CMAKE_CXX_COMPILER_ID MATCHES "pgc*") | ||
set(PGIComp true ) | ||
endif() | ||
file(STRINGS "VERSION" pVersion) | ||
|
||
STRING(COMPARE EQUAL ${CMAKE_BUILD_TYPE} "RelWithDebInfo" BUILD_RELEASE) | ||
if(NOT BUILD_RELEASE ) | ||
STRING(COMPARE EQUAL ${CMAKE_BUILD_TYPE} "RELEASE" BUILD_RELEASE) | ||
endif() | ||
STRING(COMPARE EQUAL ${CMAKE_BUILD_TYPE} "PRODUCTION" BUILD_PRODUCTION) | ||
STRING(COMPARE EQUAL ${CMAKE_BUILD_TYPE} "DEBUG" BUILD_DEBUG) | ||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/") | ||
project( | ||
produtil | ||
VERSION ${pVersion} | ||
LANGUAGES C Fortran) | ||
|
||
if(POLICY CMP0054) | ||
cmake_policy(SET CMP0054 NEW) | ||
if(NOT CMAKE_BUILD_TYPE MATCHES "^(Debug|Release|RelWithDebInfo|MinSizeRel)$") | ||
message(STATUS "Setting build type to 'Release' as none was specified.") | ||
set(CMAKE_BUILD_TYPE | ||
"Release" | ||
CACHE STRING "Choose the type of build." FORCE) | ||
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" | ||
"MinSizeRel" "RelWithDebInfo") | ||
endif() | ||
if(POLICY CMP0012) | ||
cmake_policy(SET CMP0012 NEW) | ||
|
||
if(NOT CMAKE_C_COMPILER_ID MATCHES "^(Intel|GNU|AppleClang|Clang)$") | ||
message(WARNING "Compiler not officially supported: ${CMAKE_C_COMPILER_ID}") | ||
endif() | ||
|
||
set(CMAKE_FIND_PACKAGE_PREFER_CONFIG true) | ||
if (NOT TARGET w3nco_4) | ||
find_package(w3nco_4 REQUIRED) | ||
if(NOT CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel|GNU)$") | ||
message(WARNING "Compiler not officially supported: ${CMAKE_Fortran_COMPILER_ID}") | ||
endif() | ||
|
||
add_subdirectory(sorc/fsync_file.cd) | ||
add_subdirectory(sorc/mdate.fd) | ||
add_subdirectory(sorc/ndate.fd) | ||
add_subdirectory(sorc/nhour.fd) | ||
include(GNUInstallDirs) | ||
|
||
find_package(w3nco REQUIRED) | ||
|
||
add_subdirectory(sorc) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1.1.1 |
Submodule cmake
deleted from
7f5b1b
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
add_subdirectory(fsync_file.cd) | ||
add_subdirectory(mdate.fd) | ||
add_subdirectory(ndate.fd) | ||
add_subdirectory(nhour.fd) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,7 @@ | ||
file(GLOB EXE_C_SRC ${CMAKE_CURRENT_SOURCE_DIR}/*.c) | ||
file(EXE_C_SRC fsync_file.c) | ||
|
||
set(EXENAME fsync_file) | ||
add_executable(${EXENAME} ${EXE_SRC} ${EXE_C_SRC}) | ||
|
||
install(TARGETS ${EXENAME} | ||
RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin | ||
LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib | ||
ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib) | ||
|
||
RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) |
Empty file.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,6 @@ | ||
set(EXENAME mdate) | ||
|
||
file(GLOB EXE_SRC ${CMAKE_CURRENT_SOURCE_DIR}/*.f | ||
${CMAKE_CURRENT_SOURCE_DIR}/*.f90 | ||
${CMAKE_CURRENT_SOURCE_DIR}/*.F) | ||
|
||
add_executable(${EXENAME} ${EXE_SRC} ) | ||
target_link_libraries(${EXENAME} w3nco_4) | ||
add_executable(${EXENAME} mdate.f) | ||
target_link_libraries(${EXENAME} w3nco::w3nco_4) | ||
|
||
install(TARGETS ${EXENAME} | ||
RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin | ||
LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib | ||
ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib) | ||
|
||
RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) |
This file was deleted.
Oops, something went wrong.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,6 @@ | ||
|
||
file(GLOB EXE_SRC ${CMAKE_CURRENT_SOURCE_DIR}/*.f | ||
${CMAKE_CURRENT_SOURCE_DIR}/*.f90 | ||
${CMAKE_CURRENT_SOURCE_DIR}/*.F) | ||
|
||
set(EXENAME ndate) | ||
|
||
add_executable(${EXENAME} ${EXE_SRC}) | ||
target_link_libraries(${EXENAME} w3nco_4) | ||
add_executable(${EXENAME} ndate.f) | ||
target_link_libraries(${EXENAME} w3nco::w3nco_4) | ||
|
||
install(TARGETS ${EXENAME} | ||
RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin | ||
LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib | ||
ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib) | ||
|
||
RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) |
This file was deleted.
Oops, something went wrong.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,6 @@ | ||
|
||
file(GLOB EXE_SRC ${CMAKE_CURRENT_SOURCE_DIR}/*.f | ||
${CMAKE_CURRENT_SOURCE_DIR}/*.f90 | ||
${CMAKE_CURRENT_SOURCE_DIR}/*.F) | ||
|
||
set(EXENAME nhour) | ||
|
||
add_executable(${EXENAME} ${EXE_SRC}) | ||
target_link_libraries(${EXENAME} w3nco_4) | ||
add_executable(${EXENAME} nhour.f) | ||
target_link_libraries(${EXENAME} w3nco::w3nco_4) | ||
|
||
install(TARGETS ${EXENAME} | ||
RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin | ||
LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib | ||
ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib) | ||
|
||
RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) |
This file was deleted.
Oops, something went wrong.
Empty file.