Skip to content

Commit 5af4651

Browse files
committed
Add json-fortran to CMakeLists.txt; outstanding linker errors
1 parent 93049eb commit 5af4651

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

CMakeLists.txt

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,20 @@ FetchContent_Declare(
3030
GIT_TAG v4.6.3
3131
)
3232

33-
FetchContent_MakeAvailable(h5fortran)
33+
FetchContent_Declare(
34+
jsonfortran
35+
GIT_REPOSITORY https://github.com/jacobwilliams/json-fortran
36+
GIT_TAG 8.3.0
37+
)
38+
39+
FetchContent_MakeAvailable(h5fortran jsonfortran)
3440

3541
file(MAKE_DIRECTORY ${h5fortran_BINARY_DIR}/include)
3642
include_directories(${h5fortran_BINARY_DIR}/include)
3743

44+
file(MAKE_DIRECTORY ${jsonfortran_BINARY_DIR}/include)
45+
include_directories(${jsonfortran_BINARY_DIR})
46+
3847
# compiler flags for gfortran
3948
if(CMAKE_Fortran_COMPILER_ID MATCHES GNU)
4049

@@ -128,11 +137,11 @@ string(REGEX REPLACE "^ | $" "" LIBS "${LIBS}")
128137
enable_testing()
129138
foreach(execid input1d_layer input3d_layer dense_layer conv2d_layer maxpool2d_layer flatten_layer dense_network dense_network_from_keras conv2d_network io_hdf5 keras_read_model)
130139
add_executable(test_${execid} test/test_${execid}.f90)
131-
target_link_libraries(test_${execid} PRIVATE neural h5fortran::h5fortran ${LIBS})
140+
target_link_libraries(test_${execid} PRIVATE neural h5fortran::h5fortran jsonfortran ${LIBS})
132141
add_test(test_${execid} bin/test_${execid})
133142
endforeach()
134143

135144
foreach(execid cnn mnist mnist_from_keras simple sine)
136145
add_executable(${execid} example/${execid}.f90)
137-
target_link_libraries(${execid} PRIVATE neural h5fortran::h5fortran ${LIBS})
146+
target_link_libraries(${execid} PRIVATE neural h5fortran::h5fortran jsonfortran ${LIBS})
138147
endforeach()

0 commit comments

Comments
 (0)