Metabuild starting to work on Windows
This commit is contained in:
parent
e5f6218be9
commit
b4b5f665c1
@ -10,12 +10,7 @@ else()
|
|||||||
set(BOOST_BOOTSTRAP "bootstrap.bat")
|
set(BOOST_BOOTSTRAP "bootstrap.bat")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT CMAKE_SYSTEM_NAME MATCHES "Linux")
|
if(APPLE)
|
||||||
ExternalProject_Add(Archive
|
|
||||||
PREFIX ${CMAKE_BINARY_DIR}
|
|
||||||
URL http://www.libarchive.org/downloads/libarchive-3.1.2.tar.gz
|
|
||||||
BINARY_DIR archivebuild
|
|
||||||
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX})
|
|
||||||
|
|
||||||
set(BOOST_ARGS link=static stage --with-system)
|
set(BOOST_ARGS link=static stage --with-system)
|
||||||
ExternalProject_Add(Boost
|
ExternalProject_Add(Boost
|
||||||
@ -26,7 +21,9 @@ if(NOT CMAKE_SYSTEM_NAME MATCHES "Linux")
|
|||||||
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})
|
||||||
endif() # of Linux
|
endif() # of Apple
|
||||||
|
|
||||||
|
set (OSG_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
|
||||||
|
|
||||||
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)
|
||||||
@ -42,56 +39,105 @@ if (APPLE)
|
|||||||
# 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.1.4.zip)
|
SET(OSG_SOURCE URL http://www.openscenegraph.org/downloads/developer_releases/OpenSceneGraph-3.1.4.zip)
|
||||||
|
|
||||||
|
elseif(MSVC)
|
||||||
|
set( OSG_MSVC "msvc" )
|
||||||
|
if (${MSVC_VERSION} EQUAL 1700)
|
||||||
|
set( OSG_MSVC ${OSG_MSVC}110 )
|
||||||
|
elseif (${MSVC_VERSION} EQUAL 1600)
|
||||||
|
set( OSG_MSVC ${OSG_MSVC}100 )
|
||||||
|
else (${MSVC_VERSION} EQUAL 1700)
|
||||||
|
set( OSG_MSVC ${OSG_MSVC}90 )
|
||||||
|
endif (${MSVC_VERSION} EQUAL 1700)
|
||||||
|
|
||||||
|
SET(OSG_CMAKE_ARGS
|
||||||
|
-DACTUAL_3RDPARTY_DIR:PATH=${CMAKE_BINARY_DIR}/3rdParty
|
||||||
|
-DBUILD_OSG_APPLICATIONS:BOOL=ON
|
||||||
|
-DCMAKE_INSTALL_PREFIX:PATH=
|
||||||
|
-DOSG_PLUGIN_SEARCH_INSTALL_DIR_FOR_PLUGINS:BOOL=OFF
|
||||||
|
-DFREETYPE_LIBRARY:FILEPATH=${CMAKE_BINARY_DIR}/3rdParty/lib/freetype243.lib
|
||||||
|
-DGDAL_INCLUDE_DIR:PATH=
|
||||||
|
-DGDAL_LIBRARY:FILEPATH=
|
||||||
|
)
|
||||||
|
|
||||||
|
# for compatability with MSVC directory layout
|
||||||
|
set(OSG_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install/${OSG_MSVC}/OpenSceneGraph)
|
||||||
|
SET(OSG_SOURCE URL http://www.openscenegraph.org/downloads/developer_releases/OpenSceneGraph-3.1.4.zip)
|
||||||
else()
|
else()
|
||||||
# normal OSG
|
# normal OSG
|
||||||
SET(OSG_SOURCE URL http://www.openscenegraph.org/downloads/developer_releases/OpenSceneGraph-3.1.4.zip)
|
SET(OSG_SOURCE URL http://www.openscenegraph.org/downloads/developer_releases/OpenSceneGraph-3.1.4.zip)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (WIN32)
|
if (MSVC)
|
||||||
# ExternalProject_Add(OpenAL )
|
# download 3rdpart dependeancies zip, including boost
|
||||||
|
ExternalProject_Add(WinDeps
|
||||||
|
DOWNLOAD_COMMAND URL http://files.goneabitbursar.com/fg/fgfs-win32-VS100-3rdParty+OSG-20120411.zip
|
||||||
|
# extract to current root
|
||||||
|
SOURCE_DIR ${CMAKE_BINARY_DIR}/winDeps
|
||||||
|
BINARY_DIR ${CMAKE_BINARY_DIR}
|
||||||
|
CONFIGURE_COMMAND ""
|
||||||
|
BUILD_COMMAND ${CMAKE_SOURCE_DIR}/installWinDeps.bat
|
||||||
|
INSTALL_COMMAND ""
|
||||||
|
)
|
||||||
endif() # of Windows
|
endif() # of Windows
|
||||||
|
|
||||||
ExternalProject_Add(OSG
|
ExternalProject_Add(OSG
|
||||||
|
DEPENDS WinDeps
|
||||||
PREFIX ${CMAKE_BINARY_DIR}
|
PREFIX ${CMAKE_BINARY_DIR}
|
||||||
${OSG_SOURCE}
|
${OSG_SOURCE}
|
||||||
BINARY_DIR osgbuild
|
BINARY_DIR osgbuild
|
||||||
CMAKE_ARGS ${OSG_CMAKE_ARGS} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
|
CMAKE_ARGS ${OSG_CMAKE_ARGS} -DCMAKE_INSTALL_PREFIX=${OSG_INSTALL_PREFIX}
|
||||||
|
# force Release build of OpenSceneGraph
|
||||||
|
# BUILD_COMMAND "cmake --build . --config Release"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
set(SG_CMAKE_ARGS -DENABLE_PACKAGE=1)
|
||||||
|
set(FG_CMAKE_ARGS "")
|
||||||
|
|
||||||
|
if (FALSE)
|
||||||
ExternalProject_Add(OpenRTI
|
ExternalProject_Add(OpenRTI
|
||||||
PREFIX ${CMAKE_BINARY_DIR}
|
PREFIX ${CMAKE_BINARY_DIR}
|
||||||
DOWNLOAD_COMMAND GIT_REPOSITORY git://gitorious.org/openrti/openrti.git
|
DOWNLOAD_COMMAND GIT_REPOSITORY git://gitorious.org/openrti/openrti.git
|
||||||
BINARY_DIR rtibuild
|
BINARY_DIR rtibuild
|
||||||
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
|
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
list(APPEND SG_CMAKE_ARGS -DENABLE_RTI=1)
|
||||||
|
list(APPEND FG_CMAKE_ARGS -DENABLE_RTI=1)
|
||||||
|
endif()
|
||||||
|
|
||||||
set(SG_CMAKE_ARGS -DENABLE_RTI=1 -DENABLE_PACKAGE=1)
|
|
||||||
set(FG_CMAKE_ARGS -DENABLE_RTI=1)
|
|
||||||
|
if (WIN32)
|
||||||
|
list(APPEND SG_CMAKE_ARGS -DBOOST_ROOT=${CMAKE_BINARY_DIR})
|
||||||
|
list(APPEND FG_CMAKE_ARGS -DBOOST_ROOT=${CMAKE_BINARY_DIR})
|
||||||
|
endif()
|
||||||
|
|
||||||
ExternalProject_Add(SimGear
|
ExternalProject_Add(SimGear
|
||||||
PREFIX ${CMAKE_BINARY_DIR}
|
PREFIX ${CMAKE_BINARY_DIR}
|
||||||
DEPENDS OSG Boost Archive OpenRTI
|
DEPENDS OSG
|
||||||
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})
|
CMAKE_ARGS ${SG_CMAKE_ARGS} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX})
|
||||||
|
|
||||||
SET(PLIB_ARGS --disable-pw --disable-sl --disable-psl --disable-ssg --disable-ssgaux)
|
# on Windows, PLIB is in the 3rd-party dependancies zip
|
||||||
|
if (NOT WIN32)
|
||||||
|
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
|
||||||
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
|
||||||
)
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
ExternalProject_Add(FlightGear
|
ExternalProject_Add(FlightGear
|
||||||
PREFIX ${CMAKE_BINARY_DIR}
|
PREFIX ${CMAKE_BINARY_DIR}
|
||||||
DEPENDS SimGear PLIB
|
DEPENDS SimGear OSG
|
||||||
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} )
|
||||||
|
|
||||||
|
11
installWinDeps.bat
Normal file
11
installWinDeps.bat
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
|
||||||
|
|
||||||
|
REM ExternalProject can't cleanly extract a zip into an existing directory
|
||||||
|
REM Instead we extract to a subdir, and then move the directories we want
|
||||||
|
REM using this bat file.
|
||||||
|
|
||||||
|
echo %CD%
|
||||||
|
|
||||||
|
xcopy /Y /E winDeps .
|
||||||
|
|
||||||
|
echo "Done copying Windows deps"
|
2
simgear
2
simgear
@ -1 +1 @@
|
|||||||
Subproject commit 06bfa4f1a1ef13ce8e52b8b610fa05786ecbe5a6
|
Subproject commit 5e45bdeeda7d149b30a550733121b8e34876343f
|
Loading…
Reference in New Issue
Block a user