Revision: 77916
http://sourceforge.net/p/brlcad/code/77916
Author: starseeker
Date: 2020-12-04 00:46:05 +0000 (Fri, 04 Dec 2020)
Log Message:
-----------
Not using yet but go ahead and stage poly2tri and stepcode find logic.
Modified Paths:
--------------
brlcad/trunk/misc/CMake/CMakeLists.txt
Added Paths:
-----------
brlcad/trunk/misc/CMake/FindPOLY2TRI.cmake
brlcad/trunk/misc/CMake/FindSTEPCODE.cmake
Modified: brlcad/trunk/misc/CMake/CMakeLists.txt
===================================================================
--- brlcad/trunk/misc/CMake/CMakeLists.txt 2020-12-04 00:40:46 UTC (rev
77915)
+++ brlcad/trunk/misc/CMake/CMakeLists.txt 2020-12-04 00:46:05 UTC (rev
77916)
@@ -41,6 +41,7 @@
FindOpenVDB.cmake
FindPERPLEX.cmake
FindPkgMacros.cmake
+ FindPOLY2TRI.cmake
FindPROJ4.cmake
FindRE2C.cmake
FindREGEX.cmake
@@ -48,6 +49,7 @@
FindSSE.cmake
FindSTL.cmake
FindShellDeps.cmake
+ FindSTEPCODE.cmake
FindTBB.cmake
FindTCL.cmake
FindUTAHRLE.cmake
Added: brlcad/trunk/misc/CMake/FindPOLY2TRI.cmake
===================================================================
--- brlcad/trunk/misc/CMake/FindPOLY2TRI.cmake (rev 0)
+++ brlcad/trunk/misc/CMake/FindPOLY2TRI.cmake 2020-12-04 00:46:05 UTC (rev
77916)
@@ -0,0 +1,102 @@
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+#[=======================================================================[.rst:
+FindPOLY2TRI
+--------
+
+Find the native POLY2TRI includes and library.
+
+IMPORTED Targets
+^^^^^^^^^^^^^^^^
+
+This module defines :prop_tgt:`IMPORTED` target ``POLY2TRI::POLY2TRI``, if
+POLY2TRI has been found.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
+
+::
+
+ POLY2TRI_INCLUDE_DIRS - where to find poly2tri/poly2tri.h, etc.
+ POLY2TRI_LIBRARIES - List of libraries when using poly2tri.
+ POLY2TRI_FOUND - True if poly2tri found.
+
+Hints
+^^^^^
+
+A user may set ``POLY2TRI_ROOT`` to a poly2tri installation root to tell this
+module where to look.
+#]=======================================================================]
+
+set(_POLY2TRI_SEARCHES)
+
+# Search POLY2TRI_ROOT first if it is set.
+if(POLY2TRI_ROOT)
+ set(_POLY2TRI_SEARCH_ROOT PATHS ${POLY2TRI_ROOT} NO_DEFAULT_PATH)
+ list(APPEND _POLY2TRI_SEARCHES _POLY2TRI_SEARCH_ROOT)
+endif()
+
+# Normal search.
+set(_POLY2TRI_x86 "(x86)")
+set(_POLY2TRI_SEARCH_NORMAL
+ PATHS "$ENV{ProgramFiles}/poly2tri"
+ "$ENV{ProgramFiles${_POLY2TRI_x86}}/poly2tri")
+unset(_POLY2TRI_x86)
+list(APPEND _POLY2TRI_SEARCHES _POLY2TRI_SEARCH_NORMAL)
+
+set(POLY2TRI_NAMES poly2tri)
+
+# Try each search configuration.
+foreach(search ${_POLY2TRI_SEARCHES})
+ find_path(POLY2TRI_INCLUDE_DIR NAMES poly2tri/poly2tri.h ${${search}}
PATH_SUFFIXES include include/poly2tri poly2tri)
+endforeach()
+
+# Allow POLY2TRI_LIBRARY to be set manually, as the location of the poly2tri
library
+if(NOT POLY2TRI_LIBRARY)
+ foreach(search ${_POLY2TRI_SEARCHES})
+ find_library(POLY2TRI_LIBRARY NAMES ${POLY2TRI_NAMES} NAMES_PER_DIR
${${search}} PATH_SUFFIXES lib)
+ endforeach()
+endif()
+
+unset(POLY2TRI_NAMES)
+
+mark_as_advanced(POLY2TRI_INCLUDE_DIR)
+
+include(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(POLY2TRI REQUIRED_VARS POLY2TRI_LIBRARY
POLY2TRI_INCLUDE_DIR)
+
+if(POLY2TRI_FOUND)
+ set(POLY2TRI_INCLUDE_DIRS ${POLY2TRI_INCLUDE_DIR})
+
+ if(NOT POLY2TRI_LIBRARIES)
+ set(POLY2TRI_LIBRARIES ${POLY2TRI_LIBRARY})
+ endif()
+
+ if(NOT TARGET POLY2TRI::POLY2TRI)
+ add_library(POLY2TRI::POLY2TRI UNKNOWN IMPORTED)
+ set_target_properties(POLY2TRI::POLY2TRI PROPERTIES
+ INTERFACE_INCLUDE_DIRECTORIES "${POLY2TRI_INCLUDE_DIRS}")
+
+ if(POLY2TRI_LIBRARY_RELEASE)
+ set_property(TARGET POLY2TRI::POLY2TRI APPEND PROPERTY
+ IMPORTED_CONFIGURATIONS RELEASE)
+ set_target_properties(POLY2TRI::POLY2TRI PROPERTIES
+ IMPORTED_LOCATION_RELEASE "${POLY2TRI_LIBRARY_RELEASE}")
+ endif()
+
+ if(POLY2TRI_LIBRARY_DEBUG)
+ set_property(TARGET POLY2TRI::POLY2TRI APPEND PROPERTY
+ IMPORTED_CONFIGURATIONS DEBUG)
+ set_target_properties(POLY2TRI::POLY2TRI PROPERTIES
+ IMPORTED_LOCATION_DEBUG "${POLY2TRI_LIBRARY_DEBUG}")
+ endif()
+
+ if(NOT POLY2TRI_LIBRARY_RELEASE AND NOT POLY2TRI_LIBRARY_DEBUG)
+ set_property(TARGET POLY2TRI::POLY2TRI APPEND PROPERTY
+ IMPORTED_LOCATION "${POLY2TRI_LIBRARY}")
+ endif()
+ endif()
+endif()
Property changes on: brlcad/trunk/misc/CMake/FindPOLY2TRI.cmake
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: brlcad/trunk/misc/CMake/FindSTEPCODE.cmake
===================================================================
--- brlcad/trunk/misc/CMake/FindSTEPCODE.cmake (rev 0)
+++ brlcad/trunk/misc/CMake/FindSTEPCODE.cmake 2020-12-04 00:46:05 UTC (rev
77916)
@@ -0,0 +1,164 @@
+# F I N D S T E P C O D E . C M A K E
+# BRL-CAD
+#
+# Copyright (c) 2013-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 STEPCODE
+#
+# The following variables are set:
+#
+# STEPCODE_INCLUDE_DIRS - where to find stepcode headers
+# STEPCODE_LIBRARIES - List of libraries when using stepcode.
+# STEPCODE_FOUND - True if stepcode found.
+
+
+# A user may set ``STEPCODE_ROOT`` to a stepcode installation root to tell this
+# module where to look.
+# =============================================================================
+
+# Check that each of the libraries has an expected header,
+# as well as the toplevel defined headers. (TODO - are the
+# latter needed beyond the stepcode build itself? Trim this
+# to the minimum actually needed...)
+set(STEPCODE_HDRS
+ base/sc_benchmark.h
+ cldai/sdaiObject.h
+ cleditor/STEPfile.h
+ clstepcore/sdai.h
+ clutils/gennodearray.h
+ exppp/exppp.h
+ express/express.h
+ sc_cf.h
+ )
+
+set(STEPCODE_LIBS
+ base
+ express
+ exppp
+ stepcore
+ stepeditor
+ stepdai
+ steputils
+ )
+
+set(STEPCODE_EXEC
+ exp2cxx
+ exppp
+ )
+
+# Search STEPCODE_ROOT first if it is set.
+set(_STEPCODE_SEARCHES)
+if(STEPCODE_ROOT)
+ set(_STEPCODE_SEARCH_ROOT PATHS ${STEPCODE_ROOT} NO_DEFAULT_PATH)
+ list(APPEND _STEPCODE_SEARCHES _STEPCODE_SEARCH_ROOT)
+endif()
+
+# Try each search configuration.
+foreach(search ${_STEPCODE_SEARCHES})
+ find_path(STEPCODE_BASE_DIR NAMES sc_benchmark.h ${${search}} PATH_SUFFIXES
include include/stepcode/base)
+ find_path(STEPCODE_DAI_DIR NAMES sdaiObject.h ${${search}} PATH_SUFFIXES
include include/stepcode/cldai)
+ find_path(STEPCODE_EDITOR_DIR NAMES STEPfile.h ${${search}} PATH_SUFFIXES
include include/stepcode/cleditor)
+ find_path(STEPCODE_STEPCORE_DIR NAMES sdai.h ${${search}} PATH_SUFFIXES
include include/stepcode/clstepcore)
+ find_path(STEPCODE_UTILS_DIR NAMES gennodearray.h ${${search}} PATH_SUFFIXES
include include/stepcode/clutils)
+ find_path(STEPCODE_EXPPP_DIR NAMES exppp.h ${${search}} PATH_SUFFIXES
include include/stepcode/exppp)
+ find_path(STEPCODE_EXPRESS_DIR NAMES express.h ${${search}} PATH_SUFFIXES
include include/stepcode/express)
+ find_path(STEPCODE_INCLUDE_DIR NAMES sc_cf.h ${${search}} PATH_SUFFIXES
include include/stepcode)
+ #TODO - should be an all-or-nothing for the set...
+endforeach()
+
+# Allow STEPCODE_LIBRARY to be set manually, as the location of the netpbm
library
+foreach(search ${_STEPCODE_SEARCHES})
+ find_library(STEPCODE_BASE_LIBRARY NAMES base NAMES_PER_DIR ${${search}}
PATH_SUFFIXES lib)
+ find_library(STEPCODE_EXPRESS_LIBRARY NAMES express NAMES_PER_DIR
${${search}} PATH_SUFFIXES lib)
+ find_library(STEPCODE_EXPPP_LIBRARY NAMES exppp NAMES_PER_DIR ${${search}}
PATH_SUFFIXES lib)
+ find_library(STEPCODE_CORE_LIBRARY NAMES stepcore NAMES_PER_DIR ${${search}}
PATH_SUFFIXES lib)
+ find_library(STEPCODE_EDITOR_LIBRARY NAMES stepeditor NAMES_PER_DIR
${${search}} PATH_SUFFIXES lib)
+ find_library(STEPCODE_DAI_LIBRARY NAMES stepdai NAMES_PER_DIR ${${search}}
PATH_SUFFIXES lib)
+ find_library(STEPCODE_UTILS_LIBRARY NAMES steputils NAMES_PER_DIR
${${search}} PATH_SUFFIXES lib)
+ #TODO - should be an all-or-nothing for the set...
+endforeach()
+
+# Allow STEPCODE_LIBRARY to be set manually, as the location of the netpbm
library
+foreach(search ${_STEPCODE_SEARCHES})
+ find_program(EXP2CXX_EXECUTABLE exp2cxx ${${search}} PATH_SUFFIXES bin)
+ find_program(EXPPP_EXECUTABLE exppp ${${search}} PATH_SUFFIXES bin)
+ #TODO - should be an all-or-nothing for the set...
+endforeach()
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(STEPCODE DEFAULT_MSG
+ STEPCODE_BASE_DIR
+ STEPCODE_DAI_DIR
+ STEPCODE_EDITOR_DIR
+ STEPCODE_STEPCORE_DIR
+ STEPCODE_UTILS_DIR
+ STEPCODE_EXPPP_DIR
+ STEPCODE_EXPRESS_DIR
+ STEPCODE_INCLUDE_DIR
+ STEPCODE_BASE_LIBRARY
+ STEPCODE_EXPRESS_LIBRARY
+ STEPCODE_EXPPP_LIBRARY
+ STEPCODE_CORE_LIBRARY
+ STEPCODE_EDITOR_LIBRARY
+ STEPCODE_DAI_LIBRARY
+ STEPCODE_UTILS_LIBRARY
+ EXP2CXX_EXECUTABLE
+ EXPPP_EXECUTABLE
+ )
+
+if (STEPCODE_FOUND)
+ set(STEPCODE_INCLUDE_DIRS
+ ${STEPCODE_INCLUDE_DIR}
+ ${STEPCODE_BASE_DIR}
+ ${STEPCODE_STEPCORE_DIR}
+ ${STEPCODE_EDITOR_DIR}
+ ${STEPCODE_UTILS_DIR}
+ ${STEPCODE_DAI_DIR}
+ )
+ set(STEPCODE_LIBRARIES
+ ${STEPCODE_BASE_LIBRARY}
+ ${STEPCODE_EXPRESS_LIBRARY}
+ ${STEPCODE_EXPPP_LIBRARY}
+ ${STEPCODE_CORE_LIBRARY}
+ ${STEPCODE_EDITOR_LIBRARY}
+ ${STEPCODE_DAI_LIBRARY}
+ ${STEPCODE_UTILS_LIBRARY}
+ )
+endif()
+
+# Local Variables:
+# tab-width: 8
+# mode: cmake
+# indent-tabs-mode: t
+# End:
+# ex: shiftwidth=2 tabstop=8
Property changes on: brlcad/trunk/misc/CMake/FindSTEPCODE.cmake
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
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