Skip to content

Commit

Permalink
Fetch & build MathGeoLib.
Browse files Browse the repository at this point in the history
  • Loading branch information
cadaver committed Sep 11, 2014
1 parent 2612666 commit 4985637
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -244,12 +244,16 @@ message ("\n\n=========== Configuring Dependencies ===========\n")
# The following CMake modules are required for the project to build.
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ENV_URHO3D_HOME}/Source/CMake/Modules cmake)
include (Urho3D-CMake-common)
include (ConfigurePackages)
include (ModuleSetup)
include (TundraInstall)

# Find Urho3D library
find_package (Urho3D REQUIRED)

# Find/configure MathGeoLib
configure_mathgeolib()

# Set global hardcoded install prefix. User cannot change this at the moment, until we figure how we want to use this!
# Call the cleanup step that cleans the install prefix before every installations. This is important as module setups might change between builds.
set (CMAKE_INSTALL_PREFIX ${PROJECT_BINARY_DIR}/build)
Expand Down
13 changes: 13 additions & 0 deletions cmake/ConfigurePackages.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# =============================================================================
# Configuration macros for global dependencies.
#
# All global dependency configurations should go here.
# All per-module dependency configurations should go in <Module>/CMakeLists.txt.

macro(configure_mathgeolib)
set(MATHGEOLIB_DIR ${ENV_TUNDRA_DEP_PATH}/MathGeoLib)
set(MATHGEOLIB_INCLUDE_DIRS ${MATHGEOLIB_DIR}/build/include)
set(MATHGEOLIB_LIBRARY_DIRS ${MATHGEOLIB_DIR}/build/lib)
set(MATHGEOLIB_DEBUG_LIBRARIES MathGeoLib)
set(MATHGEOLIB_RELEASE_LIBRARIES MathGeoLib_d)
endmacro (configure_mathgeolib)
2 changes: 2 additions & 0 deletions src/Core/TundraCore/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@

int TUNDRACORE_API run(int argc, char **argv)
{
// Test code to demonstrate successful use of Urho3D and MathGeoLib. To be moved elsewhere/removed.

return 0;
}
7 changes: 4 additions & 3 deletions src/Core/TundraCore/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ file(GLOB H_FILES *.h)
set(SOURCE_FILES ${CPP_FILES} ${H_FILES})

UseTundraCore() # Include all subfolders within the project
use_core_modules(Math)
use_package(QJSON)
use_package(Urho3D)
use_package(MathGeoLib)

add_definitions(-DTUNDRACORE_EXPORTS)

Expand All @@ -23,7 +23,8 @@ else()
build_library(${TARGET_NAME} STATIC ${SOURCE_FILES})
endif()

# link_modules(Math)
link_package(Urho3D)
link_package(MathGeoLib)

SetupCompileFlagsWithPCH()

Expand Down
27 changes: 25 additions & 2 deletions tools/Windows/BuildDeps.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ IF NOT !BUILD_TYPE!==%BUILD_TYPE_MINSIZEREL% IF NOT !BUILD_TYPE!==%BUILD_TYPE_RE
GOTO :EOF
)
:: DEBUG_OR_RELEASE and DEBUG_OR_RELEASE_LOWERCASE are "Debug" and "debug" for Debug build and "Release" and "release"
:: for all of the Release variants. Lowercase version exists for Qt/nmake/jom.
:: for all of the Release variants.
:: POSTFIX_D, POSTFIX_UNDERSCORE_D and POSTFIX_UNDERSCORE_DEBUG are helpers for performing file copies and checking
:: for existence of files. In release build these variables are empty.
set DEBUG_OR_RELEASE=Release
Expand Down Expand Up @@ -94,14 +94,37 @@ echo If you are not ready with the above, press Ctrl-C to abort!
pause
echo.

:: MathGeoLib
IF NOT EXIST "%DEPS%\MathGeoLib\". (
cecho {0D}Cloning MathGeoLib into "%DEPS%\MathGeoLib".{# #}{\n}
cd "%DEPS%"
git clone https://github.com/juj/MathGeoLib MathGeoLib
cd "%DEPS%\MathGeoLib\"
IF NOT EXIST "%DEPS%\MathGeoLib\.git" GOTO :ERROR
)

cecho {0D}Running CMake for MathGeoLib.{# #}{\n}
cd "%DEPS%\MathGeoLib\"
cmake . -G %GENERATOR% -DCMAKE_DEBUG_POSTFIX=_d -DCMAKE_INSTALL_PREFIX=%DEPS%\MathGeoLib\build
IF NOT %ERRORLEVEL%==0 GOTO :ERROR

cecho {0D}Building %BUILD_TYPE% MathGeoLib. Please be patient, this will take a while.{# #}{\n}
MSBuild MathGeoLib.sln /p:configuration=%BUILD_TYPE% /clp:ErrorsOnly /nologo /m:%NUMBER_OF_PROCESSORS%
IF NOT %ERRORLEVEL%==0 GOTO :ERROR

:: Install the correct build type into MathGeoLib/build
cecho {0D}Installing %BUILD_TYPE% MathGeoLib{# #}{\n}
MSBuild INSTALL.%VCPROJ_FILE_EXT% /p:configuration=%BUILD_TYPE% /clp:ErrorsOnly /nologo /m:%NUMBER_OF_PROCESSORS%
IF NOT %ERRORLEVEL%==0 GOTO :ERROR


:: Urho3D engine
:: latest master for now, if a "last known good version" is not needed
IF NOT EXIST "%DEPS%\urho3d\". (
cecho {0D}Cloning Urho3D into "%DEPS%\urho3d".{# #}{\n}
cd "%DEPS%"
git clone https://github.com/urho3d/Urho3D.git urho3d
cd "%DEPS%\urho3d\"
git checkout 671d2c45ac75f69d2f073f8bf6f4dad8f517971b
IF NOT EXIST "%DEPS%\urho3d\.git" GOTO :ERROR
)

Expand Down

0 comments on commit 4985637

Please sign in to comment.