Board index FlightGear Support Installation Mac

Updated: Compiling sg/fg git version for OSX

Installing FlightGear, scenery, aircraft etc. on Mac.

Updated: Compiling sg/fg git version for OSX

Postby gral » Tue Nov 08, 2011 12:07 pm

Hi all

I updated this wiki
http://wiki.flightgear.org/FlightGear_Git_on_Mac_OS_X

for compiling current FlightGear Development Version for OSX 10.5. and 10.6. The build changed to cmake the last weeks and becomes much easier (many thanks to James). The wiki is still under development and some help from you is required (check it and try it, give me some feedback, i.e. does it still work for OSX 10.5 ?, edit the wiki yourself etc). Please do a fresh simgear/flightgear clone and move working versions to a safe place before you start to follow the wiki.

Cheers, gral
gral
 
Posts: 325
Joined: Mon Nov 16, 2009 1:03 pm
Location: Zurich (Switzerland)
Callsign: HB-GRAL
Version: GIT

Re: Updated: Compiling sg/fg git version for OSX

Postby linuxophile » Tue Dec 20, 2011 3:55 am

Hello,

I could not, for the life of me, manage to compile OpenSceneGraph.
Luckily, it proves unnecessary, as you can find precompiled binaries on the OpenSceneGraph site!
http://www.openscenegraph.org/projects/ ... /Downloads

(You will have to install the tree as administrator).

After that it proceeds as in the wiki, with the outstanding problem (and solution), when configuring flightgear, described here:
http://www.mail-archive.com/flightgear- ... 34372.html

UPDATE: spoke too soon, flightgear compilation fails when linking (simgear works)
linuxophile
 
Posts: 2
Joined: Sat Dec 17, 2011 6:59 am

Re: Updated: Compiling sg/fg git version for OSX

Postby gral » Tue Dec 20, 2011 10:07 am

Hi linuxophile

Ehrm, your name doesn’t really suggest you’re on OSX :-) ?

linuxophile wrote in Tue Dec 20, 2011 3:55 am:I could not, for the life of me, manage to compile OpenSceneGraph.
Luckily, it proves unnecessary, as you can find precompiled binaries on the OpenSceneGraph site!
http://www.openscenegraph.org/projects/ ... /Downloads


The intention of the wiki is to provide information for compilation from A-Z on OSX, SimGear, FlightGear and all dependencies (almost, ALUT excluded i.e., but there is a binary provided). When you follow the wiki you can just pull source later again by git pull, and recompile. When you use precompiled OSG binaries you will stay on "latest stable". Sometimes there are changes in recent SimGear/FlightGear GIT you will also need latest OSG. And you can also be sure that the compiler flags are the same from A-Z, sometimes depending on your machine/osx/configuration. I took latest OSG version 3.1.0 (GIT repository on GitHub) and not development version 3.0.1 stable or SVN trunk.

linuxophile wrote in Tue Dec 20, 2011 3:55 am:After that it proceeds as in the wiki, with the outstanding problem (and solution), when configuring flightgear, described here:
http://www.mail-archive.com/flightgear- ... 34372.html


I never run into this issue on OSX, but to be honest I didn’t (re-)compile the last weeks. I will have a try the next days myself and will have a look if this is a general problem to point out also for OSX.

Can you provide the errors you get during OSG compilation, configuration included ? This would be interesting for me, to help to solve your problem, but also to improve the wiki when necessary. Sometimes OSG won’t compile because of other non-default-linux-like installations on OSX (i.e. will fail because of Libraries/Frameworks used for scenery tools).

Cheers, gral
gral
 
Posts: 325
Joined: Mon Nov 16, 2009 1:03 pm
Location: Zurich (Switzerland)
Callsign: HB-GRAL
Version: GIT

Re: Updated: Compiling sg/fg git version for OSX

Postby Trez » Sat Jul 28, 2012 5:46 pm

Did anyone get this working on 10.6? i'm having a hard time with the openscenegraph
Code: Select all
git clone https://github.com/openscenegraph/osg.git OpenSceneGraph
Cloning into 'OpenSceneGraph'...
remote: Counting objects: 125190, done.
remote: Compressing objects: 100% (22165/22165), done.
remote: Total 125190 (delta 100898), reused 124727 (delta 100518)
Receiving objects: 100% (125190/125190), 32.75 MiB | 418 KiB/s, done.
Resolving deltas: 100% (100898/100898), done.
Checking out files: 100% (3060/3060), done.
tristan-dijkstras-MacBook-Pro:~ tristandijkstra$ cd OpenSceneGraph
tristan-dijkstras-MacBook-Pro:OpenSceneGraph tristandijkstra$ cmake  -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release \
> -DCMAKE_OSX_SYSROOT=/Developer/SDKs/MacOSX10.6.sdk -DCMAKE_OSX_ARCHITECTURES="i386;x86_64" \
> -DCMAKE_OSX_DEPLOYMENT_TARGET=10.6 -DCMAKE_MINSIZEREL_POSTFIX= -DBUILD_OSG_APPLICATIONS=OFF \
> -DCMAKE_RELWITHDEBINFO_POSTFIX= -DOSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX=imageio \
> -DOSG_WINDOWING_SYSTEM=Cocoa

-- The C compiler identification is GNU 4.2.1
-- The CXX compiler identification is GNU 4.2.1
-- Checking whether C compiler has -isysroot
-- Checking whether C compiler has -isysroot - yes
-- Checking whether C compiler supports OSX deployment target flag
-- Checking whether C compiler supports OSX deployment target flag - yes
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Checking whether CXX compiler has -isysroot
-- Checking whether CXX compiler has -isysroot - yes
-- Checking whether CXX compiler supports OSX deployment target flag
-- Checking whether CXX compiler supports OSX deployment target flag - yes
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE 
2012-07-28 13:43:21.540 defaults[6647:903]
The domain/default pair of (/Developer/SDKs/MacOSX10.6.sdk/SDKSettings.plist, CanonicalName) does not exist
-- Found OpenGL: /System/Library/Frameworks/OpenGL.framework 
-- Looking for XOpenDisplay in /usr/X11R6/lib/libX11.dylib;/usr/X11R6/lib/libXext.dylib
-- Looking for XOpenDisplay in /usr/X11R6/lib/libX11.dylib;/usr/X11R6/lib/libXext.dylib - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
-- Found X11: /usr/X11R6/lib/libX11.dylib
-- Could NOT find PKG_CONFIG (missing:  PKG_CONFIG_EXECUTABLE)
-- Found LibXml2: /usr/lib/libxml2.dylib (found version "2.7.3")
-- Could NOT find PKG_CONFIG (missing:  PKG_CONFIG_EXECUTABLE)
-- Found CURL: /usr/lib/libcurl.dylib (found version "7.19.7")
-- Found OpenAL: /System/Library/Frameworks/OpenAL.framework 
-- Could NOT find SDL (missing:  SDL_LIBRARY SDL_INCLUDE_DIR)
-- Could NOT find PKG_CONFIG (missing:  PKG_CONFIG_EXECUTABLE)
-- Could NOT find PKG_CONFIG (missing:  PKG_CONFIG_EXECUTABLE)
-- Could NOT find PKG_CONFIG (missing:  PKG_CONFIG_EXECUTABLE)
-- Looking for Q_WS_X11
-- Looking for Q_WS_X11 - not found.
-- Looking for Q_WS_WIN
-- Looking for Q_WS_WIN - not found.
-- Looking for Q_WS_QWS
-- Looking for Q_WS_QWS - not found.
-- Looking for Q_WS_MAC
-- Looking for Q_WS_MAC - found
-- Looking for QT_MAC_USE_COCOA
-- Looking for QT_MAC_USE_COCOA - found
-- Found Qt4: /opt/local/bin/qmake (found version "4.8.2")
-- Performing Test _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS
-- Performing Test _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS - Success
-- Performing Test _OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS
-- Performing Test _OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS - Failed
-- Performing Test _OPENTHREADS_ATOMIC_USE_SUN
-- Performing Test _OPENTHREADS_ATOMIC_USE_SUN - Failed
-- Performing Test _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED
-- Performing Test _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED - Failed
-- Performing Test _OPENTHREADS_ATOMIC_USE_BSD_ATOMIC
-- Performing Test _OPENTHREADS_ATOMIC_USE_BSD_ATOMIC - Success
-- Looking for pthread_yield
-- Looking for pthread_yield - not found
-- Looking for sched_yield
-- Looking for sched_yield - found
-- Looking for pthread_setconcurrency
-- Looking for pthread_setconcurrency - found
-- Looking for pthread_getconcurrency
-- Looking for pthread_getconcurrency - found
-- Looking for pthread_setaffinity_np
-- Looking for pthread_setaffinity_np - not found
-- Performing Test HAVE_THREE_PARAM_SCHED_SETAFFINITY
-- Performing Test HAVE_THREE_PARAM_SCHED_SETAFFINITY - Failed
-- Performing Test HAVE_TWO_PARAM_SCHED_SETAFFINITY
-- Performing Test HAVE_TWO_PARAM_SCHED_SETAFFINITY - Failed
CMake Error at src/osgViewer/CMakeLists.txt:71 (IF):
  if given arguments:

    "STREQUAL" "macosx10.7" "OR" "STREQUAL" "macosx10.6" "OR" "STREQUAL" "macosx10.5"

  Unknown arguments specified


-- Configuring incomplete, errors occurred!




can a mac git user help me out?
Last edited by Trez on Sat Jul 28, 2012 8:59 pm, edited 1 time in total.
User avatar
Trez
 
Posts: 437
Joined: Thu Jul 14, 2011 10:50 am
Location: Netherlands
Callsign: Trez
Version: 2.8 GIT
OS: OSX10.8, Mint 14

Re: Updated: Compiling sg/fg git version for OSX

Postby gral » Sat Jul 28, 2012 7:28 pm

Hi Trez

Remove the file "CMakeCache.txt" and run cmake with this:

Code: Select all
cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_OSX_SYSROOT=/Developer/SDKs/MacOSX10.6.sdk -DCMAKE_OSX_ARCHITECTURES="i386;x86_64" \
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.6 -DCMAKE_MINSIZEREL_POSTFIX= -DBUILD_OSG_APPLICATIONS=OFF \
-DCMAKE_RELWITHDEBINFO_POSTFIX= -DOSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX=imageio \
-DOSG_WINDOWING_SYSTEM=Cocoa \
-Wno-dev


See the "-Wno-dev" at the end. Hope this helps.

-gral
gral
 
Posts: 325
Joined: Mon Nov 16, 2009 1:03 pm
Location: Zurich (Switzerland)
Callsign: HB-GRAL
Version: GIT

Re: Updated: Compiling sg/fg git version for OSX

Postby Trez » Sat Jul 28, 2012 9:16 pm

Hi gral thanks for the quick response,

Sadly it didn't work.

Sorry i'm not the most experienced with this but i hope you have the patience to help me :)

Here is the full log:

Code: Select all
cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release \
> -DCMAKE_OSX_SYSROOT=/Developer/SDKs/MacOSX10.6.sdk -DCMAKE_OSX_ARCHITECTURES="i386;x86_64" \
> -DCMAKE_OSX_DEPLOYMENT_TARGET=10.6 -DCMAKE_MINSIZEREL_POSTFIX= -DBUILD_OSG_APPLICATIONS=OFF \
> -DCMAKE_RELWITHDEBINFO_POSTFIX= -DOSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX=imageio \
> -DOSG_WINDOWING_SYSTEM=Cocoa \
> -Wno-dev
-- The C compiler identification is GNU 4.2.1
-- The CXX compiler identification is GNU 4.2.1
-- Checking whether C compiler has -isysroot
-- Checking whether C compiler has -isysroot - yes
-- Checking whether C compiler supports OSX deployment target flag
-- Checking whether C compiler supports OSX deployment target flag - yes
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Checking whether CXX compiler has -isysroot
-- Checking whether CXX compiler has -isysroot - yes
-- Checking whether CXX compiler supports OSX deployment target flag
-- Checking whether CXX compiler supports OSX deployment target flag - yes
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE 
2012-07-28 17:05:24.525 defaults[3951:903]
The domain/default pair of (/Developer/SDKs/MacOSX10.6.sdk/SDKSettings.plist, CanonicalName) does not exist
-- Found OpenGL: /System/Library/Frameworks/OpenGL.framework 
-- Looking for XOpenDisplay in /opt/local/lib/libX11.dylib;/opt/local/lib/libXext.dylib
-- Looking for XOpenDisplay in /opt/local/lib/libX11.dylib;/opt/local/lib/libXext.dylib - not found
-- Looking for dnet_ntoa in dnet
-- Looking for dnet_ntoa in dnet - not found
-- Looking for dnet_ntoa in dnet_stub
-- Looking for dnet_ntoa in dnet_stub - not found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - not found
-- Found X11: /opt/local/lib/libX11.dylib
-- Found PKG_CONFIG: /opt/local/bin/pkg-config (found version "0.27")
-- Found LibXml2: /opt/local/lib/libxml2.dylib (found version "2.7.8")
-- checking for module 'gta'
--   package 'gta' not found
-- Found CURL: /usr/lib/libcurl.dylib (found version "7.19.7")
-- Found OpenAL: /System/Library/Frameworks/OpenAL.framework 
-- Found SDL: /opt/local/lib/libSDLmain.a;/opt/local/lib/libSDL.dylib;-framework Cocoa 
-- checking for module 'cairo'
--   found cairo, version 1.12.2
-- checking for module 'poppler-glib'
--   package 'poppler-glib' not found
-- checking for module 'librsvg-2.0'
--   package 'librsvg-2.0' not found
-- checking for module 'gtk+-2.0'
--   found gtk+-2.0, version 2.24.10
-- checking for module 'gtkglext-x11-1.0'
--   package 'gtkglext-x11-1.0' not found
-- Looking for Q_WS_X11
-- Looking for Q_WS_X11 - not found.
-- Looking for Q_WS_WIN
-- Looking for Q_WS_WIN - not found.
-- Looking for Q_WS_QWS
-- Looking for Q_WS_QWS - not found.
-- Looking for Q_WS_MAC
-- Looking for Q_WS_MAC - found
-- Looking for QT_MAC_USE_COCOA
-- Looking for QT_MAC_USE_COCOA - found
-- Found Qt4: /opt/local/bin/qmake (found version "4.8.2")
-- Performing Test _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS
-- Performing Test _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS - Success
-- Performing Test _OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS
-- Performing Test _OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS - Failed
-- Performing Test _OPENTHREADS_ATOMIC_USE_SUN
-- Performing Test _OPENTHREADS_ATOMIC_USE_SUN - Failed
-- Performing Test _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED
-- Performing Test _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED - Failed
-- Performing Test _OPENTHREADS_ATOMIC_USE_BSD_ATOMIC
-- Performing Test _OPENTHREADS_ATOMIC_USE_BSD_ATOMIC - Success
-- Looking for pthread_yield
-- Looking for pthread_yield - not found
-- Looking for sched_yield
-- Looking for sched_yield - found
-- Looking for pthread_setconcurrency
-- Looking for pthread_setconcurrency - found
-- Looking for pthread_getconcurrency
-- Looking for pthread_getconcurrency - found
-- Looking for pthread_setaffinity_np
-- Looking for pthread_setaffinity_np - not found
-- Performing Test HAVE_THREE_PARAM_SCHED_SETAFFINITY
-- Performing Test HAVE_THREE_PARAM_SCHED_SETAFFINITY - Failed
-- Performing Test HAVE_TWO_PARAM_SCHED_SETAFFINITY
-- Performing Test HAVE_TWO_PARAM_SCHED_SETAFFINITY - Failed
CMake Error at src/osgViewer/CMakeLists.txt:71 (IF):
  if given arguments:

    "STREQUAL" "macosx10.7" "OR" "STREQUAL" "macosx10.6" "OR" "STREQUAL" "macosx10.5"

  Unknown arguments specified


-- Configuring incomplete, errors occurred!


EDIT:
Maybe this has to do with me not updating the ports today i tried updating macports result:
Code: Select all
 sudo port selfupdate
Password:
--->  Updating MacPorts base sources using rsync
MacPorts base version 2.1.2 installed,
MacPorts base version 2.1.2 downloaded.
--->  Updating the ports tree
--->  MacPorts base is already the latest version

The ports tree has been updated. To upgrade your installed ports, you should run
  port upgrade outdated
myname-MacBook-Pro:~ myname$ sudo port upgrade outdated
Error: No ports matched the given expression
myname-MacBook-Pro:~ myname$ port upgrade outdated

any reason?
User avatar
Trez
 
Posts: 437
Joined: Thu Jul 14, 2011 10:50 am
Location: Netherlands
Callsign: Trez
Version: 2.8 GIT
OS: OSX10.8, Mint 14

Re: Updated: Compiling sg/fg git version for OSX

Postby gral » Sun Jul 29, 2012 10:03 am

Hi Trez

Getting this result from macports means there are no ports to upgrade. So no problem I think. I had some problems too with OSG some time ago, have a look to cmakelists and check where this STREQUAL is performed. Comment out this lines with # from "if" to "endif" and try again. Someone introduced a really bad osx check in osg which throws this error when you're using older system versions/sdk/xcode. You don't need this checks because it does not affect your osg/sg/fg install.

-gral
gral
 
Posts: 325
Joined: Mon Nov 16, 2009 1:03 pm
Location: Zurich (Switzerland)
Callsign: HB-GRAL
Version: GIT

Re: Updated: Compiling sg/fg git version for OSX

Postby Trez » Sun Jul 29, 2012 3:58 pm

Code: Select all
make -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release \
> -DCMAKE_OSX_SYSROOT=/Developer/SDKs/MacOSX10.6.sdk -DCMAKE_OSX_ARCHITECTURES="i386;x86_64" \
> -DCMAKE_OSX_DEPLOYMENT_TARGET=10.6 -DCMAKE_MINSIZEREL_POSTFIX= -DBUILD_OSG_APPLICATIONS=OFF \
> -DCMAKE_RELWITHDEBINFO_POSTFIX= -DOSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX=imageio \
> -DOSG_WINDOWING_SYSTEM=Cocoa \
> -Wno-dev
2012-07-29 11:13:52.111 defaults[45863:903]
The domain/default pair of (/Developer/SDKs/MacOSX10.6.sdk/SDKSettings.plist, CanonicalName) does not exist
-- checking for module 'gta'
--   package 'gta' not found
-- checking for module 'poppler-glib'
--   package 'poppler-glib' not found
-- checking for module 'librsvg-2.0'
--   package 'librsvg-2.0' not found
-- checking for module 'gtkglext-x11-1.0'
--   package 'gtkglext-x11-1.0' not found
CMake Error: Error in cmake code at
/Users/tristandijkstra/OpenSceneGraph/src/osgViewer/CMakeLists.txt:72:
Parse error.  Expected a command name, got unquoted argument with text "${OSG_OSX_SDK_NAME}".
'CMake Error at CMakeLists.txt:858 (IF):
  if given arguments:

    "STREQUAL" "macosx10.7"

  Unknown arguments specified


-- Configuring incomplete, errors occurred!

i think it's even worse now this was the first edit i did afterwards i did the # thing to the other strequals and it wasn't much better:

the file:
Code: Select all
# FIXME: For OS X, need flag for Framework or dylib
IF(DYNAMIC_OPENSCENEGRAPH)
    ADD_DEFINITIONS(-DOSGVIEWER_LIBRARY)
ELSE()
    ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC)
ENDIF()

SET(LIB_NAME osgViewer)

SET(HEADER_PATH ${OpenSceneGraph_SOURCE_DIR}/include/${LIB_NAME})
SET(TARGET_H
    ${HEADER_PATH}/CompositeViewer
    ${HEADER_PATH}/Export
    ${HEADER_PATH}/GraphicsWindow
    ${HEADER_PATH}/Renderer
    ${HEADER_PATH}/Scene
    ${HEADER_PATH}/Version
    ${HEADER_PATH}/View
    ${HEADER_PATH}/Viewer
    ${HEADER_PATH}/ViewerBase
    ${HEADER_PATH}/ViewerEventHandlers
)

SET(LIB_COMMON_FILES
    CompositeViewer.cpp
    GraphicsWindow.cpp
    HelpHandler.cpp
    Renderer.cpp
    Scene.cpp
    ScreenCaptureHandler.cpp
    StatsHandler.cpp
    Version.cpp
    View.cpp
    Viewer.cpp
    ViewerBase.cpp
    ViewerEventHandlers.cpp
    ${OPENSCENEGRAPH_VERSIONINFO_RC}
)

SET(LIB_EXTRA_LIBS)

IF(WIN32 AND NOT ANDROID)
    #
    # Enable workaround for OpenGL driver issues when used in multithreaded/multiscreen with NVidia drivers on Windows XP
    # For example: osgviewer dumptruck.osg was showing total garbage (screen looked like shattered, splashed hedgehog)
    # There were also serious issues with render to texture cameras.
    # Workaround repeats makeCurrentContext call as it was found that this causes the problems to dissapear.
    #
    OPTION(OSG_MULTIMONITOR_MULTITHREAD_WIN32_NVIDIA_WORKAROUND "Set to ON if you have NVidia board and drivers earlier than 177.92 ver" OFF)
    MARK_AS_ADVANCED(OSG_MULTIMONITOR_MULTITHREAD_WIN32_NVIDIA_WORKAROUND)
    IF(OSG_MULTIMONITOR_MULTITHREAD_WIN32_NVIDIA_WORKAROUND)
        ADD_DEFINITIONS(-DOSG_MULTIMONITOR_MULTITHREAD_WIN32_NVIDIA_WORKAROUND)
    ENDIF()

    SET(TARGET_H_NO_MODULE_INSTALL
        ${HEADER_PATH}/api/Win32/GraphicsHandleWin32
        ${HEADER_PATH}/api/Win32/GraphicsWindowWin32
        ${HEADER_PATH}/api/Win32/PixelBufferWin32
    )
       
    SET(LIB_COMMON_FILES ${LIB_COMMON_FILES}
        GraphicsWindowWin32.cpp
        PixelBufferWin32.cpp
    )
ELSE()
    IF(APPLE)

        IF(OSG_BUILD_PLATFORM_IPHONE OR OSG_BUILD_PLATFORM_IPHONE_SIMULATOR)
            SET(OSG_WINDOWING_SYSTEM "IOS" CACHE STRING "Windowing system type for graphics window creation, options only IOS.")
        ELSE()
            #IF(${OSG_OSX_SDK_NAME} STREQUAL "macosx10.7" OR
               ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.6" OR
               ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.5")
                SET(OSG_WINDOWING_SYSTEM "Cocoa" CACHE STRING "Windowing system type for graphics window creation, options Carbon, Cocoa or X11.")
            ELSE()#
                SET(OSG_WINDOWING_SYSTEM "Carbon" CACHE STRING "Windowing system type for graphics window creation, options Carbon, Cocoa or X11.")
            ENDIF()
        ENDIF()

    ELSE()
        IF(ANDROID)
            SET(OSG_WINDOWING_SYSTEM "None" CACHE STRING "None Windowing system type for graphics window creation.")
        ELSE()
            SET(OSG_WINDOWING_SYSTEM "X11" CACHE STRING "Windowing system type for graphics window creation. options only X11")
        ENDIF()
    ENDIF()

    IF(${OSG_WINDOWING_SYSTEM} STREQUAL "Cocoa")
        ADD_DEFINITIONS(-DUSE_DARWIN_COCOA_IMPLEMENTATION)   
 
        IF(OSG_COMPILE_FRAMEWORKS)
           SET(LIB_COMMON_FILES ${LIB_COMMON_FILES}
                 ${HEADER_PATH}/api/Cocoa/GraphicsHandleCocoa
                 ${HEADER_PATH}/api/Cocoa/GraphicsWindowCocoa
                 ${HEADER_PATH}/api/Cocoa/PixelBufferCocoa
             )
            SET_PROPERTY(SOURCE ${HEADER_PATH}/api/Cocoa/GraphicsHandleCocoa PROPERTY MACOSX_PACKAGE_LOCATION Headers/api/Cocoa)
            SET_PROPERTY(SOURCE ${HEADER_PATH}/api/Cocoa/GraphicsWindowCocoa PROPERTY MACOSX_PACKAGE_LOCATION Headers/api/Cocoa)
            SET_PROPERTY(SOURCE ${HEADER_PATH}/api/Cocoa/PixelBufferCocoa PROPERTY MACOSX_PACKAGE_LOCATION Headers/api/Cocoa)
        ELSE()
            SET(TARGET_H_NO_MODULE_INSTALL
                ${HEADER_PATH}/api/Cocoa/GraphicsHandleCocoa
                ${HEADER_PATH}/api/Cocoa/GraphicsWindowCocoa
                ${HEADER_PATH}/api/Cocoa/PixelBufferCocoa
            )
        ENDIF() 
 
        SET(LIB_COMMON_FILES ${LIB_COMMON_FILES}
            GraphicsWindowCocoa.mm
            DarwinUtils.h
            DarwinUtils.mm
            PixelBufferCocoa.mm
        )
        SET(LIB_EXTRA_LIBS ${COCOA_LIBRARY} ${LIB_EXTRA_LIBS})

    ELSEIF(${OSG_WINDOWING_SYSTEM} STREQUAL "Carbon")
        ADD_DEFINITIONS(-DUSE_DARWIN_CARBON_IMPLEMENTATION)     
 
        IF(OSG_COMPILE_FRAMEWORKS)
           SET(LIB_COMMON_FILES ${LIB_COMMON_FILES}
                 ${HEADER_PATH}/api/Carbon/GraphicsHandleCarbon
                 ${HEADER_PATH}/api/Carbon/GraphicsWindowCarbon
                 ${HEADER_PATH}/api/Carbon/PixelBufferCarbon
             )
            SET_PROPERTY(SOURCE ${HEADER_PATH}/api/Carbon/GraphicsHandleCarbon PROPERTY MACOSX_PACKAGE_LOCATION Headers/api/Carbon)
            SET_PROPERTY(SOURCE ${HEADER_PATH}/api/Carbon/GraphicsWindowCarbon PROPERTY MACOSX_PACKAGE_LOCATION Headers/api/Carbon)
            SET_PROPERTY(SOURCE ${HEADER_PATH}/api/Carbon/PixelBufferCarbon PROPERTY MACOSX_PACKAGE_LOCATION Headers/api/Carbon)
        ELSE()
            SET(TARGET_H_NO_MODULE_INSTALL
                ${HEADER_PATH}/api/Carbon/GraphicsHandleCarbon
                ${HEADER_PATH}/api/Carbon/GraphicsWindowCarbon
                ${HEADER_PATH}/api/Carbon/PixelBufferCarbon
            )
        ENDIF()

        SET(LIB_COMMON_FILES ${LIB_COMMON_FILES}
            GraphicsWindowCarbon.cpp
            DarwinUtils.h
            DarwinUtils.mm
            PixelBufferCarbon.cpp
        )

        SET(LIB_EXTRA_LIBS ${COCOA_LIBRARY} ${AGL_LIBRARY} ${LIB_EXTRA_LIBS})

    ELSEIF(${OSG_WINDOWING_SYSTEM} STREQUAL "IOS")

        ADD_DEFINITIONS(-DUSE_IOS_IMPLEMENTATION)     
 
        IF(OSG_COMPILE_FRAMEWORKS)
           SET(LIB_COMMON_FILES ${LIB_COMMON_FILES}
                 ${HEADER_PATH}/api/IOS/GraphicsWindowIOS
             )

            SET_PROPERTY(SOURCE ${HEADER_PATH}/api/IOS/GraphicsWindowIOS PROPERTY MACOSX_PACKAGE_LOCATION Headers/api/IOS)
        ELSE()
            SET(TARGET_H_NO_MODULE_INSTALL
                ${HEADER_PATH}/api/IOS/GraphicsWindowIOS
                #${HEADER_PATH}/api/IOS/PixelBufferIOS
            )
        ENDIF()   
 
        SET(LIB_COMMON_FILES ${LIB_COMMON_FILES}
            GraphicsWindowIOS.mm
            IOSUtils.h
            IOSUtils.mm
        )

        SET(LIB_EXTRA_LIBS ${COCOA_LIBRARY} ${LIB_EXTRA_LIBS})

    ELSEIF(${OSG_WINDOWING_SYSTEM} STREQUAL "X11")
        # X11 for everybody else
        INCLUDE(FindPkgConfig OPTIONAL)
        IF(PKG_CONFIG_FOUND)
            PKG_CHECK_MODULES(XRANDR xrandr)
            IF(XRANDR_FOUND)
                OPTION(OSGVIEWER_USE_XRANDR "Set to ON to enable Xrandr support for GraphicsWindowX11." ON)
            ELSE()
                SET(OSGVIEWER_USE_XRANDR OFF)
            ENDIF()
        ELSE()
            SET(OSGVIEWER_USE_XRANDR OFF)
        ENDIF()

        SET(TARGET_H_NO_MODULE_INSTALL
            ${HEADER_PATH}/api/X11/GraphicsHandleX11
            ${HEADER_PATH}/api/X11/GraphicsWindowX11
            ${HEADER_PATH}/api/X11/PixelBufferX11
        )

        SET(LIB_COMMON_FILES ${LIB_COMMON_FILES}
            GraphicsWindowX11.cpp
            PixelBufferX11.cpp
        )
       
        IF(OSGVIEWER_USE_XRANDR)
            ADD_DEFINITIONS(-DOSGVIEWER_USE_XRANDR)
            SET(LIB_PRIVATE_HEADERS ${LIB_PRIVATE_HEADERS} ${XRANDR_INCLUDE_DIRS} )

            IF(X11_Xrandr_LIB)
                SET(LIB_EXTRA_LIBS ${X11_Xrandr_LIB} ${LIB_EXTRA_LIBS})
            ELSE()
                SET(LIB_EXTRA_LIBS ${XRANDR_LIBRARIES} ${LIB_EXTRA_LIBS})
            ENDIF()
        ENDIF()

        # X11 on Apple requires X11 library plus OpenGL linking hack on Leopard
        IF(APPLE)
            # hack for finding the iphone opengl es lib
            IF(OSG_BUILD_PLATFORM_IPHONE OR OSG_BUILD_PLATFORM_IPHONE_SIMULATOR)
                SET(OPENGL_INCLUDE_DIR ${IPHONE_SDKROOT}System/Library/Frameworks)
                SET(OPENGL_LIBRARIES ${IPHONE_SDKROOT}System/Library/Frameworks/OpenGLES)
            ELSE()
                # Find GL/glx.h
                IF(EXISTS ${CMAKE_OSX_SYSROOT}/usr/X11/include/GL/glx.h)
                    SET(OPENGL_INCLUDE_DIR /usr/X11/include)
                    SET(OPENGL_LIBRARIES /usr/X11/lib/libGL.dylib)
                ELSEIF(EXISTS ${CMAKE_OSX_SYSROOT}/usr/X11R6/include/GL/glx.h)
                    SET(OPENGL_INCLUDE_DIR /usr/X11R6/include)
                    SET(OPENGL_LIBRARIES /usr/X11R6/lib/libGL.dylib)
                ENDIF()
                INCLUDE_DIRECTORIES(BEFORE SYSTEM ${OPENGL_INCLUDE_DIR})

                SET(LIB_EXTRA_LIBS ${X11_X11_LIB} ${OPENGL_LIBRARIES} ${LIB_EXTRA_LIBS})
                SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:${CMAKE_OSX_SYSROOT}/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib")
            ENDIF()

        ELSE(APPLE)

            SET(LIB_EXTRA_LIBS ${X11_X11_LIB} ${LIB_EXTRA_LIBS})
        ENDIF(APPLE)
    ELSE()
        MESSAGE(STATUS "Windowing system not supported")
    ENDIF()
ENDIF()


SET(TARGET_SRC
    ${LIB_PRIVATE_HEADERS}
    ${LIB_COMMON_FILES}
)


SET(TARGET_LIBRARIES   
    osgGA
    osgText
    osgDB
    osgUtil
    osg
    OpenThreads
)

SET(TARGET_EXTERNAL_LIBRARIES ${LIB_EXTRA_LIBS})

IF(MINGW OR CYGWIN)
    SET(TARGET_EXTERNAL_LIBRARIES ${TARGET_EXTERNAL_LIBRARY} gdi32 )
ENDIF()

SETUP_LIBRARY(${LIB_NAME})

# install these headers manually since setup_library and moduleinstall
# wouldn't keep the structure, e.g. api/X11/xyz.h
FOREACH(HEADERFILE ${TARGET_H_NO_MODULE_INSTALL})
  # get relative path to graphics system dependant header
  FILE(RELATIVE_PATH REL_INCLUDEFILE ${HEADER_PATH} ${HEADERFILE})
  GET_FILENAME_COMPONENT(REL_INCLUDE_PATH ${REL_INCLUDEFILE} PATH)

  INSTALL(FILES ${HEADERFILE}
    DESTINATION ${INSTALL_INCDIR}/${LIB_NAME}/${REL_INCLUDE_PATH}
    COMPONENT libopenscenegraph-dev
  )
ENDFOREACH()

# for structure in ide
SOURCE_GROUP("${HEADERS_GROUP}\\api" FILES ${TARGET_H_NO_MODULE_INSTALL})


and the results:
Code: Select all
cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release \
> -DCMAKE_OSX_SYSROOT=/Developer/SDKs/MacOSX10.6.sdk -DCMAKE_OSX_ARCHITECTURES="i386;x86_64" \
> -DCMAKE_OSX_DEPLOYMENT_TARGET=10.6 -DCMAKE_MINSIZEREL_POSTFIX= -DBUILD_OSG_APPLICATIONS=OFF \
> -DCMAKE_RELWITHDEBINFO_POSTFIX= -DOSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX=imageio \
> -DOSG_WINDOWING_SYSTEM=Cocoa \
> -Wno-dev
2012-07-29 11:57:14.815 defaults[46236:903]
The domain/default pair of (/Developer/SDKs/MacOSX10.6.sdk/SDKSettings.plist, CanonicalName) does not exist
-- checking for module 'gta'
--   package 'gta' not found
-- checking for module 'poppler-glib'
--   package 'poppler-glib' not found
-- checking for module 'librsvg-2.0'
--   package 'librsvg-2.0' not found
-- checking for module 'gtkglext-x11-1.0'
--   package 'gtkglext-x11-1.0' not found
CMake Error: Error in cmake code at
/Users/tristandijkstra/OpenSceneGraph/src/osgViewer/CMakeLists.txt:72:
Parse error.  Expected a command name, got unquoted argument with text "${OSG_OSX_SDK_NAME}".
CMake Error at CMakeLists.txt:858 (IF):
  if given arguments:

    "STREQUAL" "macosx10.7"

  Unknown arguments specified


-- Configuring incomplete, errors occurred!
User avatar
Trez
 
Posts: 437
Joined: Thu Jul 14, 2011 10:50 am
Location: Netherlands
Callsign: Trez
Version: 2.8 GIT
OS: OSX10.8, Mint 14

Re: Updated: Compiling sg/fg git version for OSX

Postby gral » Sun Jul 29, 2012 4:20 pm

Ok. You can try with this CMakeList.txt (save it as CMakeList.txt and replace the origin you get with git, but in a clean copy where you didn’t run cmake before)
http://pastebin.com/Y99DkrwT

-gral
gral
 
Posts: 325
Joined: Mon Nov 16, 2009 1:03 pm
Location: Zurich (Switzerland)
Callsign: HB-GRAL
Version: GIT

Re: Updated: Compiling sg/fg git version for OSX

Postby Trez » Sun Jul 29, 2012 5:06 pm

Code: Select all
git clone https://github.com/openscenegraph/osg.git OpenSceneGraph
Cloning into 'OpenSceneGraph'...

remote: Counting objects: 125190, done.
remote: Compressing objects: 100% (22165/22165), done.
remote: Total 125190 (delta 100898), reused 124727 (delta 100518)
Receiving objects: 100% (125190/125190), 32.75 MiB | 160 KiB/s, done.
Resolving deltas: 100% (100898/100898), done.
Checking out files: 100% (3060/3060), done.
tristan-dijkstras-MacBook-Pro:~ tristandijkstra$
tristan-dijkstras-MacBook-Pro:~ tristandijkstra$ cd OpenSceneGraph
tristan-dijkstras-MacBook-Pro:OpenSceneGraph tristandijkstra$ cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release \
> -DCMAKE_OSX_SYSROOT=/Developer/SDKs/MacOSX10.6.sdk -DCMAKE_OSX_ARCHITECTURES="i386;x86_64" \
> -DCMAKE_OSX_DEPLOYMENT_TARGET=10.6 -DCMAKE_MINSIZEREL_POSTFIX= -DBUILD_OSG_APPLICATIONS=OFF \
> -DCMAKE_RELWITHDEBINFO_POSTFIX= -DOSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX=imageio \
> -DOSG_WINDOWING_SYSTEM=Cocoa \
> -Wno-dev
-- The C compiler identification is GNU 4.2.1
-- The CXX compiler identification is GNU 4.2.1
-- Checking whether C compiler has -isysroot
-- Checking whether C compiler has -isysroot - yes
-- Checking whether C compiler supports OSX deployment target flag
-- Checking whether C compiler supports OSX deployment target flag - yes
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Checking whether CXX compiler has -isysroot
-- Checking whether CXX compiler has -isysroot - yes
-- Checking whether CXX compiler supports OSX deployment target flag
-- Checking whether CXX compiler supports OSX deployment target flag - yes
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE 
2012-07-29 13:03:33.671 defaults[49463:903]
The domain/default pair of (/Developer/SDKs/MacOSX10.6.sdk/SDKSettings.plist, CanonicalName) does not exist
-- Found OpenGL: /System/Library/Frameworks/OpenGL.framework 
-- Looking for XOpenDisplay in /opt/local/lib/libX11.dylib;/opt/local/lib/libXext.dylib
-- Looking for XOpenDisplay in /opt/local/lib/libX11.dylib;/opt/local/lib/libXext.dylib - not found
-- Looking for dnet_ntoa in dnet
-- Looking for dnet_ntoa in dnet - not found
-- Looking for dnet_ntoa in dnet_stub
-- Looking for dnet_ntoa in dnet_stub - not found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - not found
-- Found X11: /opt/local/lib/libX11.dylib
-- Found PKG_CONFIG: /opt/local/bin/pkg-config (found version "0.27")
-- Found LibXml2: /opt/local/lib/libxml2.dylib (found version "2.7.8")
-- checking for module 'gta'
--   package 'gta' not found
-- Found CURL: /usr/lib/libcurl.dylib (found version "7.19.7")
-- Found OpenAL: /System/Library/Frameworks/OpenAL.framework 
-- Found SDL: /opt/local/lib/libSDLmain.a;/opt/local/lib/libSDL.dylib;-framework Cocoa 
-- checking for module 'cairo'
--   found cairo, version 1.12.2
-- checking for module 'poppler-glib'
--   package 'poppler-glib' not found
-- checking for module 'librsvg-2.0'
--   package 'librsvg-2.0' not found
-- checking for module 'gtk+-2.0'
--   found gtk+-2.0, version 2.24.10
-- checking for module 'gtkglext-x11-1.0'
--   package 'gtkglext-x11-1.0' not found
-- Looking for Q_WS_X11
-- Looking for Q_WS_X11 - not found.
-- Looking for Q_WS_WIN
-- Looking for Q_WS_WIN - not found.
-- Looking for Q_WS_QWS
-- Looking for Q_WS_QWS - not found.
-- Looking for Q_WS_MAC
-- Looking for Q_WS_MAC - found
-- Looking for QT_MAC_USE_COCOA
-- Looking for QT_MAC_USE_COCOA - found
-- Found Qt4: /opt/local/bin/qmake (found version "4.8.2")
-- Performing Test _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS
-- Performing Test _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS - Success
-- Performing Test _OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS
-- Performing Test _OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS - Failed
-- Performing Test _OPENTHREADS_ATOMIC_USE_SUN
-- Performing Test _OPENTHREADS_ATOMIC_USE_SUN - Failed
-- Performing Test _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED
-- Performing Test _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED - Failed
-- Performing Test _OPENTHREADS_ATOMIC_USE_BSD_ATOMIC
-- Performing Test _OPENTHREADS_ATOMIC_USE_BSD_ATOMIC - Success
-- Looking for pthread_yield
-- Looking for pthread_yield - not found
-- Looking for sched_yield
-- Looking for sched_yield - found
-- Looking for pthread_setconcurrency
-- Looking for pthread_setconcurrency - found
-- Looking for pthread_getconcurrency
-- Looking for pthread_getconcurrency - found
-- Looking for pthread_setaffinity_np
-- Looking for pthread_setaffinity_np - not found
-- Performing Test HAVE_THREE_PARAM_SCHED_SETAFFINITY
-- Performing Test HAVE_THREE_PARAM_SCHED_SETAFFINITY - Failed
-- Performing Test HAVE_TWO_PARAM_SCHED_SETAFFINITY
-- Performing Test HAVE_TWO_PARAM_SCHED_SETAFFINITY - Failed
2012-07-29 13:03:57.661 defaults[50114:903]
The domain/default pair of (/Developer/SDKs/MacOSX10.6.sdk/SDKSettings.plist, CanonicalName) does not exist
CMake Error: File /Users/tristandijkstra/OpenSceneGraph/src/osgViewer/src/osg/Config.in does not exist.
CMake Error at src/osgViewer/CMakeLists.txt:457 (CONFIGURE_FILE):
  configure_file Problem configuring file


CMake Error: File /Users/tristandijkstra/OpenSceneGraph/src/osgViewer/src/osg/Version.in does not exist.
CMake Error at src/osgViewer/CMakeLists.txt:461 (CONFIGURE_FILE):
  configure_file Problem configuring file


-- checking for module 'gta'
--   package 'gta' not found
-- checking for module 'poppler-glib'
--   package 'poppler-glib' not found
-- checking for module 'librsvg-2.0'
--   package 'librsvg-2.0' not found
-- checking for module 'gtkglext-x11-1.0'
--   package 'gtkglext-x11-1.0' not found
-- Found Qt4: /opt/local/bin/qmake (found version "4.8.2")
CMake Error at src/osgViewer/CMakeLists.txt:807 (ADD_SUBDIRECTORY):
  add_subdirectory given source "src" which is not an existing directory.


CMake Error: File /Users/tristandijkstra/OpenSceneGraph/src/osgViewer/packaging/pkgconfig/openscenegraph.pc.in does not exist.
CMake Error at src/osgViewer/CMakeLists.txt:1021 (CONFIGURE_FILE):
  configure_file Problem configuring file


CMake Error: File /Users/tristandijkstra/OpenSceneGraph/src/osgViewer/packaging/pkgconfig/openscenegraph-osg.pc.in does not exist.
CMake Error at src/osgViewer/CMakeLists.txt:1021 (CONFIGURE_FILE):
  configure_file Problem configuring file


CMake Error: File /Users/tristandijkstra/OpenSceneGraph/src/osgViewer/packaging/pkgconfig/openscenegraph-osgDB.pc.in does not exist.
CMake Error at src/osgViewer/CMakeLists.txt:1021 (CONFIGURE_FILE):
  configure_file Problem configuring file


CMake Error: File /Users/tristandijkstra/OpenSceneGraph/src/osgViewer/packaging/pkgconfig/openscenegraph-osgFX.pc.in does not exist.
CMake Error at src/osgViewer/CMakeLists.txt:1021 (CONFIGURE_FILE):
  configure_file Problem configuring file


CMake Error: File /Users/tristandijkstra/OpenSceneGraph/src/osgViewer/packaging/pkgconfig/openscenegraph-osgGA.pc.in does not exist.
CMake Error at src/osgViewer/CMakeLists.txt:1021 (CONFIGURE_FILE):
  configure_file Problem configuring file


CMake Error: File /Users/tristandijkstra/OpenSceneGraph/src/osgViewer/packaging/pkgconfig/openscenegraph-osgParticle.pc.in does not exist.
CMake Error at src/osgViewer/CMakeLists.txt:1021 (CONFIGURE_FILE):
  configure_file Problem configuring file


CMake Error: File /Users/tristandijkstra/OpenSceneGraph/src/osgViewer/packaging/pkgconfig/openscenegraph-osgSim.pc.in does not exist.
CMake Error at src/osgViewer/CMakeLists.txt:1021 (CONFIGURE_FILE):
  configure_file Problem configuring file


CMake Error: File /Users/tristandijkstra/OpenSceneGraph/src/osgViewer/packaging/pkgconfig/openscenegraph-osgText.pc.in does not exist.
CMake Error at src/osgViewer/CMakeLists.txt:1021 (CONFIGURE_FILE):
  configure_file Problem configuring file


CMake Error: File /Users/tristandijkstra/OpenSceneGraph/src/osgViewer/packaging/pkgconfig/openscenegraph-osgUtil.pc.in does not exist.
CMake Error at src/osgViewer/CMakeLists.txt:1021 (CONFIGURE_FILE):
  configure_file Problem configuring file


CMake Error: File /Users/tristandijkstra/OpenSceneGraph/src/osgViewer/packaging/pkgconfig/openscenegraph-osgTerrain.pc.in does not exist.
CMake Error at src/osgViewer/CMakeLists.txt:1021 (CONFIGURE_FILE):
  configure_file Problem configuring file


CMake Error: File /Users/tristandijkstra/OpenSceneGraph/src/osgViewer/packaging/pkgconfig/openscenegraph-osgManipulator.pc.in does not exist.
CMake Error at src/osgViewer/CMakeLists.txt:1021 (CONFIGURE_FILE):
  configure_file Problem configuring file


CMake Error: File /Users/tristandijkstra/OpenSceneGraph/src/osgViewer/packaging/pkgconfig/openscenegraph-osgViewer.pc.in does not exist.
CMake Error at src/osgViewer/CMakeLists.txt:1021 (CONFIGURE_FILE):
  configure_file Problem configuring file


CMake Error: File /Users/tristandijkstra/OpenSceneGraph/src/osgViewer/packaging/pkgconfig/openscenegraph-osgWidget.pc.in does not exist.
CMake Error at src/osgViewer/CMakeLists.txt:1021 (CONFIGURE_FILE):
  configure_file Problem configuring file


CMake Error: File /Users/tristandijkstra/OpenSceneGraph/src/osgViewer/packaging/pkgconfig/openscenegraph-osgShadow.pc.in does not exist.
CMake Error at src/osgViewer/CMakeLists.txt:1021 (CONFIGURE_FILE):
  configure_file Problem configuring file


CMake Error: File /Users/tristandijkstra/OpenSceneGraph/src/osgViewer/packaging/pkgconfig/openscenegraph-osgAnimation.pc.in does not exist.
CMake Error at src/osgViewer/CMakeLists.txt:1021 (CONFIGURE_FILE):
  configure_file Problem configuring file


CMake Error: File /Users/tristandijkstra/OpenSceneGraph/src/osgViewer/packaging/pkgconfig/openscenegraph-osgVolume.pc.in does not exist.
CMake Error at src/osgViewer/CMakeLists.txt:1021 (CONFIGURE_FILE):
  configure_file Problem configuring file


CMake Error: File /Users/tristandijkstra/OpenSceneGraph/src/osgViewer/packaging/pkgconfig/openscenegraph-osgQt.pc.in does not exist.
CMake Error at src/osgViewer/CMakeLists.txt:1021 (CONFIGURE_FILE):
  configure_file Problem configuring file



The build system is configured to install libraries to /usr/local/lib
Your applications may not be able to find your installed libraries unless you:
    set your LD_LIBRARY_PATH (user specific) or
    update your ld.so configuration (system wide)
CMake Error: File /Users/tristandijkstra/OpenSceneGraph/src/osgViewer/CMakeModules/cmake_uninstall.cmake.in does not exist.
CMake Error at src/osgViewer/CMakeLists.txt:1083 (CONFIGURE_FILE):
  configure_file Problem configuring file


CMake Error at CMakeLists.txt:1087 (ADD_CUSTOM_TARGET):
  add_custom_target cannot create target "uninstall" because another target
  with the same name already exists.  The existing target is a custom target
  created in source directory
  "/Users/tristandijkstra/OpenSceneGraph/src/osgViewer".  See documentation
  for policy CMP0002 for more details.


-- Configuring incomplete, errors occurred!



i don't understand it anymore is it an dependency?
User avatar
Trez
 
Posts: 437
Joined: Thu Jul 14, 2011 10:50 am
Location: Netherlands
Callsign: Trez
Version: 2.8 GIT
OS: OSX10.8, Mint 14

Re: Updated: Compiling sg/fg git version for OSX

Postby gral » Sun Jul 29, 2012 5:20 pm

You didn’t perform that action (replacing the CMakeLists.txt content with what I posted to pastebin) in a fresh clone from github, did you ? I tried myself doing the same and it works here with

Code: Select all
cmake  -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_SYSROOT=/Developer/SDKs/MacOSX10.6.sdk -DCMAKE_OSX_ARCHITECTURES="i386;x86_64" -DCMAKE_OSX_DEPLOYMENT_TARGET=10.6 -DCMAKE_MINSIZEREL_POSTFIX= -DBUILD_OSG_APPLICATIONS=OFF -DCMAKE_RELWITHDEBINFO_POSTFIX= -DOSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX=imageio -DOSG_WINDOWING_SYSTEM=Cocoa -Wno-dev


-gral
gral
 
Posts: 325
Joined: Mon Nov 16, 2009 1:03 pm
Location: Zurich (Switzerland)
Callsign: HB-GRAL
Version: GIT

Re: Updated: Compiling sg/fg git version for OSX

Postby Trez » Sun Jul 29, 2012 5:32 pm

i did could you maybe post the exact directory?
User avatar
Trez
 
Posts: 437
Joined: Thu Jul 14, 2011 10:50 am
Location: Netherlands
Callsign: Trez
Version: 2.8 GIT
OS: OSX10.8, Mint 14

Re: Updated: Compiling sg/fg git version for OSX

Postby gral » Sun Jul 29, 2012 5:41 pm

Trez wrote in Sun Jul 29, 2012 5:32 pm:i did could you maybe post the exact directory?


You need to replace CMakeLists.txt on top in "OpenSceneGraph" folder you got from github. No other replacement needed.
-gral
gral
 
Posts: 325
Joined: Mon Nov 16, 2009 1:03 pm
Location: Zurich (Switzerland)
Callsign: HB-GRAL
Version: GIT

Re: Updated: Compiling sg/fg git version for OSX

Postby Trez » Sun Jul 29, 2012 5:59 pm

Code: Select all
Last login: Sun Jul 29 12:53:15 on ttys000
tristan-dijkstras-MacBook-Pro:~ tristandijkstra$ git clone https://github.com/openscenegraph/osg.git OpenSceneGraph
Cloning into 'OpenSceneGraph'...

remote: Counting objects: 125190, done.
remote: Compressing objects: 100% (22165/22165), done.
remote: Total 125190 (delta 100898), reused 124727 (delta 100518)
Receiving objects: 100% (125190/125190), 32.75 MiB | 362 KiB/s, done.
Resolving deltas: 100% (100898/100898), done.
Checking out files: 100% (3060/3060), done.
tristan-dijkstras-MacBook-Pro:~ tristandijkstra$
tristan-dijkstras-MacBook-Pro:~ tristandijkstra$ cd OpenSceneGraph
tristan-dijkstras-MacBook-Pro:OpenSceneGraph tristandijkstra$ cmake  -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_SYSROOT=/Developer/SDKs/MacOSX10.6.sdk -DCMAKE_OSX_ARCHITECTURES="i386;x86_64" -DCMAKE_OSX_DEPLOYMENT_TARGET=10.6 -DCMAKE_MINSIZEREL_POSTFIX= -DBUILD_OSG_APPLICATIONS=OFF -DCMAKE_RELWITHDEBINFO_POSTFIX= -DOSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX=imageio -DOSG_WINDOWING_SYSTEM=Cocoa -Wno-dev
-- The C compiler identification is GNU 4.2.1
-- The CXX compiler identification is GNU 4.2.1
-- Checking whether C compiler has -isysroot
-- Checking whether C compiler has -isysroot - yes
-- Checking whether C compiler supports OSX deployment target flag
-- Checking whether C compiler supports OSX deployment target flag - yes
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Checking whether CXX compiler has -isysroot
-- Checking whether CXX compiler has -isysroot - yes
-- Checking whether CXX compiler supports OSX deployment target flag
-- Checking whether CXX compiler supports OSX deployment target flag - yes
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE 
2012-07-29 13:53:17.420 defaults[51703:903]
The domain/default pair of (/Developer/SDKs/MacOSX10.6.sdk/SDKSettings.plist, CanonicalName) does not exist
-- Found OpenGL: /System/Library/Frameworks/OpenGL.framework 
-- Looking for XOpenDisplay in /opt/local/lib/libX11.dylib;/opt/local/lib/libXext.dylib
-- Looking for XOpenDisplay in /opt/local/lib/libX11.dylib;/opt/local/lib/libXext.dylib - not found
-- Looking for dnet_ntoa in dnet
-- Looking for dnet_ntoa in dnet - not found
-- Looking for dnet_ntoa in dnet_stub
-- Looking for dnet_ntoa in dnet_stub - not found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - not found
-- Found X11: /opt/local/lib/libX11.dylib
-- Found PKG_CONFIG: /opt/local/bin/pkg-config (found version "0.27")
-- Found LibXml2: /opt/local/lib/libxml2.dylib (found version "2.7.8")
-- checking for module 'gta'
--   package 'gta' not found
-- Found CURL: /usr/lib/libcurl.dylib (found version "7.19.7")
-- Found OpenAL: /System/Library/Frameworks/OpenAL.framework 
-- Found SDL: /opt/local/lib/libSDLmain.a;/opt/local/lib/libSDL.dylib;-framework Cocoa 
-- checking for module 'cairo'
--   found cairo, version 1.12.2
-- checking for module 'poppler-glib'
--   package 'poppler-glib' not found
-- checking for module 'librsvg-2.0'
--   package 'librsvg-2.0' not found
-- checking for module 'gtk+-2.0'
--   found gtk+-2.0, version 2.24.10
-- checking for module 'gtkglext-x11-1.0'
--   package 'gtkglext-x11-1.0' not found
-- Looking for Q_WS_X11
-- Looking for Q_WS_X11 - not found.
-- Looking for Q_WS_WIN
-- Looking for Q_WS_WIN - not found.
-- Looking for Q_WS_QWS
-- Looking for Q_WS_QWS - not found.
-- Looking for Q_WS_MAC
-- Looking for Q_WS_MAC - found
-- Looking for QT_MAC_USE_COCOA
-- Looking for QT_MAC_USE_COCOA - found
-- Found Qt4: /opt/local/bin/qmake (found version "4.8.2")
-- Performing Test _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS
-- Performing Test _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS - Success
-- Performing Test _OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS
-- Performing Test _OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS - Failed
-- Performing Test _OPENTHREADS_ATOMIC_USE_SUN
-- Performing Test _OPENTHREADS_ATOMIC_USE_SUN - Failed
-- Performing Test _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED
-- Performing Test _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED - Failed
-- Performing Test _OPENTHREADS_ATOMIC_USE_BSD_ATOMIC
-- Performing Test _OPENTHREADS_ATOMIC_USE_BSD_ATOMIC - Success
-- Looking for pthread_yield
-- Looking for pthread_yield - not found
-- Looking for sched_yield
-- Looking for sched_yield - found
-- Looking for pthread_setconcurrency
-- Looking for pthread_setconcurrency - found
-- Looking for pthread_getconcurrency
-- Looking for pthread_getconcurrency - found
-- Looking for pthread_setaffinity_np
-- Looking for pthread_setaffinity_np - not found
-- Performing Test HAVE_THREE_PARAM_SCHED_SETAFFINITY
-- Performing Test HAVE_THREE_PARAM_SCHED_SETAFFINITY - Failed
-- Performing Test HAVE_TWO_PARAM_SCHED_SETAFFINITY
-- Performing Test HAVE_TWO_PARAM_SCHED_SETAFFINITY - Failed
CMake Error at src/osgViewer/CMakeLists.txt:71 (IF):
  if given arguments:

    "STREQUAL" "macosx10.7" "OR" "STREQUAL" "macosx10.6" "OR" "STREQUAL" "macosx10.5"

  Unknown arguments specified


-- Configuring incomplete, errors occurred!
tristan-dijkstras-MacBook-Pro:OpenSceneGraph tristandijkstra$

same result i think this is the problem
Code: Select all
The domain/default pair of (/Developer/SDKs/MacOSX10.6.sdk/SDKSettings.plist, CanonicalName) does not exist


that's where it goes wrong
User avatar
Trez
 
Posts: 437
Joined: Thu Jul 14, 2011 10:50 am
Location: Netherlands
Callsign: Trez
Version: 2.8 GIT
OS: OSX10.8, Mint 14

Re: Updated: Compiling sg/fg git version for OSX

Postby gral » Sun Jul 29, 2012 6:27 pm

Now it’s time to stop my hacks here I guess, it’s a known issue when you google for it. Unfortunately my changes to the CMakeLists.txt seems only to apply for older osx development kits and works here - but not for you (wish Olaf Flebbe would see this thread!). Maybe you can help yourself when you have a look what I changed/commented out, doing such changes in the appropriate CMakeLists.txt which throws the error. I know you have been there already, sorry I can’t help further. But I guess you’re very close to get it running and then I ask you to share your changes, also in the wiki probably.

-gral
gral
 
Posts: 325
Joined: Mon Nov 16, 2009 1:03 pm
Location: Zurich (Switzerland)
Callsign: HB-GRAL
Version: GIT

Next

Return to Mac

Who is online

Users browsing this forum: Alant and 2 guests