File tree Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -177,6 +177,14 @@ if(JSON_FORTRAN_USE_OpenCoarrays)
177
177
PRIVATE OpenCoarrays::caf_mpi_static )
178
178
endif ()
179
179
180
+ target_include_directories (${LIB_NAME}
181
+ PUBLIC
182
+ $< BUILD_INTERFACE:${MODULE_DIR} >
183
+ $< INSTALL_INTERFACE:${INSTALL_MOD_DIR} > )
184
+ target_include_directories (${LIB_NAME} -static
185
+ PUBLIC
186
+ $< BUILD_INTERFACE:${MODULE_DIR} >
187
+ $< INSTALL_INTERFACE:${INSTALL_MOD_DIR} > )
180
188
set_target_properties ( ${LIB_NAME} -static
181
189
PROPERTIES
182
190
OUTPUT_NAME ${LIB_NAME}
@@ -438,7 +446,9 @@ add_custom_target ( uninstall
438
446
#-----------------------------------------------------
439
447
# Publicize installed location to other CMake projects
440
448
#-----------------------------------------------------
441
- install ( EXPORT ${PACKAGE_NAME} -targets DESTINATION "${EXPORT_INSTALL_DIR} " )
449
+ install ( EXPORT ${PACKAGE_NAME} -targets
450
+ NAMESPACE ${PACKAGE_NAME} ::
451
+ DESTINATION "${EXPORT_INSTALL_DIR} " )
442
452
443
453
include ( CMakePackageConfigHelpers ) # Standard CMake module
444
454
write_basic_package_version_file ( "${PROJECT_BINARY_DIR} /${PACKAGE_NAME} -config-version.cmake"
Original file line number Diff line number Diff line change @@ -138,15 +138,14 @@ enable_language ( Fortran )
138
138
project ( jf_test NONE )
139
139
140
140
find_package ( jsonfortran-${CMAKE_Fortran_COMPILER_ID} 8.2.5 REQUIRED )
141
- include_directories ( "${jsonfortran_INCLUDE_DIRS}" )
142
141
143
142
file ( GLOB JF_TEST_SRCS "src/tests/jf_test_*.F90" )
144
143
foreach ( UNIT_TEST ${JF_TEST_SRCS} )
145
144
get_filename_component ( TEST ${UNIT_TEST} NAME_WE )
146
145
add_executable ( ${TEST} ${UNIT_TEST} )
147
- target_link_libraries ( ${TEST} jsonfortran-static )
146
+ target_link_libraries ( ${TEST} jsonfortran::jsonfortran -static )
148
147
# or for linking against the dynamic/shared library:
149
- # target_link_libraries ( ${TEST} jsonfortran ) # instead
148
+ # target_link_libraries ( ${TEST} jsonfortran::jsonfortran ) # instead
150
149
endforeach()
151
150
```
152
151
You can’t perform that action at this time.
0 commit comments