On Tue, 2008-07-01 at 00:17 -0400, Jean-Sébastien Guay wrote:
Hello Jeremy,
Hoping to help osgWidget get into OSG 2.6, I did a test build tonight
having freshly updated from SVN. I needed to make some changes to the
CMakeLists.txt file, similar to what needed to be done for OSG and VPB.
I'm attaching the changed file to this message.
Note that the minimum required version at the top of the file is just
what I felt is a safe minimum. It could possibly be a lower version
(like 2.4.5 or whatever) but I think realistically most people have
2.4.7 or higher anyways, and I didn't personally test on an older
version, so I have no way to guarantee that it works.
I have built on Visual Studio 2005 (8.0) SP1. It built fine, and from
what I can see, most of the examples run fine too. Exceptions:
- osgwidgetinput: I don't seem to be able to type any values in the
fields, and clicking the button to create the sphere does nothing.
Yeah, unfortunately I won't be able to do much more with Input Widget
objects until there are some changes made to osgText. As it is, the
example currently doesn't do much of anything.
- osgwidgetscrolled: can't do anything other than resize the box
horizontally, is there something else I should be able to do?
It should resize in all directions, and should change the image display
when you scroll your mouse wheel up and down?
- osgwidgetstyled: what is it supposed to do?
This just demonstrates calling various method on a few Widget objects
using a style string (kind of like CSS).
Note that I didn't build with Python or Lua support, perhaps I need one
of those for the examples above to work properly?
All in all, looking good. :-)
J-S
plain text document attachment (CMakeLists.txt)
cmake_minimum_required(VERSION 2.4.7)
PROJECT(osgWidget)
if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 OLD)
endif(COMMAND cmake_policy)
INCLUDE(FindPkgConfig)
INCLUDE(FindPythonLibs)
PKG_CHECK_MODULES(LUA lua)
SET(SRC_FILES
src/Box.cpp
src/Canvas.cpp
src/Frame.cpp
src/Input.cpp
src/Label.cpp
src/Lua.cpp
src/Python.cpp
src/StyleManager.cpp
src/Table.cpp
src/Util.cpp
src/Version.cpp
src/ViewerEventHandlers.cpp
src/Widget.cpp
src/Window.cpp
src/WindowManager.cpp
)
SET(HEADER_FILES
${osgWidget_SOURCE_DIR}/include/osgWidget/Box
${osgWidget_SOURCE_DIR}/include/osgWidget/Canvas
${osgWidget_SOURCE_DIR}/include/osgWidget/EventInterface
${osgWidget_SOURCE_DIR}/include/osgWidget/Frame
${osgWidget_SOURCE_DIR}/include/osgWidget/Input
${osgWidget_SOURCE_DIR}/include/osgWidget/Label
${osgWidget_SOURCE_DIR}/include/osgWidget/Lua
${osgWidget_SOURCE_DIR}/include/osgWidget/Python
${osgWidget_SOURCE_DIR}/include/osgWidget/ScriptEngine
${osgWidget_SOURCE_DIR}/include/osgWidget/StyleInterface
${osgWidget_SOURCE_DIR}/include/osgWidget/StyleManager
${osgWidget_SOURCE_DIR}/include/osgWidget/Table
${osgWidget_SOURCE_DIR}/include/osgWidget/Types
${osgWidget_SOURCE_DIR}/include/osgWidget/UIObjectParent
${osgWidget_SOURCE_DIR}/include/osgWidget/Util
${osgWidget_SOURCE_DIR}/include/osgWidget/ViewerEventHandlers
${osgWidget_SOURCE_DIR}/include/osgWidget/Widget
${osgWidget_SOURCE_DIR}/include/osgWidget/Window
${osgWidget_SOURCE_DIR}/include/osgWidget/WindowManager
${osgWidget_SOURCE_DIR}/include/osgWidget/Version
)
SET(CMAKE_INCLUDE_PATH /usr/local/include CACHE STRING Put your OSG include
dir here...)
SET(CMAKE_LIBRARY_PATH /usr/local/lib CACHE STRING Put your OSG lib dir
here...)
SET(CMAKE_DEBUG_POSTFIX d)
# Add our Lua cmake variable for turning it off and on.
# NOTE: You must be using Lua 5.1 or greater...
IF(LUA_VERSION STRGREATER 5.0)
SET(OSGWIDGET_USELUA TRUE CACHE BOOL Build with LUA support?)
ELSE(LUA_VERSION STRGREATER 5.0)
SET(OSGWIDGET_USELUA FALSE CACHE BOOL Build with LUA support?)
ENDIF(LUA_VERSION STRGREATER 5.0)
# Add our Python cmake variable for turning it off and on.
IF(PYTHON_LIBRARY)
SET(OSGWIDGET_USEPYTHON TRUE CACHE BOOL Build with Python support?)
ELSE(PYTHON_LIBRARY)
SET(OSGWIDGET_USEPYTHON FALSE CACHE BOOL Build with Python support?)
ENDIF(PYTHON_LIBRARY)
# Stuff that should be in every build...
INCLUDE_DIRECTORIES(include ${CMAKE_INCLUDE_PATH})
LINK_DIRECTORIES(${CMAKE_LIBRARY_PATH})
LINK_LIBRARIES(
debug osgd optimized osg
debug osgUtild optimized osgUtil
debug osgViewerd optimized osgViewer
debug osgTextd optimized osgText
debug osgDBd optimized osgDB
debug osgGAd optimized osgGA
debug OpenThreadsd optimized OpenThreads
)
ADD_LIBRARY(osgWidget SHARED ${SRC_FILES} ${HEADER_FILES})
# Stuff that is just available when LUA is toggled on.
IF(OSGWIDGET_USELUA)