From ef78d84ff219e1083e903e9e8a8add96cb14f431 Mon Sep 17 00:00:00 2001 From: kgerheiser Date: Wed, 2 Sep 2020 18:23:10 -0400 Subject: [PATCH] Give all target_link_libraries explicit PRIVATE signatures The two signatures (with and without) don't mix and throws an error. --- sorc/copygb2.fd/CMakeLists.txt | 3 +-- sorc/degrib2.fd/CMakeLists.txt | 3 +-- sorc/grb2index.fd/CMakeLists.txt | 2 +- sorc/grbindex.fd/CMakeLists.txt | 2 +- sorc/grib2grib.fd/CMakeLists.txt | 2 +- sorc/tocgrib.fd/CMakeLists.txt | 2 +- sorc/tocgrib2super.fd/CMakeLists.txt | 3 +-- sorc/wgrib.cd/CMakeLists.txt | 2 +- 8 files changed, 8 insertions(+), 11 deletions(-) diff --git a/sorc/copygb2.fd/CMakeLists.txt b/sorc/copygb2.fd/CMakeLists.txt index eefd37a7..93757a96 100644 --- a/sorc/copygb2.fd/CMakeLists.txt +++ b/sorc/copygb2.fd/CMakeLists.txt @@ -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} diff --git a/sorc/degrib2.fd/CMakeLists.txt b/sorc/degrib2.fd/CMakeLists.txt index a05158bb..f17ceee0 100644 --- a/sorc/degrib2.fd/CMakeLists.txt +++ b/sorc/degrib2.fd/CMakeLists.txt @@ -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 diff --git a/sorc/grb2index.fd/CMakeLists.txt b/sorc/grb2index.fd/CMakeLists.txt index 1b04c846..c61e70e6 100644 --- a/sorc/grb2index.fd/CMakeLists.txt +++ b/sorc/grb2index.fd/CMakeLists.txt @@ -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) diff --git a/sorc/grbindex.fd/CMakeLists.txt b/sorc/grbindex.fd/CMakeLists.txt index c06086f6..07c9ca41 100644 --- a/sorc/grbindex.fd/CMakeLists.txt +++ b/sorc/grbindex.fd/CMakeLists.txt @@ -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) diff --git a/sorc/grib2grib.fd/CMakeLists.txt b/sorc/grib2grib.fd/CMakeLists.txt index ea8c0c2f..4eb707a0 100644 --- a/sorc/grib2grib.fd/CMakeLists.txt +++ b/sorc/grib2grib.fd/CMakeLists.txt @@ -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) diff --git a/sorc/tocgrib.fd/CMakeLists.txt b/sorc/tocgrib.fd/CMakeLists.txt index 6f84b105..99be710c 100644 --- a/sorc/tocgrib.fd/CMakeLists.txt +++ b/sorc/tocgrib.fd/CMakeLists.txt @@ -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) diff --git a/sorc/tocgrib2super.fd/CMakeLists.txt b/sorc/tocgrib2super.fd/CMakeLists.txt index 3ad6dc62..4f81722a 100644 --- a/sorc/tocgrib2super.fd/CMakeLists.txt +++ b/sorc/tocgrib2super.fd/CMakeLists.txt @@ -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 diff --git a/sorc/wgrib.cd/CMakeLists.txt b/sorc/wgrib.cd/CMakeLists.txt index 05091e5f..983a0485 100644 --- a/sorc/wgrib.cd/CMakeLists.txt +++ b/sorc/wgrib.cd/CMakeLists.txt @@ -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)