Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a unique path name for each find_library #18

Merged
merged 1 commit into from
Feb 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Modules/Findbacio.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ if(DEFINED ENV{BACIO_LIB4})

if(EXISTS ${${uppercase_name}_LIB${kind}} )
get_filename_component(lib_dir ${${uppercase_name}_LIB${kind}} DIRECTORY)
find_library(lib_path NAMES ${versioned_lib_name} PATHS ${lib_dir} NO_DEFAULT_PATH)
find_library(bacio_path_${kind} NAMES ${versioned_lib_name} PATHS ${lib_dir} NO_DEFAULT_PATH)

add_library(${lib_name} STATIC IMPORTED)
set_target_properties(${lib_name} PROPERTIES
IMPORTED_LOCATION ${lib_path})
IMPORTED_LOCATION ${bacio_path_${kind}})
endif()
endforeach()

Expand Down
4 changes: 2 additions & 2 deletions Modules/Findbufr.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ if(DEFINED ENV{BUFR_LIB4} )

if(EXISTS ${${uppercase_name}_LIB${kind}} )
get_filename_component(lib_dir ${${uppercase_name}_LIB${kind}} DIRECTORY)
find_library(lib_path NAMES ${versioned_lib_name} PATHS ${lib_dir} NO_DEFAULT_PATH)
find_library(bufr_path_${kind} NAMES ${versioned_lib_name} PATHS ${lib_dir} NO_DEFAULT_PATH)

add_library(${lib_name} STATIC IMPORTED)
set_target_properties(${lib_name} PROPERTIES
IMPORTED_LOCATION ${lib_path})
IMPORTED_LOCATION ${bufr_path_${kind}})
endif()
endforeach()

Expand Down
4 changes: 2 additions & 2 deletions Modules/Findcrtm.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ if(DEFINED ENV{CRTM_LIB})
set(versioned_lib_name ${name}_${version})

get_filename_component(lib_dir ${${uppercase_name}_LIB} DIRECTORY)
find_library(lib_path NAMES ${versioned_lib_name} PATHS ${lib_dir} NO_DEFAULT_PATH)
find_library(crtm_path NAMES ${versioned_lib_name} PATHS ${lib_dir} NO_DEFAULT_PATH)

add_library(${name} STATIC IMPORTED)
set_target_properties(${name} PROPERTIES
IMPORTED_LOCATION ${lib_path}
IMPORTED_LOCATION ${crtm_path}
INTERFACE_INCLUDE_DIRECTORIES ${${uppercase_name}_INC})
endif()
4 changes: 2 additions & 2 deletions Modules/Findg2.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ if(DEFINED ENV{G2_LIBd})

if(EXISTS ${${uppercase_name}_LIB${kind}} )
get_filename_component(lib_dir ${${uppercase_name}_LIB${kind}} DIRECTORY)
find_library(lib_path NAMES ${versioned_lib_name} PATHS ${lib_dir} NO_DEFAULT_PATH)
find_library(g2_path_${kind} NAMES ${versioned_lib_name} PATHS ${lib_dir} NO_DEFAULT_PATH)

add_library(${lib_name} STATIC IMPORTED)
set_target_properties(${lib_name} PROPERTIES
IMPORTED_LOCATION ${lib_path}
IMPORTED_LOCATION ${g2_path_${kind}}
INTERFACE_INCLUDE_DIRECTORIES ${${uppercase_name}_INC${kind}})
endif()
endforeach()
Expand Down
4 changes: 2 additions & 2 deletions Modules/Findg2tmpl.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ if(DEFINED ENV{G2TMPL_LIBd} )

if(EXISTS ${${uppercase_name}_LIB${kind}} )
get_filename_component(lib_dir ${${uppercase_name}_LIB${kind}} DIRECTORY)
find_library(lib_path NAMES ${versioned_lib_name} PATHS ${lib_dir} NO_DEFAULT_PATH)
find_library(g2tmpl_path NAMES ${versioned_lib_name} PATHS ${lib_dir} NO_DEFAULT_PATH)

add_library(${lib_name} STATIC IMPORTED)
set_target_properties(${lib_name} PROPERTIES
IMPORTED_LOCATION ${lib_path}
IMPORTED_LOCATION ${g2tmpl_path}
INTERFACE_INCLUDE_DIRECTORIES ${${uppercase_name}_INC${kind}})
endif()
endforeach()
Expand Down
4 changes: 2 additions & 2 deletions Modules/Findgfsio.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ if(DEFINED ENV{GFSIO_LIB4} )

if(EXISTS ${${uppercase_name}_LIB${kind}} )
get_filename_component(lib_dir ${${uppercase_name}_LIB${kind}} DIRECTORY)
find_library(lib_path NAMES ${versioned_lib_name} PATHS ${lib_dir} NO_DEFAULT_PATH)
find_library(gfsio_path NAMES ${versioned_lib_name} PATHS ${lib_dir} NO_DEFAULT_PATH)

add_library(${lib_name} STATIC IMPORTED)
set_target_properties(${lib_name} PROPERTIES
IMPORTED_LOCATION ${lib_path}
IMPORTED_LOCATION ${gfsio_path}
INTERFACE_INCLUDE_DIRECTORIES ${${uppercase_name}_INC${kind}})
endif()
endforeach()
Expand Down
4 changes: 2 additions & 2 deletions Modules/Findip.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ if(DEFINED ENV{IP_LIBd} )

if(EXISTS ${${uppercase_name}_LIB${kind}} )
get_filename_component(lib_dir ${${uppercase_name}_LIB${kind}} DIRECTORY)
find_library(lib_path NAMES ${versioned_lib_name} PATHS ${lib_dir} NO_DEFAULT_PATH)
find_library(ip_path_${kind} NAMES ${versioned_lib_name} PATHS ${lib_dir} NO_DEFAULT_PATH)

add_library(${lib_name} STATIC IMPORTED)
set_target_properties(${lib_name} PROPERTIES
IMPORTED_LOCATION ${lib_path}
IMPORTED_LOCATION ${ip_path_${kind}}
INTERFACE_INCLUDE_DIRECTORIES ${${uppercase_name}_INC${kind}})
endif()
endforeach()
Expand Down
4 changes: 2 additions & 2 deletions Modules/Findlandsfcutil.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ if(DEFINED ENV{LANDSFCUTIL_LIB4} )

if(EXISTS ${${uppercase_name}_LIB${kind}} )
get_filename_component(lib_dir ${${uppercase_name}_LIB${kind}} DIRECTORY)
find_library(lib_path NAMES ${versioned_lib_name} PATHS ${lib_dir} NO_DEFAULT_PATH)
find_library(landsfcutil_path_${kind} NAMES ${versioned_lib_name} PATHS ${lib_dir} NO_DEFAULT_PATH)

add_library(${lib_name} STATIC IMPORTED)
set_target_properties(${lib_name} PROPERTIES
IMPORTED_LOCATION ${lib_path}
IMPORTED_LOCATION ${landsfcutil_path_${kind}}
INTERFACE_INCLUDE_DIRECTORIES ${${uppercase_name}_INC${kind}})
endif()
endforeach()
Expand Down
4 changes: 2 additions & 2 deletions Modules/Findnemsio.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ if(DEFINED ENV{NEMSIO_LIB} )
if(EXISTS ${${uppercase_name}_LIB} )
message("found ${${uppercase_name}_LIB}")
get_filename_component(lib_dir ${${uppercase_name}_LIB} DIRECTORY)
find_library(lib_path NAMES ${versioned_lib_name} PATHS ${lib_dir} NO_DEFAULT_PATH)
find_library(nemsio_path NAMES ${versioned_lib_name} PATHS ${lib_dir} NO_DEFAULT_PATH)

add_library(${name} STATIC IMPORTED)
set_target_properties(${name} PROPERTIES
IMPORTED_LOCATION ${lib_path}
IMPORTED_LOCATION ${nemsio_path}
INTERFACE_INCLUDE_DIRECTORIES ${${uppercase_name}_INC})
endif()
endif()
4 changes: 2 additions & 2 deletions Modules/Findnemsiogfs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ if(DEFINED ENV{NEMSIOGFS_LIB} )

if(EXISTS ${${uppercase_name}_LIB${kind}} )
get_filename_component(lib_dir ${${uppercase_name}_LIB$} DIRECTORY)
find_library(lib_path NAMES ${versioned_lib_name} PATHS ${lib_dir} NO_DEFAULT_PATH)
find_library(nemsiogfs_path NAMES ${versioned_lib_name} PATHS ${lib_dir} NO_DEFAULT_PATH)

add_library(${name} STATIC IMPORTED)
set_target_properties(${name} PROPERTIES
IMPORTED_LOCATION ${lib_path}
IMPORTED_LOCATION ${nemsiogfs_path}
INTERFACE_INCLUDE_DIRECTORIES ${${uppercase_name}_INC})
endif()
endif()
4 changes: 2 additions & 2 deletions Modules/Findsfcio.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ if(DEFINED ENV{SFCIO_LIB4} )

if(EXISTS ${${uppercase_name}_LIB${kind}} )
get_filename_component(lib_dir ${${uppercase_name}_LIB${kind}} DIRECTORY)
find_library(lib_path NAMES ${versioned_lib_name} PATHS ${lib_dir} NO_DEFAULT_PATH)
find_library(sfcio_path NAMES ${versioned_lib_name} PATHS ${lib_dir} NO_DEFAULT_PATH)

add_library(${lib_name} STATIC IMPORTED)
set_target_properties(${lib_name} PROPERTIES
IMPORTED_LOCATION ${lib_path}
IMPORTED_LOCATION ${sfcio_path}
INTERFACE_INCLUDE_DIRECTORIES ${${uppercase_name}_INC${kind}})
endif()
endforeach()
Expand Down
4 changes: 2 additions & 2 deletions Modules/Findsigio.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ if(DEFINED ENV{SIGIO_LIB4} )

if(EXISTS ${${uppercase_name}_LIB${kind}} )
get_filename_component(lib_dir ${${uppercase_name}_LIB${kind}} DIRECTORY)
find_library(lib_path NAMES ${versioned_lib_name} PATHS ${lib_dir} NO_DEFAULT_PATH)
find_library(sigio_path NAMES ${versioned_lib_name} PATHS ${lib_dir} NO_DEFAULT_PATH)

add_library(${lib_name} STATIC IMPORTED)
set_target_properties(${lib_name} PROPERTIES
IMPORTED_LOCATION ${lib_path}
IMPORTED_LOCATION ${sigio_path}
INTERFACE_INCLUDE_DIRECTORIES ${${uppercase_name}_INC${kind}})
endif()
endforeach()
Expand Down
8 changes: 4 additions & 4 deletions Modules/Findsp.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This module looks for environment variables detailing where SP lib is
# If variables are not set, SP will be built from external source

if(DEFINED ENV{SP_LIBd} )
if(DEFINED ENV{SP_LIBd})
set(SP_LIBd $ENV{SP_LIBd} CACHE STRING "SP_d Library Location" )
set(SP_LIB4 $ENV{SP_LIB4} CACHE STRING "SP_4 Library Location" )
set(SP_LIB8 $ENV{SP_LIB8} CACHE STRING "SP_8 Library Location" )
Expand All @@ -19,11 +19,11 @@ if(DEFINED ENV{SP_LIBd} )

if(EXISTS ${${uppercase_name}_LIB${kind}} )
get_filename_component(lib_dir ${${uppercase_name}_LIB${kind}} DIRECTORY)
find_library(lib_path NAMES ${versioned_lib_name} PATHS ${lib_dir} NO_DEFAULT_PATH)
find_library(sp_path_${kind} NAMES ${versioned_lib_name} PATHS ${lib_dir} NO_DEFAULT_PATH)

add_library(${lib_name} STATIC IMPORTED)
set_target_properties(${lib_name} PROPERTIES
IMPORTED_LOCATION ${lib_path})
IMPORTED_LOCATION ${sp_path_${kind}})
endif()
endforeach()
endif()
4 changes: 2 additions & 2 deletions Modules/Findw3emc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ if(DEFINED ENV{W3EMC_LIBd} )

if((EXISTS ${${uppercase_name}_LIB${kind}}) AND (EXISTS ${${uppercase_name}_INC${kind}}))
get_filename_component(lib_dir ${${uppercase_name}_LIB${kind}} DIRECTORY)
find_library(lib_path NAMES ${versioned_lib_name} PATHS ${lib_dir} NO_DEFAULT_PATH)
find_library(w3emc_path_${kind} NAMES ${versioned_lib_name} PATHS ${lib_dir} NO_DEFAULT_PATH)

add_library(${lib_name} STATIC IMPORTED)
set_target_properties(${lib_name} PROPERTIES
IMPORTED_LOCATION ${lib_path}
IMPORTED_LOCATION ${w3emc_path_${kind}}
INTERFACE_INCLUDE_DIRECTORIES ${${uppercase_name}_INC${kind}})
endif()
endforeach()
Expand Down
4 changes: 2 additions & 2 deletions Modules/Findw3nco.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ if(DEFINED ENV{W3NCO_LIBd} )

if(EXISTS ${${uppercase_name}_LIB${kind}} )
get_filename_component(lib_dir ${${uppercase_name}_LIB${kind}} DIRECTORY)
find_library(lib_path NAMES ${versioned_lib_name} PATHS ${lib_dir} NO_DEFAULT_PATH)
find_library(w3nco_path_${kind} NAMES ${versioned_lib_name} PATHS ${lib_dir} NO_DEFAULT_PATH)

add_library(${lib_name} STATIC IMPORTED)
set_target_properties(${lib_name} PROPERTIES
IMPORTED_LOCATION ${lib_path})
IMPORTED_LOCATION ${w3nco_path_${kind}})
endif()
endforeach()
endif()