Attached Files | 0001-Variables-such-as-OSG_DIR-OSGDIR-OSGROOT-do-not-need.patch [^] (7,146 bytes) 2012-04-02 06:53 [Show Content] [Hide Content]From 531e3004575947aa43117021e77eaef1117be473 Mon Sep 17 00:00:00 2001
From: Arnaud Gelas <arnaudgelas@gmail.com>
Date: Mon, 2 Apr 2012 12:43:48 +0200
Subject: [PATCH] Variables such as OSG_DIR, OSGDIR, OSGROOT do not need to be
environment variables
---
Modules/FindOpenSceneGraph.cmake | 12 ++++++------
Modules/FindOpenThreads.cmake | 38 ++++++++++++++++++++++++++++++--------
Modules/Findosg_functions.cmake | 14 +++++++++++++-
3 files changed, 49 insertions(+), 15 deletions(-)
diff --git a/Modules/FindOpenSceneGraph.cmake b/Modules/FindOpenSceneGraph.cmake
index 52f9316..9dd2c28 100644
--- a/Modules/FindOpenSceneGraph.cmake
+++ b/Modules/FindOpenSceneGraph.cmake
@@ -14,7 +14,7 @@
#
# OpenSceneGraph_DEBUG - Enable debugging output
#
-# OpenSceneGraph_MARK_AS_ADVANCED - Mark cache variables as advanced
+# OpenSceneGraph_MARK_AS_ADVANCED - Mark cache variables as advanced
# automatically
#
# The following environment variables are also respected for finding the OSG
@@ -96,12 +96,12 @@ if(OSG_INCLUDE_DIR)
message(STATUS "[ FindOpenSceneGraph.cmake:${CMAKE_CURRENT_LIST_LINE} ] "
"Detected OSG_INCLUDE_DIR = ${OSG_INCLUDE_DIR}")
endif()
-
+
set(_osg_Version_file "${OSG_INCLUDE_DIR}/osg/Version")
if("${OSG_INCLUDE_DIR}" MATCHES "\\.framework$" AND NOT EXISTS "${_osg_Version_file}")
set(_osg_Version_file "${OSG_INCLUDE_DIR}/Headers/Version")
endif()
-
+
if(EXISTS "${_osg_Version_file}")
file(READ "${_osg_Version_file}" _osg_Version_contents)
else()
@@ -149,7 +149,7 @@ if(OpenSceneGraph_FIND_VERSION AND OPENSCENEGRAPH_VERSION)
endif()
else()
# version is too low
- if(NOT OPENSCENEGRAPH_VERSION VERSION_EQUAL ${OpenSceneGraph_FIND_VERSION} AND
+ if(NOT OPENSCENEGRAPH_VERSION VERSION_EQUAL ${OpenSceneGraph_FIND_VERSION} AND
NOT OPENSCENEGRAPH_VERSION VERSION_GREATER ${OpenSceneGraph_FIND_VERSION})
set(_osg_version_not_high_enough TRUE)
endif()
@@ -182,7 +182,7 @@ endforeach()
if(OPENSCENEGRAPH_INCLUDE_DIR)
list(REMOVE_DUPLICATES OPENSCENEGRAPH_INCLUDE_DIR)
endif()
-
+
#
# Inform the users with an error message based on
# what version they have vs. what version was
@@ -221,7 +221,7 @@ else()
set(_osg_missing_message "${_osg_missing_message} ${_osg_module}")
endif()
endforeach()
-
+
if(_osg_missing_nodekit_fail)
message(FATAL_ERROR "ERROR: Missing the following osg "
"libraries: ${_osg_missing_message}.\n"
diff --git a/Modules/FindOpenThreads.cmake b/Modules/FindOpenThreads.cmake
index 6b81fbe..8d85058 100644
--- a/Modules/FindOpenThreads.cmake
+++ b/Modules/FindOpenThreads.cmake
@@ -1,10 +1,10 @@
-# OpenThreads is a C++ based threading library. Its largest userbase
+# OpenThreads is a C++ based threading library. Its largest userbase
# seems to OpenSceneGraph so you might notice I accept OSGDIR as an
# environment path.
-# I consider this part of the Findosg* suite used to find OpenSceneGraph
+# I consider this part of the Findosg* suite used to find OpenSceneGraph
# components.
# Each component is separate and you must opt in to each module.
-#
+#
# Locate OpenThreads
# This module defines
# OPENTHREADS_LIBRARY
@@ -34,8 +34,8 @@
# #include <OpenThreads/Thread>
# To make it easier for one-step automated configuration/builds,
-# we leverage environmental paths. This is preferable
-# to the -DVAR=value switches because it insulates the
+# we leverage environmental paths. This is preferable
+# to the -DVAR=value switches because it insulates the
# users from changes we may make in this script.
# It also offers a little more flexibility than setting
# the CMAKE_*_PATH since we can target specific components.
@@ -61,6 +61,13 @@ find_path(OPENTHREADS_INCLUDE_DIR OpenThreads/Thread
$ENV{OSGDIR}
$ENV{OpenThreads_ROOT}
$ENV{OSG_ROOT}
+ ${OPENTHREADS_INCLUDE_DIR}
+ ${OPENTHREADS_DIR}
+ ${OSG_INCLUDE_DIR}
+ ${OSG_DIR}
+ ${OSGDIR}
+ ${OpenThreads_ROOT}
+ ${OSG_ROOT}
PATHS
/sw # Fink
/opt/local # DarwinPorts
@@ -71,8 +78,8 @@ find_path(OPENTHREADS_INCLUDE_DIR OpenThreads/Thread
)
-find_library(OPENTHREADS_LIBRARY
- NAMES OpenThreads OpenThreadsWin32
+find_library(OPENTHREADS_LIBRARY
+ NAMES OpenThreads OpenThreadsWin32
HINTS
$ENV{OPENTHREADS_LIBRARY_DIR}
$ENV{OPENTHREADS_DIR}
@@ -81,6 +88,13 @@ find_library(OPENTHREADS_LIBRARY
$ENV{OSGDIR}
$ENV{OpenThreads_ROOT}
$ENV{OSG_ROOT}
+ ${OPENTHREADS_LIBRARY_DIR}
+ ${OPENTHREADS_DIR}
+ ${OSG_LIBRARY_DIR}
+ ${OSG_DIR}
+ ${OSGDIR}
+ ${OpenThreads_ROOT}
+ ${OSG_ROOT}
PATHS
/sw
/opt/local
@@ -90,7 +104,7 @@ find_library(OPENTHREADS_LIBRARY
PATH_SUFFIXES lib64 lib
)
-find_library(OPENTHREADS_LIBRARY_DEBUG
+find_library(OPENTHREADS_LIBRARY_DEBUG
NAMES OpenThreadsd OpenThreadsWin32d
HINTS
$ENV{OPENTHREADS_DEBUG_LIBRARY_DIR}
@@ -101,6 +115,14 @@ find_library(OPENTHREADS_LIBRARY_DEBUG
$ENV{OSGDIR}
$ENV{OpenThreads_ROOT}
$ENV{OSG_ROOT}
+ ${OPENTHREADS_DEBUG_LIBRARY_DIR}
+ ${OPENTHREADS_LIBRARY_DIR}
+ ${OPENTHREADS_DIR}
+ ${OSG_LIBRARY_DIR}
+ ${OSG_DIR}
+ ${OSGDIR}
+ ${OpenThreads_ROOT}
+ ${OSG_ROOT}
PATHS
/sw
/opt/local
diff --git a/Modules/Findosg_functions.cmake b/Modules/Findosg_functions.cmake
index ab836ff..53e974c 100644
--- a/Modules/Findosg_functions.cmake
+++ b/Modules/Findosg_functions.cmake
@@ -30,6 +30,10 @@ function(OSG_FIND_PATH module header)
$ENV{OSG_DIR}
$ENV{OSGDIR}
$ENV{OSG_ROOT}
+ ${${module_uc}_DIR}
+ ${OSG_DIR}
+ ${OSGDIR}
+ ${OSG_ROOT}
PATH_SUFFIXES include
PATHS
/sw # Fink
@@ -54,6 +58,10 @@ function(OSG_FIND_LIBRARY module library)
$ENV{OSG_DIR}
$ENV{OSGDIR}
$ENV{OSG_ROOT}
+ ${${module_uc}_DIR}
+ ${OSG_DIR}
+ ${OSGDIR}
+ ${OSG_ROOT}
PATH_SUFFIXES lib64 lib
PATHS
/sw # Fink
@@ -70,6 +78,10 @@ function(OSG_FIND_LIBRARY module library)
$ENV{OSG_DIR}
$ENV{OSGDIR}
$ENV{OSG_ROOT}
+ ${${module_uc}_DIR}
+ ${OSG_DIR}
+ ${OSGDIR}
+ ${OSG_ROOT}
PATH_SUFFIXES lib64 lib
PATHS
/sw # Fink
@@ -85,7 +97,7 @@ function(OSG_FIND_LIBRARY module library)
set(${module_uc}_LIBRARIES ${${module_uc}_LIBRARY} PARENT_SCOPE)
else()
# They really have a FOO_LIBRARY_DEBUG
- set(${module_uc}_LIBRARIES
+ set(${module_uc}_LIBRARIES
optimized ${${module_uc}_LIBRARY}
debug ${${module_uc}_LIBRARY_DEBUG}
PARENT_SCOPE
--
1.7.5.4
0001-Add-hint-variables-one-for-FindOpenSceneGraph-one-fo.patch [^] (8,373 bytes) 2012-04-16 10:24 [Show Content] [Hide Content]From 0d436856ebc7f9d7e4a99d8b20d5b0482b159b35 Mon Sep 17 00:00:00 2001
From: Arnaud Gelas <arnaudgelas@gmail.com>
Date: Mon, 16 Apr 2012 16:18:35 +0200
Subject: [PATCH] Add hint variables one for FindOpenSceneGraph, one for
FindOpenThreads
OSG_DIR - FindOpenSceneGraph and FindOpenThreads
OPENTHREADS_DIR - FindOpenThreads
---
Modules/FindOpenSceneGraph.cmake | 18 +++++++++-----
Modules/FindOpenThreads.cmake | 47 +++++++++++++++++++++-----------------
Modules/Findosg_functions.cmake | 8 +++++-
3 files changed, 45 insertions(+), 28 deletions(-)
diff --git a/Modules/FindOpenSceneGraph.cmake b/Modules/FindOpenSceneGraph.cmake
index 52f9316..88dfd5b 100644
--- a/Modules/FindOpenSceneGraph.cmake
+++ b/Modules/FindOpenSceneGraph.cmake
@@ -14,7 +14,7 @@
#
# OpenSceneGraph_DEBUG - Enable debugging output
#
-# OpenSceneGraph_MARK_AS_ADVANCED - Mark cache variables as advanced
+# OpenSceneGraph_MARK_AS_ADVANCED - Mark cache variables as advanced
# automatically
#
# The following environment variables are also respected for finding the OSG
@@ -26,6 +26,12 @@
# OSGDIR
# OSG_ROOT
#
+
+# OPENTHREADS_DIR and OSG_DIR are not environment variables and can be set as
+# HINTS when looking for libraries and headers. Note that OPENTHREADS_DIR is a
+# specific variable for OpenThreads; whereas OSG_DIR is shared among all
+# OpenSceneGraph modules/libraries.
+#
# This module defines the following output variables:
#
# OPENSCENEGRAPH_FOUND - Was the OSG and all of the specified components found?
@@ -96,12 +102,12 @@ if(OSG_INCLUDE_DIR)
message(STATUS "[ FindOpenSceneGraph.cmake:${CMAKE_CURRENT_LIST_LINE} ] "
"Detected OSG_INCLUDE_DIR = ${OSG_INCLUDE_DIR}")
endif()
-
+
set(_osg_Version_file "${OSG_INCLUDE_DIR}/osg/Version")
if("${OSG_INCLUDE_DIR}" MATCHES "\\.framework$" AND NOT EXISTS "${_osg_Version_file}")
set(_osg_Version_file "${OSG_INCLUDE_DIR}/Headers/Version")
endif()
-
+
if(EXISTS "${_osg_Version_file}")
file(READ "${_osg_Version_file}" _osg_Version_contents)
else()
@@ -149,7 +155,7 @@ if(OpenSceneGraph_FIND_VERSION AND OPENSCENEGRAPH_VERSION)
endif()
else()
# version is too low
- if(NOT OPENSCENEGRAPH_VERSION VERSION_EQUAL ${OpenSceneGraph_FIND_VERSION} AND
+ if(NOT OPENSCENEGRAPH_VERSION VERSION_EQUAL ${OpenSceneGraph_FIND_VERSION} AND
NOT OPENSCENEGRAPH_VERSION VERSION_GREATER ${OpenSceneGraph_FIND_VERSION})
set(_osg_version_not_high_enough TRUE)
endif()
@@ -182,7 +188,7 @@ endforeach()
if(OPENSCENEGRAPH_INCLUDE_DIR)
list(REMOVE_DUPLICATES OPENSCENEGRAPH_INCLUDE_DIR)
endif()
-
+
#
# Inform the users with an error message based on
# what version they have vs. what version was
@@ -221,7 +227,7 @@ else()
set(_osg_missing_message "${_osg_missing_message} ${_osg_module}")
endif()
endforeach()
-
+
if(_osg_missing_nodekit_fail)
message(FATAL_ERROR "ERROR: Missing the following osg "
"libraries: ${_osg_missing_message}.\n"
diff --git a/Modules/FindOpenThreads.cmake b/Modules/FindOpenThreads.cmake
index 6b81fbe..0383d56 100644
--- a/Modules/FindOpenThreads.cmake
+++ b/Modules/FindOpenThreads.cmake
@@ -1,19 +1,19 @@
-# OpenThreads is a C++ based threading library. Its largest userbase
-# seems to OpenSceneGraph so you might notice I accept OSGDIR as an
-# environment path.
-# I consider this part of the Findosg* suite used to find OpenSceneGraph
-# components.
-# Each component is separate and you must opt in to each module.
-#
-# Locate OpenThreads
-# This module defines
-# OPENTHREADS_LIBRARY
-# OPENTHREADS_FOUND, if false, do not try to link to OpenThreads
-# OPENTHREADS_INCLUDE_DIR, where to find the headers
+# OpenThreads is a C++ based threading library. Its largest userbase seems to
+# OpenSceneGraph so you might notice I accept OSGDIR as an environment path. I
+# consider this part of the Findosg* suite used to find OpenSceneGraph
+# components. Each component is separate and you must opt in to each module.
#
-# $OPENTHREADS_DIR is an environment variable that would
-# correspond to the ./configure --prefix=$OPENTHREADS_DIR
-# used in building osg.
+# Locate OpenThreads This module defines OPENTHREADS_LIBRARY OPENTHREADS_FOUND,
+# if false, do not try to link to OpenThreads OPENTHREADS_INCLUDE_DIR, where to
+# find the headers
+#
+# $OPENTHREADS_DIR is an environment variable that would correspond to the
+# ./configure --prefix=$OPENTHREADS_DIR used in building osg.
+#
+# OPENTHREADS_DIR and OSG_DIR are not environment variables and can be set as
+# HINTS when looking for libraries and headers. Note that OPENTHREADS_DIR is a
+# specific variable for OpenThreads; whereas OSG_DIR is shared among all
+# OpenSceneGraph modules/libraries.
#
# Created by Eric Wing.
@@ -34,8 +34,8 @@
# #include <OpenThreads/Thread>
# To make it easier for one-step automated configuration/builds,
-# we leverage environmental paths. This is preferable
-# to the -DVAR=value switches because it insulates the
+# we leverage environmental paths. This is preferable
+# to the -DVAR=value switches because it insulates the
# users from changes we may make in this script.
# It also offers a little more flexibility than setting
# the CMAKE_*_PATH since we can target specific components.
@@ -53,7 +53,6 @@
find_path(OPENTHREADS_INCLUDE_DIR OpenThreads/Thread
HINTS
- # enough environment variables?
$ENV{OPENTHREADS_INCLUDE_DIR}
$ENV{OPENTHREADS_DIR}
$ENV{OSG_INCLUDE_DIR}
@@ -61,6 +60,8 @@ find_path(OPENTHREADS_INCLUDE_DIR OpenThreads/Thread
$ENV{OSGDIR}
$ENV{OpenThreads_ROOT}
$ENV{OSG_ROOT}
+ ${OPENTHREADS_DIR}
+ ${OSG_DIR}
PATHS
/sw # Fink
/opt/local # DarwinPorts
@@ -71,8 +72,8 @@ find_path(OPENTHREADS_INCLUDE_DIR OpenThreads/Thread
)
-find_library(OPENTHREADS_LIBRARY
- NAMES OpenThreads OpenThreadsWin32
+find_library(OPENTHREADS_LIBRARY
+ NAMES OpenThreads OpenThreadsWin32
HINTS
$ENV{OPENTHREADS_LIBRARY_DIR}
$ENV{OPENTHREADS_DIR}
@@ -81,6 +82,8 @@ find_library(OPENTHREADS_LIBRARY
$ENV{OSGDIR}
$ENV{OpenThreads_ROOT}
$ENV{OSG_ROOT}
+ ${OPENTHREADS_DIR}
+ ${OSG_DIR}
PATHS
/sw
/opt/local
@@ -90,7 +93,7 @@ find_library(OPENTHREADS_LIBRARY
PATH_SUFFIXES lib64 lib
)
-find_library(OPENTHREADS_LIBRARY_DEBUG
+find_library(OPENTHREADS_LIBRARY_DEBUG
NAMES OpenThreadsd OpenThreadsWin32d
HINTS
$ENV{OPENTHREADS_DEBUG_LIBRARY_DIR}
@@ -101,6 +104,8 @@ find_library(OPENTHREADS_LIBRARY_DEBUG
$ENV{OSGDIR}
$ENV{OpenThreads_ROOT}
$ENV{OSG_ROOT}
+ ${OPENTHREADS_DIR}
+ ${OSG_DIR}
PATHS
/sw
/opt/local
diff --git a/Modules/Findosg_functions.cmake b/Modules/Findosg_functions.cmake
index ab836ff..8fde5a0 100644
--- a/Modules/Findosg_functions.cmake
+++ b/Modules/Findosg_functions.cmake
@@ -30,6 +30,8 @@ function(OSG_FIND_PATH module header)
$ENV{OSG_DIR}
$ENV{OSGDIR}
$ENV{OSG_ROOT}
+ ${${module_uc}_DIR}
+ ${OSG_DIR}
PATH_SUFFIXES include
PATHS
/sw # Fink
@@ -54,6 +56,8 @@ function(OSG_FIND_LIBRARY module library)
$ENV{OSG_DIR}
$ENV{OSGDIR}
$ENV{OSG_ROOT}
+ ${${module_uc}_DIR}
+ ${OSG_DIR}
PATH_SUFFIXES lib64 lib
PATHS
/sw # Fink
@@ -70,6 +74,8 @@ function(OSG_FIND_LIBRARY module library)
$ENV{OSG_DIR}
$ENV{OSGDIR}
$ENV{OSG_ROOT}
+ ${${module_uc}_DIR}
+ ${OSG_DIR}
PATH_SUFFIXES lib64 lib
PATHS
/sw # Fink
@@ -85,7 +91,7 @@ function(OSG_FIND_LIBRARY module library)
set(${module_uc}_LIBRARIES ${${module_uc}_LIBRARY} PARENT_SCOPE)
else()
# They really have a FOO_LIBRARY_DEBUG
- set(${module_uc}_LIBRARIES
+ set(${module_uc}_LIBRARIES
optimized ${${module_uc}_LIBRARY}
debug ${${module_uc}_LIBRARY_DEBUG}
PARENT_SCOPE
--
1.7.5.4
0001-OSG_DIR-can-now-be-set-by-the-user.patch [^] (3,487 bytes) 2012-06-15 10:09 [Show Content] [Hide Content]From 188c895ac6b8c781c193d684944f8045b359be30 Mon Sep 17 00:00:00 2001
From: Arnaud Gelas <arnaudgelas@gmail.com>
Date: Fri, 15 Jun 2012 16:06:36 +0200
Subject: [PATCH] OSG_DIR can now be set by the user
It did not need to be an environment variable.
---
Modules/FindOpenSceneGraph.cmake | 3 +++
Modules/FindOpenThreads.cmake | 11 ++++++++---
Modules/Findosg_functions.cmake | 6 ++++++
3 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/Modules/FindOpenSceneGraph.cmake b/Modules/FindOpenSceneGraph.cmake
index 52f9316..4c4e2d0 100644
--- a/Modules/FindOpenSceneGraph.cmake
+++ b/Modules/FindOpenSceneGraph.cmake
@@ -26,6 +26,9 @@
# OSGDIR
# OSG_ROOT
#
+# The variable OSG_DIR does not need to be an environement variable and it can be
+# by the user.
+#
# This module defines the following output variables:
#
# OPENSCENEGRAPH_FOUND - Was the OSG and all of the specified components found?
diff --git a/Modules/FindOpenThreads.cmake b/Modules/FindOpenThreads.cmake
index 6b81fbe..c4bdc98 100644
--- a/Modules/FindOpenThreads.cmake
+++ b/Modules/FindOpenThreads.cmake
@@ -11,9 +11,9 @@
# OPENTHREADS_FOUND, if false, do not try to link to OpenThreads
# OPENTHREADS_INCLUDE_DIR, where to find the headers
#
-# $OPENTHREADS_DIR is an environment variable that would
+# $OPENTHREADS_DIR is either an environment variable that would
# correspond to the ./configure --prefix=$OPENTHREADS_DIR
-# used in building osg.
+# used in building osg; either a variable set by the user.
#
# Created by Eric Wing.
@@ -53,7 +53,6 @@
find_path(OPENTHREADS_INCLUDE_DIR OpenThreads/Thread
HINTS
- # enough environment variables?
$ENV{OPENTHREADS_INCLUDE_DIR}
$ENV{OPENTHREADS_DIR}
$ENV{OSG_INCLUDE_DIR}
@@ -61,6 +60,8 @@ find_path(OPENTHREADS_INCLUDE_DIR OpenThreads/Thread
$ENV{OSGDIR}
$ENV{OpenThreads_ROOT}
$ENV{OSG_ROOT}
+ ${OPENTHREADS_DIR}
+ ${OSG_DIR}
PATHS
/sw # Fink
/opt/local # DarwinPorts
@@ -81,6 +82,8 @@ find_library(OPENTHREADS_LIBRARY
$ENV{OSGDIR}
$ENV{OpenThreads_ROOT}
$ENV{OSG_ROOT}
+ ${OPENTHREADS_DIR}
+ ${OSG_DIR}
PATHS
/sw
/opt/local
@@ -101,6 +104,8 @@ find_library(OPENTHREADS_LIBRARY_DEBUG
$ENV{OSGDIR}
$ENV{OpenThreads_ROOT}
$ENV{OSG_ROOT}
+ ${OPENTHREADS_DIR}
+ ${OSG_DIR}
PATHS
/sw
/opt/local
diff --git a/Modules/Findosg_functions.cmake b/Modules/Findosg_functions.cmake
index ab836ff..2d0ec8b 100644
--- a/Modules/Findosg_functions.cmake
+++ b/Modules/Findosg_functions.cmake
@@ -30,6 +30,8 @@ function(OSG_FIND_PATH module header)
$ENV{OSG_DIR}
$ENV{OSGDIR}
$ENV{OSG_ROOT}
+ ${${module_uc}_DIR}
+ ${OSG_DIR}
PATH_SUFFIXES include
PATHS
/sw # Fink
@@ -54,6 +56,8 @@ function(OSG_FIND_LIBRARY module library)
$ENV{OSG_DIR}
$ENV{OSGDIR}
$ENV{OSG_ROOT}
+ ${${module_uc}_DIR}
+ ${OSG_DIR}
PATH_SUFFIXES lib64 lib
PATHS
/sw # Fink
@@ -70,6 +74,8 @@ function(OSG_FIND_LIBRARY module library)
$ENV{OSG_DIR}
$ENV{OSGDIR}
$ENV{OSG_ROOT}
+ ${${module_uc}_DIR}
+ ${OSG_DIR}
PATH_SUFFIXES lib64 lib
PATHS
/sw # Fink
--
1.7.9.5
|