Revision: 77282
http://sourceforge.net/p/brlcad/code/77282
Author: starseeker
Date: 2020-09-30 12:51:05 +0000 (Wed, 30 Sep 2020)
Log Message:
-----------
Still need to restore build flags, adjust PROJ4 finding to support _ROOT
specifier.
Modified Paths:
--------------
brlcad/branches/thirdparty_rework/CMakeLists.txt
brlcad/branches/thirdparty_rework/misc/CMake/FindPROJ4.cmake
brlcad/branches/thirdparty_rework/src/other/gdal/CMake/FindPROJ4.cmake
brlcad/branches/thirdparty_rework/src/superbuild/png.cmake
Modified: brlcad/branches/thirdparty_rework/CMakeLists.txt
===================================================================
--- brlcad/branches/thirdparty_rework/CMakeLists.txt 2020-09-30 12:40:32 UTC
(rev 77281)
+++ brlcad/branches/thirdparty_rework/CMakeLists.txt 2020-09-30 12:51:05 UTC
(rev 77282)
@@ -2074,6 +2074,12 @@
endif(${BRLCAD_ENABLE_TARGETS} GREATER 2)
endif(NOT BRLCAD_ENABLE_TARGETS)
+# Before we head into src/other and misc/tools, store all the build
+# flags that have been built up. It's hard to be sure what will and
+# won't be set in those directories, so make sure we can restore the
+# BRL-CAD flags for the actual BRL-CAD subdirectories.
+CACHE_BUILD_FLAGS(_BRLCAD)
+
# At the start, clear the misc/tools subdirs list so repeated
# configures will correctly add the required directories
set(MISC_ADDED_DIRS "" CACHE STRING "initialize 3rd party sub-directories
list" FORCE)
@@ -2093,6 +2099,10 @@
# tests so the CACHE reflects BRL-CAD's test results.
add_subdirectory(src/other)
+# Now put back the BRL-CAD flags
+RESTORE_CACHED_BUILD_FLAGS(_BRLCAD)
+
+
set(ITCL_VERSION "3.4")
CONFIG_H_APPEND(BRLCAD "#cmakedefine ITCL_VERSION \"${ITCL_VERSION}\"\n")
Modified: brlcad/branches/thirdparty_rework/misc/CMake/FindPROJ4.cmake
===================================================================
--- brlcad/branches/thirdparty_rework/misc/CMake/FindPROJ4.cmake
2020-09-30 12:40:32 UTC (rev 77281)
+++ brlcad/branches/thirdparty_rework/misc/CMake/FindPROJ4.cmake
2020-09-30 12:51:05 UTC (rev 77282)
@@ -16,19 +16,31 @@
#
###############################################################################
-# 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_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
@@ -41,10 +53,12 @@
endif()
set(PROJ4_NAMES ${PROJ4_NAMES} proj proj_i)
-find_library(PROJ4_LIBRARY
- NAMES ${PROJ4_NAMES}
- PATHS ${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/thirdparty_rework/src/other/gdal/CMake/FindPROJ4.cmake
===================================================================
--- brlcad/branches/thirdparty_rework/src/other/gdal/CMake/FindPROJ4.cmake
2020-09-30 12:40:32 UTC (rev 77281)
+++ brlcad/branches/thirdparty_rework/src/other/gdal/CMake/FindPROJ4.cmake
2020-09-30 12:51:05 UTC (rev 77282)
@@ -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/thirdparty_rework/src/superbuild/png.cmake
===================================================================
--- brlcad/branches/thirdparty_rework/src/superbuild/png.cmake 2020-09-30
12:40:32 UTC (rev 77281)
+++ brlcad/branches/thirdparty_rework/src/superbuild/png.cmake 2020-09-30
12:51:05 UTC (rev 77282)
@@ -39,7 +39,7 @@
BUILD_ALWAYS ${EXTERNAL_BUILD_UPDATE} ${LOG_OPTS}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}
-DCMAKE_INSTALL_LIBDIR=${LIB_DIR}
-DCMAKE_PREFIX_PATH=${CMAKE_BINARY_DIR}/${LIB_DIR}
-DCMAKE_INSTALL_RPATH=${CMAKE_BUILD_RPATH}
- -DPNG_STATIC=${BUILD_STATIC_LIBS} -DSKIP_INSTALL_EXECUTABLES=ON
+ -DPNG_STATIC=${BUILD_STATIC_LIBS} -DSKIP_INSTALL_EXECUTABLES=ON
-DSKIP_INSTALL_FILES=ON
-DSKIP_INSTALL_EXPORT=ON -DPNG_TESTS=OFF -Dld-version-script=OFF
-DZLIB_ROOT=$<$<BOOL:${ZLIB_TARGET}>:${CMAKE_BINARY_DIR}>
-DZLIB_LIBRARY=$<$<BOOL:${ZLIB_TARGET}>:${CMAKE_BINARY_DIR}/${LIB_DIR}/${ZLIB_BASENAME}${CMAKE_SHARED_LIBRARY_SUFFIX}>
-DPNG_LIB_NAME=${PNG_LIB_NAME} -DPNG_PREFIX=brl_
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