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
+80 -77
View File
@@ -5,7 +5,7 @@ include (ExternalProject)
project(FlightGear-Meta) project(FlightGear-Meta)
if(NOT CMAKE_INSTALL_PREFIX) if(NOT CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install) set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install)
message(STATUS "Default install dir to ${CMAKE_INSTALL_PREFIX}") message(STATUS "Default install dir to ${CMAKE_INSTALL_PREFIX}")
endif() endif()
@@ -21,30 +21,29 @@ 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}
SVN_REPOSITORY http://svn.boost.org/svn/boost/tags/release/Boost_1_52_0 SVN_REPOSITORY http://svn.boost.org/svn/boost/tags/release/Boost_1_52_0
UPDATE_COMMAND ${BOOST_BOOTSTRAP} UPDATE_COMMAND ${BOOST_BOOTSTRAP}
CONFIGURE_COMMAND "" CONFIGURE_COMMAND ""
BUILD_COMMAND ./bjam ${BOOST_ARGS} BUILD_COMMAND ./bjam ${BOOST_ARGS}
BUILD_IN_SOURCE 1 BUILD_IN_SOURCE 1
INSTALL_COMMAND ./b2 install ${BOOST_ARGS}) INSTALL_COMMAND ./b2 install ${BOOST_ARGS})
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,31 +51,34 @@ 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
-DBUILD_OSG_APPLICATIONS:BOOL=ON -DBUILD_OSG_APPLICATIONS:BOOL=ON
-DCMAKE_INSTALL_PREFIX:PATH= -DCMAKE_INSTALL_PREFIX:PATH=
-DOSG_PLUGIN_SEARCH_INSTALL_DIR_FOR_PLUGINS:BOOL=OFF -DOSG_PLUGIN_SEARCH_INSTALL_DIR_FOR_PLUGINS:BOOL=OFF
-DFREETYPE_LIBRARY:FILEPATH=${CMAKE_BINARY_DIR}/3rdParty/lib/freetype243.lib -DFREETYPE_LIBRARY:FILEPATH=${CMAKE_BINARY_DIR}/3rdParty/lib/freetype243.lib
-DGDAL_INCLUDE_DIR:PATH= -DGDAL_INCLUDE_DIR:PATH=
-DGDAL_LIBRARY:FILEPATH= -DGDAL_LIBRARY:FILEPATH=
) )
# 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,48 +86,48 @@ 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 ""
BUILD_COMMAND ${CMAKE_SOURCE_DIR}/installWinDeps.bat BUILD_COMMAND ${CMAKE_SOURCE_DIR}/installWinDeps.bat
INSTALL_COMMAND "" INSTALL_COMMAND ""
) )
set(BOOST_ARGS link=static stage --with-system) set(BOOST_ARGS link=static stage --with-system)
set( Boost_Version 1.54.0 ) set( Boost_Version 1.54.0 )
string( REPLACE "." "_" Boost_Version_Underscore ${Boost_Version} ) string( REPLACE "." "_" Boost_Version_Underscore ${Boost_Version} )
ExternalProject_Add(Boost ExternalProject_Add(Boost
PREFIX ${CMAKE_BINARY_DIR} PREFIX ${CMAKE_BINARY_DIR}
URL http://downloads.sourceforge.net/project/boost/boost/${Boost_Version}/boost_${Boost_Version_Underscore}.zip URL http://downloads.sourceforge.net/project/boost/boost/${Boost_Version}/boost_${Boost_Version_Underscore}.zip
URL_MD5 78a35834c45220a6164310e280abe675 URL_MD5 78a35834c45220a6164310e280abe675
UPDATE_COMMAND "bootstrap.bat" UPDATE_COMMAND "bootstrap.bat"
CONFIGURE_COMMAND "" CONFIGURE_COMMAND ""
BUILD_COMMAND bjam --with-program_options ${BOOST_ARGS} BUILD_COMMAND bjam --with-program_options ${BOOST_ARGS}
BUILD_IN_SOURCE 1 BUILD_IN_SOURCE 1
INSTALL_COMMAND "" INSTALL_COMMAND ""
) )
list(APPEND SG_DEPS Boost) list(APPEND SG_DEPS Boost)
list(APPEND SG_CMAKE_ARGS -DBOOST_ROOT=${CMAKE_BINARY_DIR}/src/Boost) list(APPEND SG_CMAKE_ARGS -DBOOST_ROOT=${CMAKE_BINARY_DIR}/src/Boost)
list(APPEND FG_CMAKE_ARGS -DBOOST_ROOT=${CMAKE_BINARY_DIR}/src/Boost) list(APPEND FG_CMAKE_ARGS -DBOOST_ROOT=${CMAKE_BINARY_DIR}/src/Boost)
endif(MSVC) # of Windows endif(MSVC) # of Windows
message(STATUS "OSG install prefix is ${OSG_INSTALL_PREFIX}") message(STATUS "OSG install prefix is ${OSG_INSTALL_PREFIX}")
ExternalProject_Add(OSG ExternalProject_Add(OSG
DEPENDS ${OSG_DEPS} DEPENDS ${OSG_DEPS}
PREFIX ${CMAKE_BINARY_DIR} PREFIX ${CMAKE_BINARY_DIR}
${OSG_SOURCE} ${OSG_SOURCE}
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
@@ -138,31 +140,32 @@ if (NOT MSVC)
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
) )
list(APPEND SG_DEPS OpenRTI) list(APPEND SG_DEPS OpenRTI)
list(APPEND SG_CMAKE_ARGS -DENABLE_RTI=1) list(APPEND SG_CMAKE_ARGS -DENABLE_RTI=1)
list(APPEND FG_CMAKE_ARGS -DENABLE_RTI=1) list(APPEND FG_CMAKE_ARGS -DENABLE_RTI=1)
endif() endif()
ExternalProject_Add(SimGear ExternalProject_Add(SimGear
PREFIX ${CMAKE_BINARY_DIR} PREFIX ${CMAKE_BINARY_DIR}
DEPENDS ${SG_DEPS} DEPENDS ${SG_DEPS}
DOWNLOAD_COMMAND "" # no need to download DOWNLOAD_COMMAND "" # no need to download
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)
SET(PLIB_ARGS --disable-pw --disable-sl --disable-psl --disable-ssg --disable-ssgaux) SET(PLIB_ARGS --disable-pw --disable-sl --disable-psl --disable-ssg --disable-ssgaux)
ExternalProject_Add(PLIB ExternalProject_Add(PLIB
PREFIX ${CMAKE_BINARY_DIR} PREFIX ${CMAKE_BINARY_DIR}
URL http://plib.sourceforge.net/dist/plib-1.8.5.tar.gz URL http://plib.sourceforge.net/dist/plib-1.8.5.tar.gz
URL_HASH MD5=47a6fbf63668c1eed631024038b2ea90 URL_HASH MD5=47a6fbf63668c1eed631024038b2ea90
CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=${CMAKE_INSTALL_PREFIX} ${PLIB_ARGS} CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=${CMAKE_INSTALL_PREFIX} ${PLIB_ARGS}
BUILD_IN_SOURCE 1 BUILD_IN_SOURCE 1
) )
list(APPEND FG_DEPS PLIB) list(APPEND FG_DEPS PLIB)
endif() endif()
@@ -170,9 +173,9 @@ endif()
ExternalProject_Add(FlightGear ExternalProject_Add(FlightGear
PREFIX ${CMAKE_BINARY_DIR} PREFIX ${CMAKE_BINARY_DIR}
DEPENDS ${FG_DEPS} DEPENDS ${FG_DEPS}
DOWNLOAD_COMMAND "" # no need to download DOWNLOAD_COMMAND "" # no need to download
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}
) )