Superbuild: Fix and cleanup

- Fix OSG_INSTALL_PREFIX path
- Fix missing OSG_INSTALL_PREFIX for flightgear
- Add 64 bits support
- Don't override OSG install dir
- Fix CMAKE_INSTALL_PREFIX path for SG and FG
- Indentation cleanup
This commit is contained in:
Clément de l'Hamaide
2013-11-13 17:34:29 +01:00
parent 2f97b62112
commit f625f7b5e5
+22 -19
View File
@@ -21,7 +21,6 @@ set(SG_CMAKE_ARGS "")
set(FG_CMAKE_ARGS "") set(FG_CMAKE_ARGS "")
if(APPLE) if(APPLE)
set(BOOST_ARGS link=static stage --with-system) set(BOOST_ARGS link=static stage --with-system)
ExternalProject_Add(Boost ExternalProject_Add(Boost
PREFIX ${CMAKE_BINARY_DIR} PREFIX ${CMAKE_BINARY_DIR}
@@ -35,16 +34,16 @@ if(APPLE)
list(APPEND SG_DEPS Boost) list(APPEND SG_DEPS Boost)
endif() # of Apple endif() # of Apple
set (OSG_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}) set(OSG_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
# OpenSceneGraph configuration # OpenSceneGraph configuration
SET(OSG_SOURCE URL http://www.openscenegraph.org/downloads/developer_releases/OpenSceneGraph-3.2.0.zip) set(OSG_SOURCE URL http://www.openscenegraph.org/downloads/developer_releases/OpenSceneGraph-3.2.0.zip)
if (APPLE) if (APPLE)
SET(SDKROOT /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk) set(SDKROOT /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk)
# force disable Qt and Jasper, and ensure an SDKROOT is set, or # force disable Qt and Jasper, and ensure an SDKROOT is set, or
# osgViewer system detection goes wrongh # osgViewer system detection goes wrongh
SET(OSG_CMAKE_ARGS -DCMAKE_OSX_SYSROOT=${SDKROOT} set(OSG_CMAKE_ARGS -DCMAKE_OSX_SYSROOT=${SDKROOT}
-DOSG_USE_QT=0 -DOSG_USE_QT=0
-DJASPER_LIBRARY= -DJASPER_LIBRARY=
-DSDL_LIBRARY:FILEPATH= -DSDL_LIBRARY:FILEPATH=
@@ -52,18 +51,21 @@ if (APPLE)
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.7 -DCMAKE_OSX_DEPLOYMENT_TARGET=10.7
) )
# OSG with some patches applied for Mac # OSG with some patches applied for Mac
# SET(OSG_SOURCE GIT_REPOSITORY git://gitorious.org/+flightgear-developers/openscenegraph/mac-release-osg.git) # set(OSG_SOURCE GIT_REPOSITORY git://gitorious.org/+flightgear-developers/openscenegraph/mac-release-osg.git)
# SET(OSG_SOURCE URL http://www.openscenegraph.org/downloads/developer_releases/OpenSceneGraph-3.2.0.zip) # set(OSG_SOURCE URL http://www.openscenegraph.org/downloads/developer_releases/OpenSceneGraph-3.2.0.zip)
elseif(MSVC) elseif(MSVC)
set( OSG_MSVC "msvc" ) set(OSG_MSVC "msvc")
if (${MSVC_VERSION} EQUAL 1700) if (${MSVC_VERSION} EQUAL 1700)
set( OSG_MSVC ${OSG_MSVC}110 ) set(OSG_MSVC ${OSG_MSVC}110)
elseif (${MSVC_VERSION} EQUAL 1600) elseif (${MSVC_VERSION} EQUAL 1600)
set( OSG_MSVC ${OSG_MSVC}100 ) set(OSG_MSVC ${OSG_MSVC}100)
else (${MSVC_VERSION} EQUAL 1700) else (${MSVC_VERSION} EQUAL 1700)
set( OSG_MSVC ${OSG_MSVC}90 ) set(OSG_MSVC ${OSG_MSVC}90)
endif (${MSVC_VERSION} EQUAL 1700) endif (${MSVC_VERSION} EQUAL 1700)
if (CMAKE_CL_64)
set(OSG_MSVC ${OSG_MSVC}-64)
endif (CMAKE_CL_64)
SET(OSG_CMAKE_ARGS SET(OSG_CMAKE_ARGS
-DACTUAL_3RDPARTY_DIR:PATH=${CMAKE_BINARY_DIR}/3rdParty -DACTUAL_3RDPARTY_DIR:PATH=${CMAKE_BINARY_DIR}/3rdParty
@@ -76,7 +78,7 @@ elseif(MSVC)
) )
# for compatability with MSVC directory layout # for compatability with MSVC directory layout
set(OSG_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install/${OSG_MSVC}/OpenSceneGraph) set(OSG_INSTALL_PREFIX ${OSG_INSTALL_PREFIX}/${OSG_MSVC}/OpenSceneGraph)
list(APPEND OSG_DEPS WinDeps) list(APPEND OSG_DEPS WinDeps)
else() else()
# normal OSG # normal OSG
@@ -84,10 +86,10 @@ else()
endif() endif()
if (MSVC) if (MSVC)
# download 3rdparty dependencies zip, including boost # download 3rdparty dependencies zip, including boost
ExternalProject_Add(WinDeps ExternalProject_Add(WinDeps
DOWNLOAD_COMMAND URL http://files.goneabitbursar.com/fg/fgfs-win32-VS100-3rdParty+OSG-20120411.zip DOWNLOAD_COMMAND URL http://files.goneabitbursar.com/fg/fgfs-win32-VS100-3rdParty+OSG-20120411.zip
# extract to current root # extract to current root
SOURCE_DIR ${CMAKE_BINARY_DIR}/winDeps SOURCE_DIR ${CMAKE_BINARY_DIR}/winDeps
BINARY_DIR ${CMAKE_BINARY_DIR} BINARY_DIR ${CMAKE_BINARY_DIR}
CONFIGURE_COMMAND "" CONFIGURE_COMMAND ""
@@ -124,8 +126,8 @@ ExternalProject_Add(OSG
URL_HASH MD5=4980f8692712a24d4c99f363f80c6814 URL_HASH MD5=4980f8692712a24d4c99f363f80c6814
BINARY_DIR osgbuild BINARY_DIR osgbuild
CMAKE_ARGS ${OSG_CMAKE_ARGS} -DCMAKE_INSTALL_PREFIX=${OSG_INSTALL_PREFIX} CMAKE_ARGS ${OSG_CMAKE_ARGS} -DCMAKE_INSTALL_PREFIX=${OSG_INSTALL_PREFIX}
# force Release build of OpenSceneGraph # force Release build of OpenSceneGraph
# BUILD_COMMAND "cmake --build . --config Release" # BUILD_COMMAND "cmake --build . --config Release"
) )
# FIXME install of OpenRTI is failing on Windows, files in PREFIX/share which # FIXME install of OpenRTI is failing on Windows, files in PREFIX/share which
@@ -150,7 +152,8 @@ ExternalProject_Add(SimGear
UPDATE_COMMAND "" # or update. UPDATE_COMMAND "" # or update.
SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/simgear SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/simgear
BINARY_DIR sgbuild BINARY_DIR sgbuild
CMAKE_ARGS ${SG_CMAKE_ARGS} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DCMAKE_PREFIX_PATH=${OSG_INSTALL_PREFIX}) CMAKE_ARGS ${SG_CMAKE_ARGS} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}/${OSG_MSVC} -DCMAKE_PREFIX_PATH=${OSG_INSTALL_PREFIX}
)
# on Windows, PLIB is in the 3rd-party dependencies zip # on Windows, PLIB is in the 3rd-party dependencies zip
if (NOT WIN32) if (NOT WIN32)
@@ -174,5 +177,5 @@ ExternalProject_Add(FlightGear
UPDATE_COMMAND "" # or update. UPDATE_COMMAND "" # or update.
SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/flightgear SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/flightgear
BINARY_DIR fgbuild BINARY_DIR fgbuild
CMAKE_ARGS ${FG_CMAKE_ARGS} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} CMAKE_ARGS ${FG_CMAKE_ARGS} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}/${OSG_MSVC} -DCMAKE_PREFIX_PATH=${OSG_INSTALL_PREFIX}
) )