Revision: 77251
          http://sourceforge.net/p/brlcad/code/77251
Author:   starseeker
Date:     2020-09-27 18:52:31 +0000 (Sun, 27 Sep 2020)
Log Message:
-----------
The guard we put in so long ago to prevent detecting an already installed 
BRL-CAD works against us in the superbuild, since we actually do want to be 
searching CMAKE_INSTALL_PREFIX now (it is the equivalent of the 
CMAKE_BINARY_DIR as far as being the intermediate staging area for the 
subbuilds - assembling the final bundle for actual installation will have to be 
a separate step.)  Accordingly, we no longer want to filter on 
CMAKE_INSTALL_PREFIX here - it actually breaks what we're trying to do.  We do, 
however, still want to prevent any searching in the final (i.e. 
/usr/brlcad/...) locations.  Variable names may shift over time, but for now 
get CMAKE_INSTALL_PREFIX out of the filtering and stub in a notional 
BRLCAD_INSTALL_PREFIX so we can proceed.

Modified Paths:
--------------
    brlcad/branches/thirdparty_rework/misc/CMake/BRLCAD_Install_Prefix.cmake
    brlcad/branches/thirdparty_rework/misc/CMake/FindNETPBM.cmake
    brlcad/branches/thirdparty_rework/misc/CMake/FindUTAHRLE.cmake

Modified: 
brlcad/branches/thirdparty_rework/misc/CMake/BRLCAD_Install_Prefix.cmake
===================================================================
--- brlcad/branches/thirdparty_rework/misc/CMake/BRLCAD_Install_Prefix.cmake    
2020-09-27 17:43:58 UTC (rev 77250)
+++ brlcad/branches/thirdparty_rework/misc/CMake/BRLCAD_Install_Prefix.cmake    
2020-09-27 18:52:31 UTC (rev 77251)
@@ -46,12 +46,12 @@
 # To ensure the previous (and internally set) CMAKE_INSTALL_PREFIX value
 # is available, BRLCAD_PREFIX is used to store the value in the cache.)
 
-if(CMAKE_INSTALL_PREFIX)
-  if(NOT "${CMAKE_INSTALL_PREFIX}" STREQUAL "/usr" AND NOT 
"${CMAKE_INSTALL_PREFIX}" STREQUAL "/usr/local")
-    get_filename_component(PATH_NORMALIZED 
"${CMAKE_INSTALL_PREFIX}/${LIB_DIR}" ABSOLUTE)
+if(BRLCAD_INSTALL_PREFIX)
+  if(NOT "${BRLCAD_INSTALL_PREFIX}" STREQUAL "/usr" AND NOT 
"${BRLCAD_INSTALL_PREFIX}" STREQUAL "/usr/local")
+    get_filename_component(PATH_NORMALIZED 
"${BRLCAD_INSTALL_PREFIX}/${LIB_DIR}" ABSOLUTE)
     set(CMAKE_SYSTEM_IGNORE_PATH "${PATH_NORMALIZED}")
-  endif(NOT "${CMAKE_INSTALL_PREFIX}" STREQUAL "/usr" AND NOT 
"${CMAKE_INSTALL_PREFIX}" STREQUAL "/usr/local")
-endif(CMAKE_INSTALL_PREFIX)
+  endif(NOT "${BRLCAD_INSTALL_PREFIX}" STREQUAL "/usr" AND NOT 
"${BRLCAD_INSTALL_PREFIX}" STREQUAL "/usr/local")
+endif(BRLCAD_INSTALL_PREFIX)
 if(BRLCAD_PREFIX)
   if(NOT "${BRLCAD_PREFIX}" STREQUAL "/usr" AND NOT "${BRLCAD_PREFIX}" 
STREQUAL "/usr/local")
     get_filename_component(PATH_NORMALIZED "${BRLCAD_PREFIX}/${LIB_DIR}" 
ABSOLUTE)

Modified: brlcad/branches/thirdparty_rework/misc/CMake/FindNETPBM.cmake
===================================================================
--- brlcad/branches/thirdparty_rework/misc/CMake/FindNETPBM.cmake       
2020-09-27 17:43:58 UTC (rev 77250)
+++ brlcad/branches/thirdparty_rework/misc/CMake/FindNETPBM.cmake       
2020-09-27 18:52:31 UTC (rev 77251)
@@ -1,59 +1,102 @@
-#               F I N D N E T P B M . C M A K E
-# BRL-CAD
-#
-# Copyright (c) 2011-2020 United States Government as represented by
-# the U.S. Army Research Laboratory.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#
-# 2. Redistributions in binary form must reproduce the above
-# 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.
-#
-###
-# - Find netpbm library and headers
-#
-# The following variables are set:
-#
-#  NETPBM_LIBRARIES      - libnetpbm
-#  NETPBM_INCLUDE_DIRS   - where to find ppm.h, pam.h, pbm.h, etc.
-#  NETPBM_FOUND          - True if libnetpbm and header found.
+# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
 
-find_path(NETPBM_INCLUDE_DIR pam.h)
-find_library(NETPBM_LIBRARY NAMES netpbm)
+#[=======================================================================[.rst:
+FindNETPBM
+--------
 
+Find the native NETPBM includes and library.
+
+IMPORTED Targets
+^^^^^^^^^^^^^^^^
+
+This module defines :prop_tgt:`IMPORTED` target ``NETPBM::NETPBM``, if
+NETPBM has been found.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
+
+::
+
+  NETPBM_INCLUDE_DIRS   - where to find pam.h, etc.
+  NETPBM_LIBRARIES      - List of libraries when using netpbm.
+  NETPBM_FOUND          - True if netpbm found.
+
+Hints
+^^^^^
+
+A user may set ``NETPBM_ROOT`` to a netpbm installation root to tell this
+module where to look.
+#]=======================================================================]
+
+set(_NETPBM_SEARCHES)
+
+# Search NETPBM_ROOT first if it is set.
+if(NETPBM_ROOT)
+  set(_NETPBM_SEARCH_ROOT PATHS ${NETPBM_ROOT} NO_DEFAULT_PATH)
+  list(APPEND _NETPBM_SEARCHES _NETPBM_SEARCH_ROOT)
+endif()
+
+# Normal search.
+set(_NETPBM_x86 "(x86)")
+set(_NETPBM_SEARCH_NORMAL
+    PATHS  "$ENV{ProgramFiles}/netpbm"
+          "$ENV{ProgramFiles${_NETPBM_x86}}/netpbm")
+unset(_NETPBM_x86)
+list(APPEND _NETPBM_SEARCHES _NETPBM_SEARCH_NORMAL)
+
+set(NETPBM_NAMES netpbm)
+
+# Try each search configuration.
+foreach(search ${_NETPBM_SEARCHES})
+  find_path(NETPBM_INCLUDE_DIR NAMES pam.h ${${search}} PATH_SUFFIXES include 
include/netpbm)
+endforeach()
+
+# Allow NETPBM_LIBRARY to be set manually, as the location of the netpbm 
library
+if(NOT NETPBM_LIBRARY)
+  foreach(search ${_NETPBM_SEARCHES})
+    find_library(NETPBM_LIBRARY NAMES ${NETPBM_NAMES} NAMES_PER_DIR 
${${search}} PATH_SUFFIXES lib)
+  endforeach()
+endif()
+
+unset(NETPBM_NAMES)
+
+mark_as_advanced(NETPBM_INCLUDE_DIR)
+
 include(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(NETPBM DEFAULT_MSG NETPBM_LIBRARY 
NETPBM_INCLUDE_DIR)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(NETPBM REQUIRED_VARS NETPBM_LIBRARY 
NETPBM_INCLUDE_DIR)
 
-IF (NETPBM_FOUND)
-  set(NETPBM_INCLUDE_DIRS ${NETPBM_INCLUDE_DIR})
-  set(NETPBM_LIBRARIES    ${NETPBM_LIBRARY})
+if(NETPBM_FOUND)
+    set(NETPBM_INCLUDE_DIRS ${NETPBM_INCLUDE_DIR})
+
+    if(NOT NETPBM_LIBRARIES)
+      set(NETPBM_LIBRARIES ${NETPBM_LIBRARY})
+    endif()
+
+    if(NOT TARGET NETPBM::NETPBM)
+      add_library(NETPBM::NETPBM UNKNOWN IMPORTED)
+      set_target_properties(NETPBM::NETPBM PROPERTIES
+        INTERFACE_INCLUDE_DIRECTORIES "${NETPBM_INCLUDE_DIRS}")
+
+      if(NETPBM_LIBRARY_RELEASE)
+        set_property(TARGET NETPBM::NETPBM APPEND PROPERTY
+          IMPORTED_CONFIGURATIONS RELEASE)
+        set_target_properties(NETPBM::NETPBM PROPERTIES
+          IMPORTED_LOCATION_RELEASE "${NETPBM_LIBRARY_RELEASE}")
+      endif()
+
+      if(NETPBM_LIBRARY_DEBUG)
+        set_property(TARGET NETPBM::NETPBM APPEND PROPERTY
+          IMPORTED_CONFIGURATIONS DEBUG)
+        set_target_properties(NETPBM::NETPBM PROPERTIES
+          IMPORTED_LOCATION_DEBUG "${NETPBM_LIBRARY_DEBUG}")
+      endif()
+
+      if(NOT NETPBM_LIBRARY_RELEASE AND NOT NETPBM_LIBRARY_DEBUG)
+        set_property(TARGET NETPBM::NETPBM APPEND PROPERTY
+          IMPORTED_LOCATION "${NETPBM_LIBRARY}")
+      endif()
+    endif()
 endif()
-# Local Variables:
-# tab-width: 8
-# mode: cmake
-# indent-tabs-mode: t
-# End:
-# ex: shiftwidth=2 tabstop=8

Modified: brlcad/branches/thirdparty_rework/misc/CMake/FindUTAHRLE.cmake
===================================================================
--- brlcad/branches/thirdparty_rework/misc/CMake/FindUTAHRLE.cmake      
2020-09-27 17:43:58 UTC (rev 77250)
+++ brlcad/branches/thirdparty_rework/misc/CMake/FindUTAHRLE.cmake      
2020-09-27 18:52:31 UTC (rev 77251)
@@ -1,62 +1,102 @@
-#               F I N D U T A H R L E . C M A K E
-# BRL-CAD
-#
-# Copyright (c) 2011-2020 United States Government as represented by
-# the U.S. Army Research Laboratory.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#
-# 2. Redistributions in binary form must reproduce the above
-# 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.
-#
-###
-# - Find UtahRLE libraries
-#
-# The following variables are set:
-#
-# UTAHRLE_LIBRARY
-# The following variables are set:
-#
-#  UTAHRLE_INCLUDE_DIRS   - where to find zlib.h, etc.
-#  UTAHRLE_LIBRARIES      - List of libraries when using zlib.
-#  UTAHRLE_FOUND          - True if zlib found.
+# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
 
-find_path(UTAHRLE_INCLUDE_DIR rle.h)
-find_library(UTAHRLE_LIBRARY NAMES UTAHRLE)
+#[=======================================================================[.rst:
+FindUTAHRLE
+--------
 
+Find the native UTAHRLE includes and library.
+
+IMPORTED Targets
+^^^^^^^^^^^^^^^^
+
+This module defines :prop_tgt:`IMPORTED` target ``UTAHRLE::UTAHRLE``, if
+UTAHRLE has been found.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
+
+::
+
+  UTAHRLE_INCLUDE_DIRS   - where to find pam.h, etc.
+  UTAHRLE_LIBRARIES      - List of libraries when using utahrle.
+  UTAHRLE_FOUND          - True if utahrle found.
+
+Hints
+^^^^^
+
+A user may set ``UTAHRLE_ROOT`` to a utahrle installation root to tell this
+module where to look.
+#]=======================================================================]
+
+set(_UTAHRLE_SEARCHES)
+
+# Search UTAHRLE_ROOT first if it is set.
+if(UTAHRLE_ROOT)
+  set(_UTAHRLE_SEARCH_ROOT PATHS ${UTAHRLE_ROOT} NO_DEFAULT_PATH)
+  list(APPEND _UTAHRLE_SEARCHES _UTAHRLE_SEARCH_ROOT)
+endif()
+
+# Normal search.
+set(_UTAHRLE_x86 "(x86)")
+set(_UTAHRLE_SEARCH_NORMAL
+    PATHS  "$ENV{ProgramFiles}/utahrle"
+          "$ENV{ProgramFiles${_UTAHRLE_x86}}/utahrle")
+unset(_UTAHRLE_x86)
+list(APPEND _UTAHRLE_SEARCHES _UTAHRLE_SEARCH_NORMAL)
+
+set(UTAHRLE_NAMES utahrle)
+
+# Try each search configuration.
+foreach(search ${_UTAHRLE_SEARCHES})
+  find_path(UTAHRLE_INCLUDE_DIR NAMES rle.h ${${search}} PATH_SUFFIXES include 
include/utahrle)
+endforeach()
+
+# Allow UTAHRLE_LIBRARY to be set manually, as the location of the utahrle 
library
+if(NOT UTAHRLE_LIBRARY)
+  foreach(search ${_UTAHRLE_SEARCHES})
+    find_library(UTAHRLE_LIBRARY NAMES ${UTAHRLE_NAMES} NAMES_PER_DIR 
${${search}} PATH_SUFFIXES lib)
+  endforeach()
+endif()
+
+unset(UTAHRLE_NAMES)
+
+mark_as_advanced(UTAHRLE_INCLUDE_DIR)
+
 include(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(UTAHRLE DEFAULT_MSG UTAHRLE_LIBRARY 
UTAHRLE_INCLUDE_DIR)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(UTAHRLE REQUIRED_VARS UTAHRLE_LIBRARY 
UTAHRLE_INCLUDE_DIR)
 
-IF (UTAHRLE_FOUND)
-  set(UTAHRLE_INCLUDE_DIRS ${UTAHRLE_INCLUDE_DIR})
-  set(UTAHRLE_LIBRARIES    ${UTAHRLE_LIBRARY})
+if(UTAHRLE_FOUND)
+    set(UTAHRLE_INCLUDE_DIRS ${UTAHRLE_INCLUDE_DIR})
+
+    if(NOT UTAHRLE_LIBRARIES)
+      set(UTAHRLE_LIBRARIES ${UTAHRLE_LIBRARY})
+    endif()
+
+    if(NOT TARGET UTAHRLE::UTAHRLE)
+      add_library(UTAHRLE::UTAHRLE UNKNOWN IMPORTED)
+      set_target_properties(UTAHRLE::UTAHRLE PROPERTIES
+        INTERFACE_INCLUDE_DIRECTORIES "${UTAHRLE_INCLUDE_DIRS}")
+
+      if(UTAHRLE_LIBRARY_RELEASE)
+        set_property(TARGET UTAHRLE::UTAHRLE APPEND PROPERTY
+          IMPORTED_CONFIGURATIONS RELEASE)
+        set_target_properties(UTAHRLE::UTAHRLE PROPERTIES
+          IMPORTED_LOCATION_RELEASE "${UTAHRLE_LIBRARY_RELEASE}")
+      endif()
+
+      if(UTAHRLE_LIBRARY_DEBUG)
+        set_property(TARGET UTAHRLE::UTAHRLE APPEND PROPERTY
+          IMPORTED_CONFIGURATIONS DEBUG)
+        set_target_properties(UTAHRLE::UTAHRLE PROPERTIES
+          IMPORTED_LOCATION_DEBUG "${UTAHRLE_LIBRARY_DEBUG}")
+      endif()
+
+      if(NOT UTAHRLE_LIBRARY_RELEASE AND NOT UTAHRLE_LIBRARY_DEBUG)
+        set_property(TARGET UTAHRLE::UTAHRLE APPEND PROPERTY
+          IMPORTED_LOCATION "${UTAHRLE_LIBRARY}")
+      endif()
+    endif()
 endif()
-# Local Variables:
-# tab-width: 8
-# mode: cmake
-# indent-tabs-mode: t
-# End:
-# ex: shiftwidth=2 tabstop=8

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

Reply via email to