[osg-users] [build] Xocde 7.1 with osgDB compiler error
Robert Osfield
robert.osfield at gmail.com
Thu Oct 29 02:57:53 PDT 2015
Hi Guys,
I don't have an OSX system to test against, but I've gone ahead and had a
bash at implementing what I think might be appropriate. I need it tested
by OSX users though before I check it into svn/trunk and OSG-3.4 branch.
I've used Radu's suggest change to CMake to avoid checking the 3 entry in
the MACOS_VERSION_LIST if it doesn't exist, and changed the OSX version
check to use > 10.7 rather than one of 10.8, 10.9 and 10.10. This should
provide support for future rev's of OSX till it hit's 11.x.
Could you guys these it out and let me know?
Cheers,
Robert
~/OpenSceneGraph$ svn diff CMakeLists.txt
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt (revision 15172)
+++ CMakeLists.txt (working copy)
@@ -180,8 +180,14 @@
STRING(REPLACE "." ";" MACOS_VERSION_LIST ${OSG_OSX_SDK_NAME})
LIST(GET MACOS_VERSION_LIST 0 MACOS_VERSION_MAJOR)
LIST(GET MACOS_VERSION_LIST 1 MACOS_VERSION_MINOR)
- LIST(GET MACOS_VERSION_LIST 2 MACOS_VERSION_PATCH)
+ LIST(LENGTH MACOS_VERSION_LIST MACOS_VERSION_LIST_LENGTH)
+ IF(MACOS_VERSION_LIST_LENGTH GREATER "2")
+ LIST(GET MACOS_VERSION_LIST 2 MACOS_VERSION_PATCH)
+ ELSE()
+ SET(MACOS_VERSION_PATCH "0")
+ ENDIF()
+
SET(OSG_OSX_SDK_NAME
"macosx${MACOS_VERSION_MAJOR}.${MACOS_VERSION_MINOR}")
# Trying to get CMake to generate an XCode IPhone project, current
efforts are to get iphoneos sdk 3.1 working
@@ -1109,7 +1115,7 @@
# FORCE is used because the options are not reflected in the UI
otherwise.
# Seems like a good place to add version specific compiler flags
too.
IF(NOT OSG_CONFIG_HAS_BEEN_RUN_BEFORE)
- IF(${OSG_OSX_SDK_NAME} STREQUAL "macosx10.8" OR
${OSG_OSX_SDK_NAME} STREQUAL "macosx10.9" OR ${OSG_OSX_SDK_NAME} STREQUAL
"macosx10.10")
+ IF(${MACOS_VERSION_MAJOR} EQUAL "10" AND
${MACOS_VERSION_MINOR} "7")
SET(OSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX "imageio" CACHE
STRING "Forced imageio default image plugin for OSX" FORCE)
# 64 Bit Works, i386,ppc is not supported any more
SET(CMAKE_OSX_ARCHITECTURES "x86_64" CACHE STRING "Build
architectures for OSX" FORCE)
On 29 October 2015 at 09:38, Robert Osfield <robert.osfield at gmail.com>
wrote:
> Hi Radu,
>
> What errors do you see with your build when you don't include the
> IF(MACOS_VERSION_LIST_LENGTH EQUAL "3") block to avoid querying the
> MACOS_VERSION_PATCH?
>
> With this block I'd be inclined to use GREATER 2, rather than EQUAL 3 just
> in case the MACOS implementation adds a forth element to the list.
>
> Robert.
>
> On 28 October 2015 at 14:07, Radu Popescu <radu.popescu at pix4d.com> wrote:
>
>> Hi,
>>
>> We are using OSG for a cross-platform application that runs on Windows,
>> Linux and Mac OS X (10.10 and 10.11).
>>
>> The application uses OSG 3.4 and Qt 4.8 and we had to apply some patches
>> to get this setup working. We maintain a public Git clone, based on the
>> GitHub mirror of OpenSceneGraph.
>>
>> I don't have enough posts on this forum to include a link to the repo. I
>> can share it by private messages or some other way, if anybody is
>> interested.
>>
>> We are using this Git clone internally and we haven't had the time to
>> clean it up and submit these changes back upstream (we're not even sure all
>> the changes we've made are general enough to be integrated upstream).
>>
>> Here is a patch that could help with the compilation:
>>
>> diff --git a/CMakeLists.txt b/CMakeLists.txt
>> index ce2815b..3e496c1 100644
>> --- a/CMakeLists.txt
>> +++ b/CMakeLists.txt
>> @@ -180,7 +180,13 @@ IF(APPLE)
>> STRING(REPLACE "." ";" MACOS_VERSION_LIST ${OSG_OSX_SDK_NAME})
>> LIST(GET MACOS_VERSION_LIST 0 MACOS_VERSION_MAJOR)
>> LIST(GET MACOS_VERSION_LIST 1 MACOS_VERSION_MINOR)
>> - LIST(GET MACOS_VERSION_LIST 2 MACOS_VERSION_PATCH)
>> +
>> + LIST(LENGTH MACOS_VERSION_LIST MACOS_VERSION_LIST_LENGTH)
>> + IF(MACOS_VERSION_LIST_LENGTH EQUAL "3")
>> + LIST(GET MACOS_VERSION_LIST 2 MACOS_VERSION_PATCH)
>> + ELSE()
>> + SET(MACOS_VERSION_PATCH "0")
>> + ENDIF()
>>
>> SET(OSG_OSX_SDK_NAME
>> "macosx${MACOS_VERSION_MAJOR}.${MACOS_VERSION_MINOR}")
>>
>>
>>
>> Additionally, here are the CMake configuration flags we are using to
>> compile OSG:
>>
>> cmake \
>> -DCMAKE_BUILD_TYPE=Release \
>> -DOPENGL_PROFILE="GLCORE" \
>> -DCMAKE_EXE_LINKER_FLAGS="-stdlib=libc++" \
>> -DCMAKE_MODULE_LINKER_FLAGS="-stdlib=libc++" \
>> -DCMAKE_SHARED_LINKER_FLAGS="-stdlib=libc++" \
>> -DCMAKE_OSX_ARCHITECTURES="x86_64" \
>> -DOSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX="imageio" \
>> -DOSG_WINDOWING_SYSTEM="Cocoa" \
>> -DDESIRED_QT_VERSION=4 \
>> -DQT_QMAKE_EXECUTABLE=/usr/bin/qmake \
>> -DDYNAMIC_OPENSCENEGRAPH=OFF \
>> -DDYNAMIC_OPENTHREADS=OFF
>>
>>
>> I hope this helps!
>>
>> Best regards,
>> Radu
>>
>> ----------------------
>> Radu Popescu
>> Software Engineer
>> Pix4D SA
>>
>> ------------------
>> Read this topic online here:
>> http://forum.openscenegraph.org/viewtopic.php?p=65477#65477
>>
>>
>>
>>
>>
>> _______________________________________________
>> osg-users mailing list
>> osg-users at lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20151029/1a78cada/attachment-0003.htm>
More information about the osg-users
mailing list