Revision: 77569
http://sourceforge.net/p/brlcad/code/77569
Author: starseeker
Date: 2020-10-23 02:08:22 +0000 (Fri, 23 Oct 2020)
Log Message:
-----------
Pull in GDAL build updates from thirdparty_rework
Modified Paths:
--------------
brlcad/branches/extbuild/src/other/ext/gdal/CMake/FindPROJ4.cmake
brlcad/branches/extbuild/src/other/ext/gdal/CMakeLists.txt
brlcad/branches/extbuild/src/other/ext/gdal/frmts/gtiff/libgeotiff/CMakeLists.txt
brlcad/branches/extbuild/src/other/ext/gdal/frmts/gtiff/libtiff/CMakeLists.txt
brlcad/branches/extbuild/src/other/ext/gdal/frmts/ozi/CMakeLists.txt
brlcad/branches/extbuild/src/other/ext/gdal/frmts/png/CMakeLists.txt
brlcad/branches/extbuild/src/other/ext/gdal/frmts/rik/CMakeLists.txt
brlcad/branches/extbuild/src/other/ext/gdal/ogr/CMakeLists.txt
brlcad/branches/extbuild/src/other/ext/gdal/port/CMakeLists.txt
Modified: brlcad/branches/extbuild/src/other/ext/gdal/CMake/FindPROJ4.cmake
===================================================================
--- brlcad/branches/extbuild/src/other/ext/gdal/CMake/FindPROJ4.cmake
2020-10-23 02:05:19 UTC (rev 77568)
+++ brlcad/branches/extbuild/src/other/ext/gdal/CMake/FindPROJ4.cmake
2020-10-23 02:08:22 UTC (rev 77569)
@@ -11,44 +11,36 @@
#
# Copyright (c) 2009 Mateusz Loskot <[email protected]>
#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
#
-# 1. Redistributions of source code must retain the copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. The name of the author may not be used to endorse or promote products
-# derived from this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
-# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
###############################################################################
-# Try to use OSGeo4W installation
-if(WIN32)
- set(PROJ4_OSGEO4W_HOME "C:/OSGeo4W")
+set(_PROJ4_SEARCHES)
- if($ENV{OSGEO4W_HOME})
- set(PROJ4_OSGEO4W_HOME "$ENV{OSGEO4W_HOME}")
- endif()
+# Search PROJ4_ROOT first if it is set.
+if(PROJ4_ROOT)
+ set(_PROJ4_SEARCH_ROOT PATHS ${PROJ4_ROOT} NO_DEFAULT_PATH)
+ list(APPEND _PROJ4_SEARCHES _PROJ4_SEARCH_ROOT)
endif()
-find_path(PROJ4_INCLUDE_DIR proj_api.h
- PATHS ${PROJ4_ROOT}/include/proj ${PROJ4_OSGEO4W_HOME}/include
- DOC "Path to PROJ.4 library include directory")
+# Normal search.
+set(_PROJ4_x86 "(x86)")
+set(_PROJ4_SEARCH_NORMAL
+ PATHS
+ "$ENV{OSGEO4W_HOME}"
+ "C:/OSGeo4W"
+ "$ENV{ProgramFiles}/proj4"
+ "$ENV{ProgramFiles${_PROJ4_x86}}/proj4"
+ )
+ unset(_PROJ4_x86)
+list(APPEND _PROJ4_SEARCHES _PROJ4_SEARCH_NORMAL)
+# Try each search configuration.
+foreach(search ${_PROJ4_SEARCHES})
+ find_path(PROJ4_INCLUDE_DIR NAMES proj_api.h ${${search}} PATH_SUFFIXES
include include/proj4 proj4 include/proj proj)
+endforeach()
+
if (PROJ4_INCLUDE_DIR)
# Extract version from proj_api.h (ex: 480)
file(STRINGS ${PROJ4_INCLUDE_DIR}/proj_api.h
@@ -61,10 +53,12 @@
endif()
set(PROJ4_NAMES ${PROJ4_NAMES} proj proj_i)
-find_library(PROJ4_LIBRARY
- NAMES ${PROJ4_NAMES}
- PATHS ${PROJ4_ROOT}/lib64 ${PROJ4_ROOT}/lib ${PROJ4_OSGEO4W_HOME}/lib
- DOC "Path to PROJ.4 library file")
+if(NOT PROJ4_LIBRARY)
+ foreach(search ${_PROJ4_SEARCHES})
+ find_library(PROJ4_LIBRARY NAMES ${PROJ4_NAMES} NAMES_PER_DIR
${${search}} PATH_SUFFIXES lib)
+ endforeach()
+endif()
+unset(PROJ4_NAMES)
if(PROJ4_LIBRARY)
set(PROJ4_LIBRARIES ${PROJ4_LIBRARY})
Modified: brlcad/branches/extbuild/src/other/ext/gdal/CMakeLists.txt
===================================================================
--- brlcad/branches/extbuild/src/other/ext/gdal/CMakeLists.txt 2020-10-23
02:05:19 UTC (rev 77568)
+++ brlcad/branches/extbuild/src/other/ext/gdal/CMakeLists.txt 2020-10-23
02:08:22 UTC (rev 77569)
@@ -224,6 +224,7 @@
endif(NOT "${CMAKE_SYSTEM_PROCESSOR}" MATCHES "x86_64" AND NOT
"${CMAKE_SYSTEM_PROCESSOR}" MATCHES "i*86" AND NOT "${CMAKE_SYSTEM_PROCESSOR}"
MATCHES "AMD64")
# Threads
+include(CMakePushCheckState)
CHECK_INCLUDE_FILE(pthread.h PROBE_PTHREAD_H)
if (NOT PROBE_PTHREAD_H)
cmake_push_check_state(RESET)
@@ -328,6 +329,8 @@
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_CURRENT_BINARY_DIR}/cpl_config.h.tmp
${CMAKE_CURRENT_BINARY_DIR}/cpl_config.h)
execute_process(COMMAND ${CMAKE_COMMAND} -E remove
${CMAKE_CURRENT_BINARY_DIR}/cpl_config.h.tmp)
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/cpl_config.h DESTINATION
include/gdal)
+
add_subdirectory(port)
add_subdirectory(gcore)
add_subdirectory(alg)
@@ -382,12 +385,9 @@
if (BUILD_STATIC_LIBS)
add_library(gdal-static STATIC ${gdal_srcs})
- if (MSVC)
- # msvc does not append 'lib' - do it here to have consistent name
- set_target_properties(gdal-static PROPERTIES PREFIX "lib")
- else (MSVC)
+ if (NOT MSVC)
set_target_properties(gdal-static PROPERTIES OUTPUT_NAME "gdal")
- endif (MSVC)
+ endif (NOT MSVC)
install(TARGETS gdal-static
RUNTIME DESTINATION ${BIN_DIR}
LIBRARY DESTINATION ${LIB_DIR}
Modified:
brlcad/branches/extbuild/src/other/ext/gdal/frmts/gtiff/libgeotiff/CMakeLists.txt
===================================================================
---
brlcad/branches/extbuild/src/other/ext/gdal/frmts/gtiff/libgeotiff/CMakeLists.txt
2020-10-23 02:05:19 UTC (rev 77568)
+++
brlcad/branches/extbuild/src/other/ext/gdal/frmts/gtiff/libgeotiff/CMakeLists.txt
2020-10-23 02:08:22 UTC (rev 77569)
@@ -1,6 +1,7 @@
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/../libtiff
+ ${PROJ4_INCLUDE_DIRS}
)
set(libgeotiff_srcs
@@ -24,3 +25,7 @@
add_library(libgeotiff_obj OBJECT ${libgeotiff_srcs})
set_target_properties(libgeotiff_obj PROPERTIES FOLDER "Third Party
Libraries/GDAL")
+if(TARGET proj)
+ add_dependencies(libgeotiff_obj proj)
+endif(TARGET proj)
+
Modified:
brlcad/branches/extbuild/src/other/ext/gdal/frmts/gtiff/libtiff/CMakeLists.txt
===================================================================
---
brlcad/branches/extbuild/src/other/ext/gdal/frmts/gtiff/libtiff/CMakeLists.txt
2020-10-23 02:05:19 UTC (rev 77568)
+++
brlcad/branches/extbuild/src/other/ext/gdal/frmts/gtiff/libtiff/CMakeLists.txt
2020-10-23 02:08:22 UTC (rev 77569)
@@ -1,5 +1,6 @@
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
+ ${ZLIB_INCLUDE_DIRS}
)
set(libtiff_srcs
@@ -51,3 +52,7 @@
add_library(libtiff_obj OBJECT ${libtiff_srcs})
set_target_properties(libtiff_obj PROPERTIES FOLDER "Third Party
Libraries/GDAL")
+if (TARGET "${ZLIB_LIBRARY}")
+ add_dependencies(libtiff_obj "${ZLIB_LIBRARY}")
+endif (TARGET "${ZLIB_LIBRARY}")
+
Modified: brlcad/branches/extbuild/src/other/ext/gdal/frmts/ozi/CMakeLists.txt
===================================================================
--- brlcad/branches/extbuild/src/other/ext/gdal/frmts/ozi/CMakeLists.txt
2020-10-23 02:05:19 UTC (rev 77568)
+++ brlcad/branches/extbuild/src/other/ext/gdal/frmts/ozi/CMakeLists.txt
2020-10-23 02:08:22 UTC (rev 77569)
@@ -1,2 +1,9 @@
-include_directories(${CMAKE_CURRENT_SOURCE_DIR})
+include_directories(
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${ZLIB_INCLUDE_DIRS}
+ )
add_library(frmt_ozi OBJECT ozidataset.cpp)
+if (TARGET "${ZLIB_LIBRARY}")
+ add_dependencies(frmt_ozi ${ZLIB_LIBRARY})
+endif (TARGET "${ZLIB_LIBRARY}")
+
Modified: brlcad/branches/extbuild/src/other/ext/gdal/frmts/png/CMakeLists.txt
===================================================================
--- brlcad/branches/extbuild/src/other/ext/gdal/frmts/png/CMakeLists.txt
2020-10-23 02:05:19 UTC (rev 77568)
+++ brlcad/branches/extbuild/src/other/ext/gdal/frmts/png/CMakeLists.txt
2020-10-23 02:08:22 UTC (rev 77569)
@@ -1,4 +1,8 @@
-include_directories(${CMAKE_CURRENT_SOURCE_DIR})
+include_directories(
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${ZLIB_INCLUDE_DIRS}
+ ${PNG_INCLUDE_DIRS}
+ )
add_library(frmt_png OBJECT pngdataset.cpp)
if (TARGET png)
add_dependencies(frmt_png png)
Modified: brlcad/branches/extbuild/src/other/ext/gdal/frmts/rik/CMakeLists.txt
===================================================================
--- brlcad/branches/extbuild/src/other/ext/gdal/frmts/rik/CMakeLists.txt
2020-10-23 02:05:19 UTC (rev 77568)
+++ brlcad/branches/extbuild/src/other/ext/gdal/frmts/rik/CMakeLists.txt
2020-10-23 02:08:22 UTC (rev 77569)
@@ -1,2 +1,9 @@
-include_directories(${CMAKE_CURRENT_SOURCE_DIR})
+include_directories(
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${ZLIB_INCLUDE_DIRS}
+ )
add_library(frmt_rik OBJECT rikdataset.cpp)
+if (TARGET "${ZLIB_LIBRARY}")
+ add_dependencies(frmt_rik ${ZLIB_LIBRARY})
+endif (TARGET "${ZLIB_LIBRARY}")
+
Modified: brlcad/branches/extbuild/src/other/ext/gdal/ogr/CMakeLists.txt
===================================================================
--- brlcad/branches/extbuild/src/other/ext/gdal/ogr/CMakeLists.txt
2020-10-23 02:05:19 UTC (rev 77568)
+++ brlcad/branches/extbuild/src/other/ext/gdal/ogr/CMakeLists.txt
2020-10-23 02:08:22 UTC (rev 77569)
@@ -7,6 +7,7 @@
${CMAKE_CURRENT_SOURCE_DIR}/ogrsf_frmts/mem
${CMAKE_CURRENT_SOURCE_DIR}/ogrsf_frmts/geojson
${CMAKE_CURRENT_SOURCE_DIR}/ogrsf_frmts/geojson/libjson
+ ${PROJ4_INCLUDE_DIRS}
)
set(ogr_srcs
@@ -77,4 +78,7 @@
add_library(gdal_ogr_obj OBJECT ${ogr_srcs})
set_target_properties(gdal_ogr_obj PROPERTIES FOLDER "Third Party
Libraries/GDAL")
+if(TARGET proj)
+ add_dependencies(gdal_ogr_obj proj)
+endif(TARGET proj)
Modified: brlcad/branches/extbuild/src/other/ext/gdal/port/CMakeLists.txt
===================================================================
--- brlcad/branches/extbuild/src/other/ext/gdal/port/CMakeLists.txt
2020-10-23 02:05:19 UTC (rev 77568)
+++ brlcad/branches/extbuild/src/other/ext/gdal/port/CMakeLists.txt
2020-10-23 02:08:22 UTC (rev 77569)
@@ -1,3 +1,7 @@
+include_directories(
+ ${ZLIB_INCLUDE_DIRS}
+ )
+
set(cpl_srcs
cpl_conv.cpp
cpl_error.cpp
@@ -65,4 +69,7 @@
add_library(gdal_cpl_obj OBJECT ${cpl_srcs})
set_target_properties(gdal_cpl_obj PROPERTIES FOLDER "Third Party
Libraries/GDAL")
+if (TARGET "${ZLIB_LIBRARY}")
+ add_dependencies(gdal_cpl_obj ${ZLIB_LIBRARY})
+endif (TARGET "${ZLIB_LIBRARY}")
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits