2013-07-02 00:33:21 +02:00
|
|
|
cmake_minimum_required(VERSION 2.8)
|
|
|
|
|
2014-01-26 04:45:55 +01:00
|
|
|
project(OpenRW)
|
2013-06-30 01:05:04 +02:00
|
|
|
|
2015-03-30 01:59:22 +02:00
|
|
|
# Optional components
|
2014-07-19 09:57:36 +02:00
|
|
|
SET(BUILD_SCRIPT_TOOL TRUE CACHE BOOL "Build script decompiler tool")
|
2015-03-30 01:59:22 +02:00
|
|
|
SET(BUILD_TESTS TRUE CACHE BOOL "Build test suite")
|
2014-06-18 18:07:51 +02:00
|
|
|
SET(BUILD_OLD_TOOLS FALSE CACHE BOOL "Build old datadump and analyzer tools")
|
2015-03-30 01:59:22 +02:00
|
|
|
SET(BUILD_TOOLS FALSE CACHE BOOL "Build editor application")
|
|
|
|
|
|
|
|
# Options
|
|
|
|
SET(ENABLE_SCRIPT_DEBUG FALSE CACHE BOOL "Enable verbose script execution")
|
2014-06-18 18:07:51 +02:00
|
|
|
|
2014-06-26 18:55:17 +02:00
|
|
|
IF(CMAKE_BUILD_TYPE MATCHES Debug)
|
2014-08-05 14:41:44 +02:00
|
|
|
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wextra" )
|
2014-06-18 18:07:51 +02:00
|
|
|
ELSE()
|
2014-08-05 14:41:44 +02:00
|
|
|
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3" )
|
2014-06-18 18:07:51 +02:00
|
|
|
ENDIF()
|
2013-06-30 01:05:04 +02:00
|
|
|
|
2014-12-16 00:13:33 +01:00
|
|
|
SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -pthread -Wno-unused-parameter")
|
|
|
|
|
2014-08-17 00:02:34 +02:00
|
|
|
IF(APPLE)
|
|
|
|
set(OPENRW_PLATFORM_LIBS iconv)
|
|
|
|
ENDIF()
|
|
|
|
|
2014-05-25 23:30:50 +02:00
|
|
|
# Make GLM use radians
|
|
|
|
add_definitions(-DGLM_FORCE_RADIANS)
|
|
|
|
|
2014-12-15 21:44:36 +01:00
|
|
|
IF(${ENABLE_SCRIPT_DEBUG})
|
|
|
|
add_definitions(-DSCM_DEBUG_INSTRUCTIONS)
|
|
|
|
ENDIF()
|
|
|
|
|
2014-08-16 00:20:13 +02:00
|
|
|
find_package(OpenGL REQUIRED)
|
2014-06-18 18:07:51 +02:00
|
|
|
find_package(Bullet REQUIRED)
|
|
|
|
|
|
|
|
IF(BUILD_OLD_TOOLS)
|
|
|
|
add_subdirectory(analyzer)
|
|
|
|
add_subdirectory(datadump)
|
|
|
|
ENDIF()
|
|
|
|
|
2015-03-30 01:59:22 +02:00
|
|
|
|
|
|
|
add_subdirectory(rwengine)
|
|
|
|
add_subdirectory(rwgame)
|
|
|
|
|
2014-07-19 09:57:36 +02:00
|
|
|
IF(BUILD_SCRIPT_TOOL)
|
|
|
|
add_subdirectory(scripttool)
|
|
|
|
ENDIF()
|
2015-03-30 01:59:22 +02:00
|
|
|
IF(${BUILD_TOOLS})
|
|
|
|
add_subdirectory(rwviewer)
|
|
|
|
ENDIF()
|
2014-07-19 09:57:36 +02:00
|
|
|
|
2015-03-30 01:59:22 +02:00
|
|
|
IF(${BUILD_TESTS})
|
|
|
|
add_subdirectory(tests)
|
|
|
|
ENDIF()
|