diff --git a/CI/before_install.linux.sh b/CI/before_install.linux.sh index 25d05e619c..1ec88fb9e9 100755 --- a/CI/before_install.linux.sh +++ b/CI/before_install.linux.sh @@ -1,3 +1,3 @@ -#!/bin/sh +#!/bin/sh -e sudo ln -s /usr/bin/clang-3.6 /usr/local/bin/clang sudo ln -s /usr/bin/clang++-3.6 /usr/local/bin/clang++ diff --git a/CI/before_install.osx.sh b/CI/before_install.osx.sh index 2ab996b10f..95d061c793 100755 --- a/CI/before_install.osx.sh +++ b/CI/before_install.osx.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -e brew update diff --git a/CI/before_script.linux.sh b/CI/before_script.linux.sh index dd879989a8..ff6f2218a7 100755 --- a/CI/before_script.linux.sh +++ b/CI/before_script.linux.sh @@ -5,6 +5,9 @@ free -m env GENERATOR='Unix Makefiles' CONFIGURATION=Release CI/build_googletest.sh GOOGLETEST_DIR="$(pwd)/googletest/build" +env GENERATOR='Unix Makefiles' CONFIGURATION=Release CI/build_recastnavigation.sh +RECASTNAVIGATION_DIR="$(pwd)/recastnavigation/build" + mkdir build cd build export CODE_COVERAGE=1 @@ -18,4 +21,5 @@ ${ANALYZE}cmake \ -DUSE_SYSTEM_TINYXML=TRUE \ -DGTEST_ROOT="${GOOGLETEST_DIR}" \ -DGMOCK_ROOT="${GOOGLETEST_DIR}" \ + -DRecastNavigation_ROOT="${RECASTNAVIGATION_DIR}" \ .. diff --git a/CI/before_script.msvc.sh b/CI/before_script.msvc.sh index 8ee4b7fd99..add6f0ace9 100644 --- a/CI/before_script.msvc.sh +++ b/CI/before_script.msvc.sh @@ -304,6 +304,10 @@ if ! [ -z $UNITY_BUILD ]; then add_cmake_opts "-DOPENMW_UNITY_BUILD=True" fi +if [ ${BITS} -eq 64 ]; then + GENERATOR="${GENERATOR} Win64" +fi + echo echo "===================================" echo "Starting prebuild on MSVC${MSVC_DISPLAY_YEAR} WIN${BITS}" @@ -449,7 +453,7 @@ fi else LIB_SUFFIX="0" fi - + add_cmake_opts -DBOOST_ROOT="$BOOST_SDK" \ -DBOOST_LIBRARYDIR="${BOOST_SDK}/lib${BITS}-msvc-${MSVC_VER}.${LIB_SUFFIX}" add_cmake_opts -DBoost_COMPILER="-${TOOLSET}" @@ -644,6 +648,13 @@ printf "SDL 2.0.7... " echo Done. } echo +# recastnavigation +printf 'recastnavigation...' +{ + env GENERATOR="${GENERATOR}" CONFIGURATION="${CONFIGURATION}" ${DEPS_INSTALL}/../../CI/build_recastnavigation.sh + add_cmake_opts -DRecastNavigation_ROOT="$(pwd)/recastnavigation/build" +} +echo cd $DEPS_INSTALL/.. echo echo "Setting up OpenMW build..." diff --git a/CI/before_script.osx.sh b/CI/before_script.osx.sh index 8ee01b652d..772a06ad49 100755 --- a/CI/before_script.osx.sh +++ b/CI/before_script.osx.sh @@ -1,8 +1,11 @@ -#!/bin/sh +#!/bin/sh -e export CXX=clang++ export CC=clang +env GENERATOR='Unix Makefiles' CONFIGURATION=Release CI/build_recastnavigation.sh +RECASTNAVIGATION_DIR="$(pwd)/recastnavigation/build" + DEPENDENCIES_ROOT="/private/tmp/openmw-deps/openmw-deps" QT_PATH=`brew --prefix qt` mkdir build @@ -17,5 +20,6 @@ cmake \ -D DESIRED_QT_VERSION=5 \ -D BUILD_ESMTOOL=FALSE \ -D BUILD_MYGUI_PLUGIN=FALSE \ +-D RecastNavigation_ROOT="${RECASTNAVIGATION_DIR}" \ -G"Unix Makefiles" \ .. diff --git a/CI/build_recastnavigation.sh b/CI/build_recastnavigation.sh new file mode 100755 index 0000000000..46f3c74808 --- /dev/null +++ b/CI/build_recastnavigation.sh @@ -0,0 +1,17 @@ +#!/bin/sh -e + +git clone https://github.com/recastnavigation/recastnavigation.git +cd recastnavigation +mkdir build +cd build +cmake \ + -DCMAKE_BUILD_TYPE="${CONFIGURATION}" \ + -DRECASTNAVIGATION_DEMO=OFF \ + -DRECASTNAVIGATION_TESTS=OFF \ + -DRECASTNAVIGATION_EXAMPLES=OFF \ + -DRECASTNAVIGATION_STATIC=ON \ + -DCMAKE_INSTALL_PREFIX=. \ + -G "${GENERATOR}" \ + .. +cmake --build . --config "${CONFIGURATION}" +cmake --build . --target install --config "${CONFIGURATION}" diff --git a/apps/openmw/CMakeLists.txt b/apps/openmw/CMakeLists.txt index 99b123fd75..85906b16ee 100644 --- a/apps/openmw/CMakeLists.txt +++ b/apps/openmw/CMakeLists.txt @@ -117,6 +117,10 @@ include_directories( ${FFmpeg_INCLUDE_DIRS} ) +find_package(RecastNavigation COMPONENTS Detour Recast REQUIRED) + +include_directories(SYSTEM ${RecastNavigation_INCLUDE_DIRS}) + target_link_libraries(openmw ${OSG_LIBRARIES} ${OPENTHREADS_LIBRARIES} @@ -133,6 +137,7 @@ target_link_libraries(openmw ${FFmpeg_LIBRARIES} ${MyGUI_LIBRARIES} ${SDL2_LIBRARY} + ${RecastNavigation_LIBRARIES} "osg-ffmpeg-videoplayer" "oics" components diff --git a/appveyor.yml b/appveyor.yml index 9877d2105f..5c3522535d 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -68,7 +68,7 @@ test: off #notifications: # - provider: Email # to: -# - +# - # on_build_failure: true # on_build_status_changed: true diff --git a/cmake/FindRecastNavigation.cmake b/cmake/FindRecastNavigation.cmake new file mode 100644 index 0000000000..2126b88550 --- /dev/null +++ b/cmake/FindRecastNavigation.cmake @@ -0,0 +1,40 @@ +find_path(RecastNavigation_INCLUDE_DIR + NAMES Recast.h + HINTS $ENV{RecastNavigation_ROOT} + ${RecastNavigation_ROOT} + PATH_SUFFIXES include +) +mark_as_advanced(RecastNavigation_INCLUDE_DIR) + +include(FindPackageHandleStandardArgs) + +set(RecastNavigation_LIBRARIES "") + +foreach(COMPONENT ${RecastNavigation_FIND_COMPONENTS}) + if(NOT RecastNavigation_${COMPONENT}_FOUND) + find_library(RecastNavigation_${COMPONENT}_LIBRARY + HINTS $ENV{RecastNavigation_ROOT} + ${RecastNavigation_ROOT} + NAMES ${COMPONENT} + PATH_SUFFIXES lib + ) + find_package_handle_standard_args(RecastNavigation_${COMPONENT} DEFAULT_MSG + RecastNavigation_${COMPONENT}_LIBRARY + RecastNavigation_INCLUDE_DIR + ) + mark_as_advanced(RecastNavigation_${COMPONENT}_LIBRARY) + if(RecastNavigation_${COMPONENT}_FOUND) + list(APPEND RecastNavigation_LIBRARIES ${RecastNavigation_${COMPONENT}_LIBRARY}) + endif() + endif() +endforeach() +mark_as_advanced(RecastNavigation_LIBRARIES) + +find_package_handle_standard_args(RecastNavigation DEFAULT_MSG + RecastNavigation_LIBRARIES + RecastNavigation_INCLUDE_DIR +) + +if(RecastNavigation_FOUND) + set(RecastNavigation_INCLUDE_DIRS ${RecastNavigation_INCLUDE_DIR}) +endif()