Skip to content

Commit e42213c

Browse files
committed
adding aliases for libraries
1 parent 280ae0e commit e42213c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

CMakeLists.txt

+5
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,11 @@ set ( LIB_NAME ${PROJECT_NAME} )
170170
add_library ( ${LIB_NAME} SHARED ${JF_LIB_SRCS} )
171171
add_library ( ${LIB_NAME}-static STATIC ${JF_LIB_SRCS} )
172172

173+
# add an alias so that including json-fortran is agnostic
174+
# of find_package or being directly compiled through add_subdirectory
175+
add_library ( ${PACKAGE_NAME}::${LIB_NAME} ALIAS ${LIB_NAME} )
176+
add_library ( ${PACKAGE_NAME}::${LIB_NAME}-static ALIAS ${LIB_NAME}-static )
177+
173178
if(JSON_FORTRAN_USE_OpenCoarrays)
174179
target_link_libraries(${LIB_NAME}
175180
PRIVATE OpenCoarrays::caf_mpi_static)

0 commit comments

Comments
 (0)