Skip to content

Commit

Permalink
adding back the fetch content files
Browse files Browse the repository at this point in the history
  • Loading branch information
K20shores committed Apr 25, 2024
1 parent 6604ad9 commit c38cc28
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 1 deletion.
47 changes: 47 additions & 0 deletions fortran/test/fetch_content_integration/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
cmake_minimum_required(VERSION 3.21)

project(
test_musica_fortran
LANGUAGES Fortran C CXX
)

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})

include(FetchContent)

FetchContent_Declare(musica-fortran
GIT_REPOSITORY https://github.com/NCAR/musica.git
GIT_TAG main
)

set(MUSICA_BUILD_C_CXX_INTERFACE OFF)
set(MUSICA_BUILD_FORTRAN_INTERFACE ON)
set(MUSICA_ENABLE_MICM ON)
set(MUSICA_ENABLE_TUVX OFF)
set(MUSICA_ENABLE_TESTS OFF)

FetchContent_MakeAvailable(musica-fortran)

find_package(PkgConfig REQUIRED)
pkg_check_modules(netcdff IMPORTED_TARGET REQUIRED netcdf-fortran)

enable_testing()

# API Test
add_executable(test_micm_core_api test_micm_api.F90)

target_link_libraries(test_micm_fort_api
PRIVATE
musica::musica-fortran
)

set_target_properties(test_micm_fort_api
PROPERTIES
LINKER_LANGUAGE Fortran
)

add_test(
NAME test_micm_fort_api
COMMAND $<TARGET_FILE:test_micm_fort_api>
WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
)
File renamed without changes.
2 changes: 1 addition & 1 deletion fortran/test/unit/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include(test_util)

create_standard_test_fortran(NAME micm_api SOURCES test_micm_api.F90)
create_standard_test_fortran(NAME micm_api SOURCES ../fetch_content_integration/test_micm_api.F90)

if (MUSICA_ENABLE_TUVX)
create_standard_test_fortran(NAME connect_to_tuvx SOURCES tuvx.F90)
Expand Down
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ target_compile_definitions(musica PRIVATE ${MUSICA_COMPILE_DEFINITIONS})

set_target_properties(musica PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY ${MUSICA_LIB_DIR}
Fortran_MODULE_DIRECTORY ${MUSICA_MOD_DIR}
VERSION ${PROJECT_VERSION}
SOVERSION ${PROJECT_VERSION_MAJOR}
)
Expand Down

0 comments on commit c38cc28

Please sign in to comment.