Skip to content

Commit

Permalink
additional output from cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
jedwards4b committed Jul 28, 2020
1 parent 11a9ad5 commit d51d7b9
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 6 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -327,10 +327,10 @@ SET(host_os "${osrel}")
SET(abs_top_builddir "${CMAKE_CURRENT_BINARY_DIR}")
SET(abs_top_srcdir "${CMAKE_CURRENT_SOURCE_DIR}")

SET(CC_VERSION "${CMAKE_C_COMPILER}")
SET(FC_VERSION "${CMAKE_Fortran_COMPILER}")
SET(CC_VERSION "${CMAKE_C_COMPILER_ID} ${CMAKE_C_COMPILER_VERSION}")
SET(FC_VERSION "${CMAKE_Fortran_COMPILER_ID} ${CMAKE_Fortran_COMPILER_VERSION}")
# Build *FLAGS for libpio.settings. (CFLAGS, CPPFLAGS, FFLAGS promoted from src)
SET(LDFLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${CMAKE_SHARED_LINKER_FLAGS_${CMAKE_BUILD_TYPE}}")
SET(LDFLAGS "${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_${CMAKE_BUILD_TYPE}}")

is_disabled(BUILD_SHARED_LIBS enable_static)
is_enabled(BUILD_SHARED_LIBS enable_shared)
Expand Down
1 change: 1 addition & 0 deletions libpio.settings.in
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Extra libraries: @LIBS@

Fortran Compiler: @FC_VERSION@
FFLAGS: @FFLAGS@
FPPFLAGS: @FPPFLAGS@

# Features
--------
Expand Down
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,5 @@ set(CPPFLAGS ${CPPFLAGS} PARENT_SCOPE)
if (PIO_ENABLE_FORTRAN)
add_subdirectory (flib)
set(FFLAGS ${FFLAGS} PARENT_SCOPE)
set(FPPFLAGS ${FPPFLAGS} PARENT_SCOPE)
endif ()
10 changes: 9 additions & 1 deletion src/clib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -159,4 +159,12 @@ if (NOT ${SIZEOF_SIZE_T} EQUAL ${SIZEOF_LONG_LONG})
endif ()

set(CFLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE}}" PARENT_SCOPE)
set(CMAKE_CPP_FLAGS "${CMAKE_CPP_FLAGS} ${CMAKE_CPP_FLAGS_${CMAKE_BUILD_TYPE}}" PARENT_SCOPE)
get_target_property(cppdefs pioc COMPILE_DEFINITIONS)
get_target_property(includes pioc INCLUDE_DIRECTORIES)
foreach(x IN LISTS cppdefs)
string(APPEND CPPFLAGS " -D${x}")
endforeach()
foreach(x IN LISTS includes)
string(APPEND CPPFLAGS " -I${x}")
endforeach()
set(CPPFLAGS ${CPPFLAGS} PARENT_SCOPE)
9 changes: 9 additions & 0 deletions src/flib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -275,3 +275,12 @@ if (NOT PnetCDF_Fortran_FOUND AND NOT NetCDF_Fortran_FOUND)
message (FATAL_ERROR "Must have PnetCDF and/or NetCDF Fortran libraries")
endif ()
set(FFLAGS ${CMAKE_Fortran_FLAGS} PARENT_SCOPE)
get_target_property(fppdefs piof COMPILE_DEFINITIONS)
get_target_property(fincludes piof INCLUDE_DIRECTORIES)
foreach(x IN LISTS fppdefs)
string(APPEND FPPFLAGS " -D${x}")
endforeach()
foreach(x IN LISTS fincludes)
string(APPEND FPPFLAGS " -I${x}")
endforeach()
set(FPPFLAGS ${FPPFLAGS} PARENT_SCOPE)
5 changes: 3 additions & 2 deletions tests/cunit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,11 @@ if (NOT PIO_USE_MPISERIAL)
add_executable (test_darray_multivar3 EXCLUDE_FROM_ALL test_darray_multivar3.c test_common.c)
target_link_libraries (test_darray_multivar3 pioc)
add_executable (test_darray_1d EXCLUDE_FROM_ALL test_darray_1d.c test_common.c)
target_link_libraries (test_darray_1d pioc)
target_link_libraries (test_darray_1d pioc)
add_executable (test_darray_3d EXCLUDE_FROM_ALL test_darray_3d.c test_common.c)
target_link_libraries (test_darray_3d pioc)
add_executable (test_decomp_uneven EXCLUDE_FROM_ALL test_decomp_uneven.c test_common.c)
target_link_libraries (test_decomp_uneven pioc)
target_link_libraries (test_decomp_uneven pioc)
add_executable (test_decomps EXCLUDE_FROM_ALL test_decomps.c test_common.c)
target_link_libraries (test_decomps pioc)
add_executable (test_rearr EXCLUDE_FROM_ALL test_rearr.c test_common.c)
Expand Down Expand Up @@ -311,3 +311,4 @@ else ()
NUMPROCS ${AT_LEAST_FOUR_TASKS}
TIMEOUT ${DEFAULT_TEST_TIMEOUT})
endif ()
MESSAGE("CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS}")

0 comments on commit d51d7b9

Please sign in to comment.