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
313 changes: 203 additions & 110 deletions CMakeLists.txt

Large diffs are not rendered by default.

143 changes: 0 additions & 143 deletions cmake/FindNetCDF.cmake

This file was deleted.

68 changes: 0 additions & 68 deletions cmake/FindPnetCDF.cmake

This file was deleted.

8 changes: 5 additions & 3 deletions cmake/LibFind.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -303,9 +303,11 @@ function (find_package_component PKG)

# handle the QUIETLY and REQUIRED arguments and
# set NetCDF_C_FOUND to TRUE if all listed variables are TRUE
find_package_handle_standard_args (${PKGCOMP} DEFAULT_MSG
${PKGCOMP}_LIBRARY
${PKGCOMP}_INCLUDE_DIR)

# Use the main package name for find_package_handle_standard_args to avoid CMake warnings
find_package_handle_standard_args (${PKG} DEFAULT_MSG
${PKGCOMP}_LIBRARY
${PKGCOMP}_INCLUDE_DIR)
mark_as_advanced (${PKGCOMP}_INCLUDE_DIR ${PKGCOMP}_LIBRARY)

# HACK For bug in CMake v3.0:
Expand Down
35 changes: 18 additions & 17 deletions doc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,27 @@
#
#==============================================================================


find_package(Doxygen)

if(DOXYGEN_FOUND)
# This supports the build with/witout internal documentation.
if (PIO_INTERNAL_DOC)
SET(C_SRC_FILES "${CMAKE_CURRENT_SOURCE_DIR}/../src/clib")
else ()
SET(C_SRC_FILES
"${CMAKE_CURRENT_SOURCE_DIR}/../src/clib/pioc.c \\
${CMAKE_CURRENT_SOURCE_DIR}/../src/clib/pio_nc4.c \\
${CMAKE_CURRENT_SOURCE_DIR}/../src/clib/pio_darray.c \\
${CMAKE_CURRENT_SOURCE_DIR}/../src/clib/pio_get_nc.c \\
${CMAKE_CURRENT_SOURCE_DIR}/../src/clib/pio_put_nc.c \\
${CMAKE_CURRENT_SOURCE_DIR}/../src/clib/pioc_async.c \\
${CMAKE_CURRENT_SOURCE_DIR}/../src/clib/pio_file.c \\
${CMAKE_CURRENT_SOURCE_DIR}/../src/clib/pio.h \\
${CMAKE_CURRENT_SOURCE_DIR}/../src/clib/pio_nc.c \\
${CMAKE_CURRENT_SOURCE_DIR}/../src/clib/topology.c \\
${CMAKE_CURRENT_SOURCE_DIR}/../src/clib/pioc_sc.c" )
endif ()
if(PIO_INTERNAL_DOC)
set(C_SRC_FILES "${CMAKE_CURRENT_SOURCE_DIR}/../src/clib")
else()
set(C_SRC_FILES
"${CMAKE_CURRENT_SOURCE_DIR}/../src/clib/pioc.c \
${CMAKE_CURRENT_SOURCE_DIR}/../src/clib/pio_nc4.c \
${CMAKE_CURRENT_SOURCE_DIR}/../src/clib/pio_darray.c \
${CMAKE_CURRENT_SOURCE_DIR}/../src/clib/pio_get_nc.c \
${CMAKE_CURRENT_SOURCE_DIR}/../src/clib/pio_put_nc.c \
${CMAKE_CURRENT_SOURCE_DIR}/../src/clib/pioc_async.c \
${CMAKE_CURRENT_SOURCE_DIR}/../src/clib/pio_file.c \
${CMAKE_CURRENT_SOURCE_DIR}/../src/clib/pio.h \
${CMAKE_CURRENT_SOURCE_DIR}/../src/clib/pio_nc.c \
${CMAKE_CURRENT_SOURCE_DIR}/../src/clib/topology.c \
${CMAKE_CURRENT_SOURCE_DIR}/../src/clib/pioc_sc.c")
endif()

# Process the Doxyfile using options set during configure.
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in
Expand All @@ -40,4 +41,4 @@ ${CMAKE_CURRENT_SOURCE_DIR}/../src/clib/pioc_sc.c" )
COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating API documentation with Doxygen" VERBATIM)
endif(DOXYGEN_FOUND)
endif()
9 changes: 5 additions & 4 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
### CMakeList.txt for examples using pio
###-------------------------------------------------------------------------###

if (PIO_ENABLE_FORTRAN)
ADD_SUBDIRECTORY(f03)
ADD_SUBDIRECTORY(c)

if(PIO_ENABLE_FORTRAN)
add_subdirectory(f03)
add_subdirectory(c)
else()
ADD_SUBDIRECTORY(c)
add_subdirectory(c)
endif()
39 changes: 20 additions & 19 deletions examples/basic/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
SET(TEMPSRCF90 alloc_mod.F90)
FOREACH(tempfile IN LISTS TEMPSRCF90)
ADD_CUSTOM_COMMAND(
OUTPUT ${tempfile}
COMMAND ${GENF90_PATH}/genf90.pl ${CMAKE_CURRENT_SOURCE_DIR}/${tempfile}.in > ${tempfile}
DEPENDS ${tempfile}.in
)
ENDFOREACH()

SET(SRC check_mod.F90 gdecomp_mod.F90 kinds_mod.F90 namelist_mod.F90
testpio.F90 utils_mod.F90 ${TEMPSRCF90})
SET(WSSRC wstest.c)
set(TEMPSRCF90 alloc_mod.F90)
foreach(tempfile IN LISTS TEMPSRCF90)
add_custom_command(
OUTPUT ${tempfile}
COMMAND ${GENF90_PATH}/genf90.pl ${CMAKE_CURRENT_SOURCE_DIR}/${tempfile}.in > ${tempfile}
DEPENDS ${tempfile}.in
)
endforeach()

INCLUDE_DIRECTORIES(${PIO_INCLUDE_DIRS})
LINK_DIRECTORIES(${PIO_LIB_DIR})
ADD_EXECUTABLE(testpio ${SRC})
ADD_EXECUTABLE(wstest ${WSSRC})
set(SRC check_mod.F90 gdecomp_mod.F90 kinds_mod.F90 namelist_mod.F90
testpio.F90 utils_mod.F90 ${TEMPSRCF90})
set(WSSRC wstest.c)

include_directories(${PIO_INCLUDE_DIRS})
link_directories(${PIO_LIB_DIR})
add_executable(testpio ${SRC})
add_executable(wstest ${WSSRC})
if(${PIO_BUILD_TIMING} MATCHES "ON")
SET(TIMING_LINK_LIB timing)
set(TIMING_LINK_LIB timing)
endif()

if(NETCDF_FOUND)
TARGET_LINK_LIBRARIES(testpio piof pioc ${NETCDF_Fortran_LIBRARY} ${TIMING_LINK_LIB})
target_link_libraries(testpio piof pioc ${NETCDF_Fortran_LIBRARY} ${TIMING_LINK_LIB})
else()
TARGET_LINK_LIBRARIES(testpio piof pioc ${TIMING_LINK_LIB})
target_link_libraries(testpio piof pioc ${TIMING_LINK_LIB})
endif()
TARGET_LINK_LIBRARIES(wstest pioc ${TIMING_LINK_LIB})
target_link_libraries(wstest pioc ${TIMING_LINK_LIB})
Loading