Changeset 28164
- Timestamp:
- 03/21/24 14:50:40 (20 months ago)
- Location:
- issm/trunk-jpl/externalpackages/gmt
- Files:
-
- 3 edited
-
configs/6.5/static/cmake/modules/FindGDAL.cmake.patch (modified) (2 diffs)
-
install-6-linux-static.sh (modified) (1 diff)
-
install-6-linux.sh (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/externalpackages/gmt/configs/6.5/static/cmake/modules/FindGDAL.cmake.patch
r28161 r28164 1 --- src/cmake/modules/FindGDAL.cmake 2024-03-20 19:47:152 +++ FindGDAL.cmake 2024-03-20 19:55:541 --- src/cmake/modules/FindGDAL.cmake 2024-03-20 19:47:15 2 +++ FindGDAL.cmake 2024-03-20 19:55:54 3 3 @@ -81,12 +81,25 @@ 4 ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE5 OUTPUT_VARIABLE GDAL_CONFIG_LIBS)6 if (GDAL_CONFIG_LIBS)7 - string (REGEX MATCHALL "-l[^ ]+" _gdal_dashl ${GDAL_CONFIG_LIBS})8 - string (REGEX REPLACE "-l" "" _gdal_lib "${_gdal_dashl}")9 - string (REGEX MATCHALL "-L[^ ]+" _gdal_dashL ${GDAL_CONFIG_LIBS})10 - string (REGEX REPLACE "-L" "" _gdal_libpath "${_gdal_dashL}")11 + string (REGEX MATCHALL "(^| )-l[^ ]+" _gdal_dashl ${GDAL_CONFIG_LIBS})12 + string (REGEX REPLACE "(^| )-l" "" _gdal_lib "${_gdal_dashl}")13 + string (REGEX MATCHALL "(^| )-L[^ ]+" _gdal_dashL ${GDAL_CONFIG_LIBS})14 + string (REGEX REPLACE "(^| )-L" "" _gdal_libpath "${_gdal_dashL}")15 endif (GDAL_CONFIG_LIBS)16 + execute_process (COMMAND ${GDAL_CONFIG} --dep-libs17 + ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE18 + OUTPUT_VARIABLE GDAL_CONFIG_DEP_LIBS)19 + if (GDAL_CONFIG_DEP_LIBS)20 + string (REGEX MATCHALL "(^| )-l[^ ]+" _gdal_dashl ${GDAL_CONFIG_DEP_LIBS})21 + string (REGEX REPLACE "(^| )-l" "" _gdal_dep_lib "${_gdal_dashl}")22 + string (REGEX MATCHALL "(^| )-L[^ ]+" _gdal_dashL ${GDAL_CONFIG_DEP_LIBS})23 + string (REGEX REPLACE "(^| )-L" "" _gdal_dep_libpath "${_gdal_dashL}")24 + endif (GDAL_CONFIG_DEP_LIBS)25 endif (GDAL_CONFIG)26 + if (_gdal_dep_lib)27 + list (REMOVE_DUPLICATES _gdal_dep_lib)28 + list (REMOVE_ITEM _gdal_dep_lib gdal)29 + endif (_gdal_dep_lib)4 ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE 5 OUTPUT_VARIABLE GDAL_CONFIG_LIBS) 6 if (GDAL_CONFIG_LIBS) 7 - string (REGEX MATCHALL "-l[^ ]+" _gdal_dashl ${GDAL_CONFIG_LIBS}) 8 - string (REGEX REPLACE "-l" "" _gdal_lib "${_gdal_dashl}") 9 - string (REGEX MATCHALL "-L[^ ]+" _gdal_dashL ${GDAL_CONFIG_LIBS}) 10 - string (REGEX REPLACE "-L" "" _gdal_libpath "${_gdal_dashL}") 11 + string (REGEX MATCHALL "(^| )-l[^ ]+" _gdal_dashl ${GDAL_CONFIG_LIBS}) 12 + string (REGEX REPLACE "(^| )-l" "" _gdal_lib "${_gdal_dashl}") 13 + string (REGEX MATCHALL "(^| )-L[^ ]+" _gdal_dashL ${GDAL_CONFIG_LIBS}) 14 + string (REGEX REPLACE "(^| )-L" "" _gdal_libpath "${_gdal_dashL}") 15 endif (GDAL_CONFIG_LIBS) 16 + execute_process (COMMAND ${GDAL_CONFIG} --dep-libs 17 + ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE 18 + OUTPUT_VARIABLE GDAL_CONFIG_DEP_LIBS) 19 + if (GDAL_CONFIG_DEP_LIBS) 20 + string (REGEX MATCHALL "(^| )-l[^ ]+" _gdal_dashl ${GDAL_CONFIG_DEP_LIBS}) 21 + string (REGEX REPLACE "(^| )-l" "" _gdal_dep_lib "${_gdal_dashl}") 22 + string (REGEX MATCHALL "(^| )-L[^ ]+" _gdal_dashL ${GDAL_CONFIG_DEP_LIBS}) 23 + string (REGEX REPLACE "(^| )-L" "" _gdal_dep_libpath "${_gdal_dashL}") 24 + endif (GDAL_CONFIG_DEP_LIBS) 25 endif (GDAL_CONFIG) 26 + if (_gdal_dep_lib) 27 + list (REMOVE_DUPLICATES _gdal_dep_lib) 28 + list (REMOVE_ITEM _gdal_dep_lib gdal) 29 + endif (_gdal_dep_lib) 30 30 endif (UNIX AND NOT GDAL_FOUND) 31 31 32 32 find_path (GDAL_INCLUDE_DIR gdal.h 33 33 @@ -129,6 +142,46 @@ 34 /usr/local34 /usr/local 35 35 ) 36 36 37 37 +# find all libs that gdal-config --dep-libs reports 38 38 +foreach (_extralib ${_gdal_dep_lib}) 39 + find_library (_found_lib_${_extralib}40 + NAMES ${_extralib}41 + HINTS42 + ${HDF5_ROOT}43 + $ENV{HDF5_ROOT}44 + ${NETCDF_ROOT}45 + $ENV{NETCDF_ROOT}46 + ${ZLIB_ROOT}47 + $ENV{ZLIB_ROOT}48 + ${CURL_ROOT}49 + $ENV{CURL_ROOT}50 + PATH_SUFFIXES lib51 + PATHS52 + ${_gdal_dep_libpath}53 + )54 + list (APPEND GDAL_LIBRARY ${_found_lib_${_extralib}})39 + find_library (_found_lib_${_extralib} 40 + NAMES ${_extralib} 41 + HINTS 42 + ${HDF5_ROOT} 43 + $ENV{HDF5_ROOT} 44 + ${NETCDF_ROOT} 45 + $ENV{NETCDF_ROOT} 46 + ${ZLIB_ROOT} 47 + $ENV{ZLIB_ROOT} 48 + ${CURL_ROOT} 49 + $ENV{CURL_ROOT} 50 + PATH_SUFFIXES lib 51 + PATHS 52 + ${_gdal_dep_libpath} 53 + ) 54 + list (APPEND GDAL_LIBRARY ${_found_lib_${_extralib}}) 55 55 +endforeach (_extralib) 56 56 + … … 58 58 +# find all manually-supplied libs 59 59 +if (GDAL_EXTRA_LIBS) 60 + # Ensure -l is preceded by whitespace to not match61 + # '-l' in '-L/usr/lib/x86_64-linux-gnu/hdf5/serial'62 + string (REGEX MATCHALL "(^| )-l[^ ]+" _gdal_extra_lib_dashl ${GDAL_EXTRA_LIBS})63 + string (REGEX REPLACE "(^| )-l" "" _gdal_extra_lib "${_gdal_extra_lib_dashl}")64 + string (REGEX MATCHALL "(^| )-L[^ ]+" _gdal_extra_lib_dashL ${GDAL_EXTRA_LIBS})65 + string (REGEX REPLACE "(^| )-L" "" _gdal_extra_libpath "${_gdal_extra_lib_dashL}")66 + foreach (_extralib ${_gdal_extra_lib})67 + find_library (_found_lib_${_extralib}68 + NAMES ${_extralib}69 + PATH_SUFFIXES lib70 + PATHS71 + ${_gdal_extra_libpath}72 + )73 + list (APPEND GDAL_LIBRARY ${_found_lib_${_extralib}})74 + endforeach (_extralib)60 + # Ensure -l is preceded by whitespace to not match 61 + # '-l' in '-L/usr/lib/x86_64-linux-gnu/hdf5/serial' 62 + string (REGEX MATCHALL "(^| )-l[^ ]+" _gdal_extra_lib_dashl ${GDAL_EXTRA_LIBS}) 63 + string (REGEX REPLACE "(^| )-l" "" _gdal_extra_lib "${_gdal_extra_lib_dashl}") 64 + string (REGEX MATCHALL "(^| )-L[^ ]+" _gdal_extra_lib_dashL ${GDAL_EXTRA_LIBS}) 65 + string (REGEX REPLACE "(^| )-L" "" _gdal_extra_libpath "${_gdal_extra_lib_dashL}") 66 + foreach (_extralib ${_gdal_extra_lib}) 67 + find_library (_found_lib_${_extralib} 68 + NAMES ${_extralib} 69 + PATH_SUFFIXES lib 70 + PATHS 71 + ${_gdal_extra_libpath} 72 + ) 73 + list (APPEND GDAL_LIBRARY ${_found_lib_${_extralib}}) 74 + endforeach (_extralib) 75 75 +endif (GDAL_EXTRA_LIBS) 76 76 + -
issm/trunk-jpl/externalpackages/gmt/install-6-linux-static.sh
r27837 r28164 44 44 45 45 # Copy custom configuration files 46 cp ./configs/6 /static/linux/cmake/ConfigUser.static.cmake ./src/cmake/ConfigUser.cmake47 cp ./configs/6 /static/cmake/modules/FindGDAL.cmake ./src/cmake/modules48 cp ./configs/6 /static/cmake/modules/FindGSHHG.cmake ./src/cmake/modules49 cp ./configs/6 /static/cmake/modules/FindNETCDF.cmake ./src/cmake/modules50 cp ./configs/6 /static/src/CMakeLists.txt ./src/src46 cp ./configs/6.0/static/linux/cmake/ConfigUser.static.cmake ./src/cmake/ConfigUser.cmake 47 cp ./configs/6.0/static/cmake/modules/FindGDAL.cmake ./src/cmake/modules 48 cp ./configs/6.0/static/cmake/modules/FindGSHHG.cmake ./src/cmake/modules 49 cp ./configs/6.0/static/cmake/modules/FindNETCDF.cmake ./src/cmake/modules 50 cp ./configs/6.0/static/src/CMakeLists.txt ./src/src 51 51 52 52 # Configure -
issm/trunk-jpl/externalpackages/gmt/install-6-linux.sh
r27837 r28164 36 36 37 37 # Copy custom configuration files 38 cp ./configs/6 /linux/cmake/ConfigUser.cmake ./src/cmake38 cp ./configs/6.0/linux/cmake/ConfigUser.cmake ./src/cmake 39 39 40 40 # Configure
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/trac/issm/chrome/common/trac_banner.png)