Skip to content

Commit db398b4

Browse files
committed
fix standalone build
1 parent 06a00b9 commit db398b4

File tree

5 files changed

+17
-16
lines changed

5 files changed

+17
-16
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ project(NUOPC_DATA_MODELS LANGUAGES Fortran VERSION 0.1)
44
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
55
include(ExternalProject)
66
find_package(ESMF REQUIRED)
7-
find_package(PIO REQUIRED)
7+
find_package(PIO REQUIRED COMPONENT C Fortran)
88
find_package(FoX REQUIRED)
99

1010
if (DEFINED CIMEROOT)

cmake/FindFoX.cmake

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# - Try to find FoX
1+
# - Try to find FoX
2+
#
3+
# This can be controled by setting FoX_PATH or FoX_<lang>_PATH Cmake variables,
4+
# where <lang> is the COMPONENT language one needs.
25
#
3-
# This can be controled by setting FoX_PATH or FoX_<lang>_PATH Cmake variables,
4-
# where <lang> is the COMPONENT language one needs.
5-
#
66
# Once done, this will define:
77
#
88
# FoX_<lang>_FOUND (BOOL) - system has FoX
@@ -36,5 +36,5 @@ foreach (pcomp IN LISTS FoX_FIND_VALID_COMPONENTS)
3636
find_package_component(FoX COMPONENT ${pcomp})
3737
endforeach ()
3838
if(FoX_Fortran_FOUND)
39-
message(" Found FoX:")
39+
message(" Found FoX: ${FoX_Fortran_INCLUDE_DIR}")
4040
endif()

cmake/FindPIO.cmake

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# - Try to find PIO
1+
# - Try to find PIO
2+
#
3+
# This can be controled by setting PIO_PATH or PIO_<lang>_PATH Cmake variables,
4+
# where <lang> is the COMPONENT language one needs.
25
#
3-
# This can be controled by setting PIO_PATH or PIO_<lang>_PATH Cmake variables,
4-
# where <lang> is the COMPONENT language one needs.
5-
#
66
# Once done, this will define:
77
#
88
# PIO_<lang>_FOUND (BOOL) - system has PIO
@@ -23,14 +23,15 @@ define_package_component(PIO DEFAULT
2323
LIBRARY_NAMES pioc)
2424

2525
# Define PIO Fortran Component
26-
define_package_component(PIO
27-
Component Fortran
26+
define_package_component(PIO
27+
COMPONENT Fortran
2828
INCLUDE_NAMES pio.mod pio.inc
2929
LIBRARY_NAMES piof)
3030

3131
# Search for list of valid components requested
3232
find_valid_components(PIO)
3333

34+
message("This is ${PIO_FIND_COMPONENTS}")
3435
#==============================================================================
3536
# SEARCH FOR VALIDATED COMPONENTS
3637
foreach (pcomp IN LISTS PIO_FIND_VALID_COMPONENTS)
@@ -100,4 +101,4 @@ foreach (pcomp IN LISTS PIO_FIND_VALID_COMPONENTS)
100101
endforeach ()
101102
message("PIO_C_FOUND ${PIO_C_FOUND}")
102103
message("PIO_Fortran_FOUND ${PIO_Fortran_FOUND}")
103-
message("PIO_INCLUDE_DIR ${PIO_INCLUDE_DIR}")
104+
message("PIO_Fortran_INCLUDE_DIR ${PIO_Fortran_INCLUDE_DIR}")

share/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ add_library(cdeps_share ${GenF90_SRCS}
1919
shr_strconvert_mod.F90
2020
shr_precip_mod.F90
2121
shr_string_mod.F90)
22-
message("HERE ${PIO_Fortran_INCLUDE_DIR}")
22+
2323
target_include_directories (cdeps_share PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${ESMF_F90COMPILEPATHS} ${PIO_Fortran_INCLUDE_DIRS})
2424

2525

streams/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ if(BLD_STANDALONE)
1717
add_dependencies(streams cdeps_share)
1818
endif()
1919
target_include_directories (streams PUBLIC ${ESMF_F90COMPILEPATHS})
20-
target_include_directories (streams PUBLIC ${PIO_INCDIR})
21-
target_include_directories (streams PUBLIC ${FOX}/finclude)
20+
target_include_directories (streams PUBLIC ${PIO_Fortran_INCLUDE_DIR})
21+
target_include_directories (streams PUBLIC ${FoX_Fortran_INCLUDE_DIR})
2222
target_include_directories (streams PUBLIC ${CMAKE_BINARY_DIR}/share)
2323
install(TARGETS streams
2424
LIBRARY DESTINATION lib)

0 commit comments

Comments
 (0)