mirror of
https://github.com/rwengine/openrw.git
synced 2024-11-07 03:12:36 +01:00
Improve CMake scripts
Look for bullet using the FindBullet package
This commit is contained in:
parent
abf91c9a3c
commit
4d228e40c7
@ -2,16 +2,30 @@ cmake_minimum_required(VERSION 2.8)
|
|||||||
|
|
||||||
project(OpenRW)
|
project(OpenRW)
|
||||||
|
|
||||||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -std=c++11 -Wall" )
|
# TODO:
|
||||||
|
# - Visual Studio support
|
||||||
|
# - Find libraries correctly, e.g. FindBullet
|
||||||
|
|
||||||
|
SET(BUILD_OLD_TOOLS FALSE CACHE BOOL "Build old datadump and analyzer tools")
|
||||||
|
|
||||||
|
IF(CMAKE_BUILD_TYPE MATCHES DEBUG)
|
||||||
|
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -std=c++11 -Wall -Wextra" )
|
||||||
|
ELSE()
|
||||||
|
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -std=c++11 -Wall" )
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
# Make GLM use radians
|
# Make GLM use radians
|
||||||
add_definitions(-DGLM_FORCE_RADIANS)
|
add_definitions(-DGLM_FORCE_RADIANS)
|
||||||
|
|
||||||
add_subdirectory(datadump)
|
find_package(Bullet REQUIRED)
|
||||||
|
|
||||||
|
IF(BUILD_OLD_TOOLS)
|
||||||
|
add_subdirectory(analyzer)
|
||||||
|
add_subdirectory(datadump)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
add_subdirectory(rwgame)
|
add_subdirectory(rwgame)
|
||||||
add_subdirectory(rwviewer)
|
add_subdirectory(rwviewer)
|
||||||
add_subdirectory(rwengine)
|
add_subdirectory(rwengine)
|
||||||
|
|
||||||
add_subdirectory(analyzer)
|
|
||||||
|
|
||||||
add_subdirectory(tests)
|
add_subdirectory(tests)
|
||||||
|
@ -7,8 +7,8 @@ add_executable(rwgame
|
|||||||
debugstate.cpp
|
debugstate.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
include_directories("${CMAKE_SOURCE_DIR}/rwengine/include" /usr/include/bullet)
|
include_directories("${CMAKE_SOURCE_DIR}/rwengine/include" ${BULLET_INCLUDE_DIRS})
|
||||||
|
|
||||||
target_link_libraries( rwgame rwengine sfml-graphics sfml-window sfml-system GL GLEW BulletDynamics BulletCollision LinearMath )
|
target_link_libraries( rwgame rwengine sfml-graphics sfml-window sfml-system GL GLEW ${BULLET_LIBRARIES} )
|
||||||
|
|
||||||
install(TARGETS rwgame RUNTIME DESTINATION bin)
|
install(TARGETS rwgame RUNTIME DESTINATION bin)
|
||||||
|
@ -15,9 +15,9 @@ add_executable(rwviewer
|
|||||||
AnimationListModel.cpp
|
AnimationListModel.cpp
|
||||||
AnimationListWidget.cpp)
|
AnimationListWidget.cpp)
|
||||||
|
|
||||||
include_directories("${CMAKE_SOURCE_DIR}/rwengine/include" /usr/include/bullet)
|
include_directories("${CMAKE_SOURCE_DIR}/rwengine/include" ${BULLET_INCLUDE_DIRS})
|
||||||
|
|
||||||
target_link_libraries(rwviewer rwengine sfml-graphics sfml-system GL GLEW BulletDynamics BulletCollision LinearMath)
|
target_link_libraries(rwviewer rwengine sfml-graphics sfml-system GL GLEW ${BULLET_LIBRARIES})
|
||||||
qt5_use_modules(rwviewer Widgets OpenGL)
|
qt5_use_modules(rwviewer Widgets OpenGL)
|
||||||
|
|
||||||
install(TARGETS rwviewer RUNTIME DESTINATION bin)
|
install(TARGETS rwviewer RUNTIME DESTINATION bin)
|
||||||
|
Loading…
Reference in New Issue
Block a user