Skip to content

Commit

Permalink
Merge pull request #25 from kgerheiser/bugfix/cmake-link-error
Browse files Browse the repository at this point in the history
Give all target_link_libraries explicit PRIVATE signatures
  • Loading branch information
kgerheiser authored Sep 3, 2020
2 parents 57c8107 + ef78d84 commit 95eef19
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 11 deletions.
3 changes: 1 addition & 2 deletions sorc/copygb2.fd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ set(fortran_src

set(exe_name copygb2)
add_executable(${exe_name} ${fortran_src})
target_link_libraries(
${exe_name}
target_link_libraries(${exe_name} PRIVATE
g2::g2_d
PNG::PNG
${JASPER_LIBRARIES}
Expand Down
3 changes: 1 addition & 2 deletions sorc/degrib2.fd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ set(fortran_src degrib2.f prlevel.f prvtime.f)

set(exe_name degrib2)
add_executable(${exe_name} ${fortran_src})
target_link_libraries(
${exe_name}
target_link_libraries(${exe_name} PRIVATE
g2::g2_4
w3nco::w3nco_4
bacio::bacio_4
Expand Down
2 changes: 1 addition & 1 deletion sorc/grb2index.fd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ set(fortran_src grb2index.f)

set(exe_name grb2index)
add_executable(${exe_name} ${fortran_src})
target_link_libraries(${exe_name} g2::g2_4 w3nco::w3nco_4 bacio::bacio_4)
target_link_libraries(${exe_name} PRIVATE g2::g2_4 w3nco::w3nco_4 bacio::bacio_4)

install(TARGETS ${exe_name} RUNTIME DESTINATION bin)
2 changes: 1 addition & 1 deletion sorc/grbindex.fd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ set(fortran_src grbindex.f)

set(exe_name grbindex)
add_executable(${exe_name} ${fortran_src})
target_link_libraries(${exe_name} w3nco::w3nco_4 bacio::bacio_4)
target_link_libraries(${exe_name} PRIVATE w3nco::w3nco_4 bacio::bacio_4)

install(TARGETS ${exe_name} RUNTIME DESTINATION bin)
2 changes: 1 addition & 1 deletion sorc/grib2grib.fd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ set(fortran_src grib2grib.f hexchar.f)

set(exe_name grib2grib)
add_executable(${exe_name} ${fortran_src})
target_link_libraries(${exe_name} w3nco::w3nco_8 bacio::bacio_8)
target_link_libraries(${exe_name} PRIVATE w3nco::w3nco_8 bacio::bacio_8)

install(TARGETS ${exe_name} RUNTIME DESTINATION bin)
2 changes: 1 addition & 1 deletion sorc/tocgrib.fd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ set(fortran_src makwmo.f mkfldsep.f tocgrib.f)

set(exe_name tocgrib)
add_executable(${exe_name} ${fortran_src})
target_link_libraries(${exe_name} w3nco::w3nco_4 bacio::bacio_4)
target_link_libraries(${exe_name} PRIVATE w3nco::w3nco_4 bacio::bacio_4)

install(TARGETS ${exe_name} RUNTIME DESTINATION bin)
3 changes: 1 addition & 2 deletions sorc/tocgrib2super.fd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ set(fortran_src makwmo.f tocgrib2super.f)

set(exe_name tocgrib2super)
add_executable(${exe_name} ${fortran_src})
target_link_libraries(
${exe_name}
target_link_libraries(${exe_name} PRIVATE
g2::g2_4
w3nco::w3nco_4
bacio::bacio_4
Expand Down
2 changes: 1 addition & 1 deletion sorc/wgrib.cd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ set(c_src wgrib.c)

set(exe_name wgrib)
add_executable(${exe_name} ${c_src})
target_link_libraries(${exe_name} w3nco::w3nco_4 bacio::bacio_4)
target_link_libraries(${exe_name} PRIVATE w3nco::w3nco_4 bacio::bacio_4)

install(TARGETS ${exe_name} RUNTIME DESTINATION bin)

0 comments on commit 95eef19

Please sign in to comment.