1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-09-03 09:09:47 +02:00

Improve CMake scripts

Look for bullet using the FindBullet package
This commit is contained in:
Daniel Evans 2014-06-18 17:07:51 +01:00
parent abf91c9a3c
commit 4d228e40c7
3 changed files with 22 additions and 8 deletions

View File

@ -2,16 +2,30 @@ cmake_minimum_required(VERSION 2.8)
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
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(rwviewer)
add_subdirectory(rwengine)
add_subdirectory(analyzer)
add_subdirectory(tests)

View File

@ -7,8 +7,8 @@ add_executable(rwgame
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)

View File

@ -15,9 +15,9 @@ add_executable(rwviewer
AnimationListModel.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)
install(TARGETS rwviewer RUNTIME DESTINATION bin)