2017-10-25 20:37:22 +02:00
|
|
|
cmake_minimum_required(VERSION 3.2.2)
|
2013-07-02 00:33:21 +02:00
|
|
|
|
2014-01-26 04:45:55 +01:00
|
|
|
project(OpenRW)
|
2013-06-30 01:05:04 +02:00
|
|
|
|
2017-10-27 06:19:01 +02:00
|
|
|
# Read the configuration arguments
|
|
|
|
include("${PROJECT_SOURCE_DIR}/cmake_options.cmake")
|
2016-05-19 23:28:12 +02:00
|
|
|
|
2017-10-27 06:19:01 +02:00
|
|
|
# Create a rw_interface TARGET that holds all compiler options
|
|
|
|
include("${PROJECT_SOURCE_DIR}/cmake_configure.cmake")
|
2016-05-24 17:31:54 +02:00
|
|
|
|
2016-05-21 10:30:51 +02:00
|
|
|
find_package(OpenGL REQUIRED)
|
2016-05-24 19:49:19 +02:00
|
|
|
find_package(OpenAL REQUIRED)
|
2016-05-21 10:30:51 +02:00
|
|
|
find_package(Bullet REQUIRED)
|
2016-05-29 01:44:31 +02:00
|
|
|
find_package(GLM REQUIRED)
|
2017-09-13 13:09:49 +02:00
|
|
|
find_package(FFmpeg REQUIRED)
|
2016-06-22 12:29:39 +02:00
|
|
|
find_package(SDL2 REQUIRED)
|
2016-05-21 10:30:51 +02:00
|
|
|
|
2016-07-03 00:00:11 +02:00
|
|
|
# Include git hash in source
|
|
|
|
include(GetGitRevisionDescription)
|
|
|
|
get_git_head_revision(GIT_REFSPEC GIT_SHA1)
|
|
|
|
|
2016-04-07 02:13:46 +02:00
|
|
|
add_subdirectory(rwlib)
|
2015-03-30 01:59:22 +02:00
|
|
|
add_subdirectory(rwengine)
|
|
|
|
add_subdirectory(rwgame)
|
|
|
|
|
2017-10-26 00:53:28 +02:00
|
|
|
if(BUILD_VIEWER)
|
2017-10-26 00:59:47 +02:00
|
|
|
add_subdirectory(rwviewer)
|
2017-10-26 00:53:28 +02:00
|
|
|
endif()
|
|
|
|
if(BUILD_TESTS)
|
2017-10-26 06:35:22 +02:00
|
|
|
enable_testing()
|
2017-10-26 17:26:15 +02:00
|
|
|
include(CTest)
|
2017-10-26 00:59:47 +02:00
|
|
|
add_subdirectory(tests)
|
2017-10-26 00:53:28 +02:00
|
|
|
endif()
|
2016-06-21 22:26:09 +02:00
|
|
|
|
2017-10-27 06:19:01 +02:00
|
|
|
# Copy the license to the install directory
|
2017-10-26 00:53:28 +02:00
|
|
|
if(CMAKE_SYSTEM_NAME MATCHES "Linux|FreeBSD")
|
2017-10-26 00:59:47 +02:00
|
|
|
install(FILES COPYING
|
|
|
|
DESTINATION "${DOC_DIR}"
|
2017-10-27 06:19:01 +02:00
|
|
|
)
|
2016-06-21 22:26:09 +02:00
|
|
|
endif()
|
2017-10-27 06:19:01 +02:00
|
|
|
|
|
|
|
# Copy the license to the build directory (for CI)
|
2016-06-22 00:28:43 +02:00
|
|
|
file(COPY COPYING
|
2017-10-27 06:19:01 +02:00
|
|
|
DESTINATION "${PROJECT_BINARY_DIR}"
|
2017-10-26 00:59:47 +02:00
|
|
|
)
|