nikki wrote:And jacmoe, get done withe the CMake script already! I wanna play with this thing.

I have it ready now.

- recast_linux.png (200.35 KiB) Viewed 7649 times
I had to fix some scoping issues (jump to label crosses initialization of var blah..), a couple case sensivity fixes, and then I had to comment out a call to qsort_r which apparently is implemented differently on each platform..
Put this in project root:
Code: Select all
######################################################################
# Recast BUILD SYSTEM
######################################################################
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
# Works around warnings libraries linked against that don't
# have absolute paths (e.g. -lOgreMain)
cmake_policy(SET CMP0003 NEW)
# Works around warnings about escaped quotes in ADD_DEFINITIONS
# statements.
cmake_policy(SET CMP0005 NEW)
Project (Recast)
if (CMAKE_BUILD_TYPE STREQUAL "")
# CMake defaults to leaving CMAKE_BUILD_TYPE empty. This screws up
# differentiation between debug and release builds.
set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Choose the type of build, options are: None (CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel." FORCE)
endif ()
SET(CMAKE_DEBUG_POSTFIX "_d")
FIND_PACKAGE(OpenGL REQUIRED)
Find_Package ( SDL REQUIRED )
#Find_Package ( SDL_image REQUIRED ) # if using SDL_image
# Workaround for the non-working REQUIRED flag
if ( NOT SDL_FOUND )
message ( FATAL_ERROR "SDL not found!" )
endif ( NOT SDL_FOUND )
include_directories(${OPENGL_INCLUDE_DIR})
include_directories(${SDL_INCLUDE_DIR})
include_directories(Recast/Include)
include_directories(Detour/Include)
include_directories(RecastDemo/Include)
include_directories(RecastDemo/Contrib)
add_subdirectory(RecastDemo)
And this goes in the RecastDemo directory:
Code: Select all
file(GLOB RECAST_H_FILES ../Recast/Include/*.h)
file(GLOB RECAST_CPP_FILES ../Recast/Source/*.cpp)
file(GLOB DETOUR_H_FILES ../Detour/Include/*.h)
file(GLOB DETOUR_CPP_FILES ../Detour/Source/*.cpp)
file(GLOB RECAST_DEMO_H_FILES Include/*.h)
file(GLOB RECAST_DEMO_CPP_FILES Source/*.cpp)
SET(RECAST_DEMO_SOURCES
${RECAST_H_FILES}
${RECAST_CPP_FILES}
${DETOUR_H_FILES}
${DETOUR_CPP_FILES}
${RECAST_DEMO_H_FILES}
${RECAST_DEMO_CPP_FILES}
)
ADD_EXECUTABLE(RecastDemo WIN32 ${RECAST_DEMO_SOURCES})
TARGET_LINK_LIBRARIES(RecastDemo ${OPENGL_LIBRARIES} ${SDL_LIBRARY})
A quick CMake script, but enough to get started.
I now need to hook it up with my Ogre code, and put in a CMake flag to allow us to turn SDL off and Ogre on.