|
|
@@ -16,7 +16,21 @@ OPTION(POLYCODE_BUILD_MODULES "Build Polycode modules" ON)
|
|
|
OPTION(POLYCODE_BUILD_PLAYER "Build Polycode standalone player" ON)
|
|
|
OPTION(POLYCODE_BUILD_TOOLS "Build Polycode tools" ON)
|
|
|
|
|
|
+# Download and build all dependencies on Windows and Mac
|
|
|
+IF(APPLE OR WIN32)
|
|
|
+ SET(common_externals ON)
|
|
|
+ELSE()
|
|
|
+ SET(common_externals OFF)
|
|
|
+ENDIF()
|
|
|
+
|
|
|
# Options for what components should be downloaded and built
|
|
|
+OPTION(POLYCODE_EXTERNAL_PHYSFS "Download and build the PhysFS package" ${common_externals})
|
|
|
+#OPTION(OpenGL REQUIRED)
|
|
|
+OPTION(POLYCODE_EXTERNAL_OPENAL "Download and build the OpenAL package" ${common_externals})
|
|
|
+OPTION(POLYCODE_EXTERNAL_FREETYPE "Download and build the Freetype2 package" ${common_externals})
|
|
|
+OPTION(POLYCODE_EXTERNAL_PNG "Download and build the PNG package" ${common_externals})
|
|
|
+OPTION(POLYCODE_EXTERNAL_VORBISFILE "Download and build the Vorbis File package" ${common_externals})
|
|
|
+
|
|
|
OPTION(POLYCODE_BUILD_BOX2D "Download and build the Box2D package" ON)
|
|
|
OPTION(POLYCODE_BUILD_BULLET "Download and build the Bullet package" ON)
|
|
|
OPTION(POLYCODE_BUILD_ASSIMP "Download and build the Assimp package" ON)
|
|
|
@@ -31,41 +45,8 @@ IF(WIN32)
|
|
|
SET(CMAKE_SYSTEM_LIBRARY_PATH ${CMAKE_PREFIX_PATH}/Lib/Release)
|
|
|
ENDIF(WIN32)
|
|
|
|
|
|
-FIND_PACKAGE(PhysFS REQUIRED)
|
|
|
-FIND_PACKAGE(OpenGL REQUIRED)
|
|
|
-FIND_PACKAGE(OpenAL REQUIRED)
|
|
|
-FIND_PACKAGE(Freetype REQUIRED)
|
|
|
-FIND_PACKAGE(PNG REQUIRED)
|
|
|
-FIND_PACKAGE(VorbisFile REQUIRED)
|
|
|
-
|
|
|
-# Use SDL on non-Apple unixes
|
|
|
-IF(UNIX AND NOT APPLE)
|
|
|
- FIND_PACKAGE(SDL REQUIRED)
|
|
|
-ENDIF(UNIX AND NOT APPLE)
|
|
|
-
|
|
|
-FIND_LIBRARY(VORBISFILE_LIBRARY NAMES vorbisfile)
|
|
|
-
|
|
|
-# platform specific defines and include directories for win and sdl
|
|
|
-IF(MSVC)
|
|
|
- ADD_DEFINITIONS(/D_UNICODE /DUNICODE)
|
|
|
- INCLUDE_DIRECTORIES(${PolyCode_SOURCE_DIR}/Core/Build/MSVC/Polycore)
|
|
|
-ELSEIF(APPLE)
|
|
|
- ADD_DEFINITIONS(-DGL_GLEXT_PROTOTYPES)
|
|
|
-ELSE(MSVC)
|
|
|
- ADD_DEFINITIONS(-DGL_GLEXT_PROTOTYPES)
|
|
|
- INCLUDE_DIRECTORIES(${PolyCode_SOURCE_DIR}/Core/Build/Linux)
|
|
|
-ENDIF(MSVC)
|
|
|
-
|
|
|
-# Set up common include directories
|
|
|
-INCLUDE_DIRECTORIES(
|
|
|
- ${PolyCode_SOURCE_DIR}/Core/Contents/Include
|
|
|
- ${OPENGL_INCLUDE_DIR}
|
|
|
- ${OPENAL_INCLUDE_DIR}
|
|
|
- ${FREETYPE_INCLUDE_DIRS}
|
|
|
-)
|
|
|
-
|
|
|
# Process subdirectories
|
|
|
-ADD_SUBDIRECTORY(Core/Contents)
|
|
|
+ADD_SUBDIRECTORY(Core)
|
|
|
|
|
|
IF(POLYCODE_BUILD_BINDINGS)
|
|
|
FIND_PACKAGE(Lua51 REQUIRED)
|