1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-22 02:12:45 +01:00

cmake: include all dependencies at top of main CMakeLists.txt

This commit is contained in:
Anonymous Maarten 2018-06-07 01:23:56 +02:00
parent d2844264d9
commit 8f70b36d6f
5 changed files with 16 additions and 11 deletions

View File

@ -14,6 +14,18 @@ include(GetGitRevisionDescription)
get_git_head_revision(GIT_REFSPEC GIT_SHA1)
message(STATUS "Building ${CMAKE_PROJECT_NAME} GIT SHA1: ${GIT_SHA1}")
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()
set(OpenGL_GL_PREFERENCE GLVND)
find_package(OpenGL REQUIRED)
find_package(OpenAL REQUIRED)
@ -26,6 +38,10 @@ 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")

View File

@ -72,7 +72,6 @@ elseif(FILESYSTEM_LIBRARY STREQUAL "CXXTS")
target_link_libraries(rw_interface INTERFACE "stdc++fs")
endif()
elseif(FILESYSTEM_LIBRARY STREQUAL "BOOST")
find_package(Boost COMPONENTS system filesystem REQUIRED)
target_compile_definitions(rw_interface INTERFACE "RW_FS_LIBRARY=2")
target_include_directories(rw_interface INTERFACE ${Boost_INCLUDE_DIRS})
target_link_libraries(rw_interface INTERFACE
@ -145,10 +144,6 @@ endforeach()
include(CMakeParseArguments)
if(CHECK_IWYU)
find_package(IncludeWhatYouUse REQUIRED)
endif()
function(openrw_target_apply_options)
set(IWYU_MAPPING "${PROJECT_SOURCE_DIR}/openrw_iwyu.imp")
cmake_parse_arguments("OPENRW_APPLY" "" "TARGET" "" ${ARGN})

View File

@ -1,5 +1,3 @@
find_package(Boost COMPONENTS program_options REQUIRED)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/GitSHA1.cpp.in" "${CMAKE_CURRENT_BINARY_DIR}/GitSHA1.cpp" @ONLY)
set(RWGAME_SOURCES

View File

@ -2,8 +2,6 @@
## RWLIB
###########################################################
find_package(Boost REQUIRED)
SET(RWLIB_SOURCES
# GL stuff is only here temporarily, hoping to move it back to rwengine
source/gl/gl_core_3_3.c

View File

@ -2,8 +2,6 @@
# Unit Tests
##############################################################################
find_package(Boost COMPONENTS filesystem unit_test_framework system REQUIRED)
set(TESTS
Animation
Archive