1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-01 16:32:31 +01:00
openrw/CMakeLists.txt

79 lines
1.8 KiB
CMake
Raw Normal View History

cmake_minimum_required(VERSION 3.2.2)
2014-01-26 04:45:55 +01:00
project(OpenRW)
2013-06-30 01:05:04 +02:00
include(GNUInstallDirs)
# Read the configuration arguments
include("${PROJECT_SOURCE_DIR}/cmake_options.cmake")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules")
# Include git hash in source
include(GetGitRevisionDescription)
get_git_head_revision(GIT_REFSPEC GIT_SHA1)
message(STATUS "Building ${CMAKE_PROJECT_NAME} GIT SHA1: ${GIT_SHA1}")
include(WrapTargets)
find_package(Boost REQUIRED)
find_package(Boost COMPONENTS program_options system REQUIRED)
if(FILESYSTEM_LIBRARY STREQUAL "BOOST")
find_package(Boost COMPONENTS filesystem system REQUIRED)
endif()
if(BUILD_TESTS)
find_package(Boost COMPONENTS unit_test_framework REQUIRED)
endif()
if(CHECK_INCLUDES)
find_package(IncludeWhatYouUse REQUIRED)
endif()
2018-06-07 02:10:50 +02:00
# Do not link to SDL2main library
set(SDL2_BUILDING_LIBRARY True)
set(OpenGL_GL_PREFERENCE GLVND)
2018-06-07 02:10:50 +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)
find_package(SDL2 REQUIRED)
2016-05-21 10:30:51 +02:00
rwdep_wrap_find_packages()
if(CHECK_CLANGTIDY)
find_package(ClangTidy REQUIRED)
endif()
if(CHECK_IWYU)
find_package(IncludeWhatYouUse REQUIRED)
endif()
# Create a rw_interface TARGET that holds all compiler options
include("${PROJECT_SOURCE_DIR}/cmake_configure.cmake")
add_subdirectory(rwlib)
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()
# Copy the license to the install directory
install(FILES COPYING
DESTINATION "${CMAKE_INSTALL_DOCDIR}"
)
# Copy the license to the build directory (for CI)
2016-06-22 00:28:43 +02:00
file(COPY COPYING
DESTINATION "${PROJECT_BINARY_DIR}"
2017-10-26 00:59:47 +02:00
)
2018-06-02 03:49:05 +02:00
include(CMakeCPack.cmake)