1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-07 03:12:36 +01:00

Improve CMake detection of platform libraries

This commit is contained in:
Daniel Evans 2014-08-16 23:02:34 +01:00
parent c18badef48
commit 4d78cacd84
5 changed files with 36 additions and 4 deletions

View File

@ -19,6 +19,10 @@ ELSE()
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3" ) set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3" )
ENDIF() ENDIF()
IF(APPLE)
set(OPENRW_PLATFORM_LIBS iconv)
ENDIF()
# Make GLM use radians # Make GLM use radians
add_definitions(-DGLM_FORCE_RADIANS) add_definitions(-DGLM_FORCE_RADIANS)

View File

@ -9,6 +9,11 @@ add_library(rwengine
${RENDERWARE_HEADERS} ${RENDERWARE_HEADERS}
) )
target_link_libraries(rwengine sfml-window sfml-audio GLEW mad) target_link_libraries(rwengine
sfml-window
sfml-audio
GLEW
mad
${OPENRW_PLATFORM_LIBS})
include_directories(include ${BULLET_INCLUDE_DIR}) include_directories(include ${BULLET_INCLUDE_DIR})

View File

@ -12,6 +12,13 @@ add_executable(rwgame
include_directories("${CMAKE_SOURCE_DIR}/rwengine/include" ${BULLET_INCLUDE_DIR}) include_directories("${CMAKE_SOURCE_DIR}/rwengine/include" ${BULLET_INCLUDE_DIR})
target_link_libraries( rwgame rwengine sfml-graphics sfml-window sfml-system ${OPENGL_LIBRARIES} GLEW ${BULLET_LIBRARIES} iconv ) target_link_libraries( rwgame
rwengine
sfml-graphics
sfml-window
sfml-system
${OPENGL_LIBRARIES}
GLEW
${BULLET_LIBRARIES})
install(TARGETS rwgame RUNTIME DESTINATION bin) install(TARGETS rwgame RUNTIME DESTINATION bin)

View File

@ -17,7 +17,13 @@ add_executable(rwviewer
include_directories("${CMAKE_SOURCE_DIR}/rwengine/include" ${BULLET_INCLUDE_DIR}) include_directories("${CMAKE_SOURCE_DIR}/rwengine/include" ${BULLET_INCLUDE_DIR})
target_link_libraries(rwviewer rwengine sfml-graphics sfml-system ${OPENGL_LIBRARIES} GLEW ${BULLET_LIBRARIES} iconv) target_link_libraries(rwviewer
rwengine
sfml-graphics
sfml-system
${OPENGL_LIBRARIES}
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)

View File

@ -9,6 +9,16 @@ find_package(Boost COMPONENTS unit_test_framework REQUIRED)
include_directories("${CMAKE_SOURCE_DIR}/rwengine/include" "${CMAKE_SOURCE_DIR}/rwgame" ${BULLET_INCLUDE_DIR}) include_directories("${CMAKE_SOURCE_DIR}/rwengine/include" "${CMAKE_SOURCE_DIR}/rwgame" ${BULLET_INCLUDE_DIR})
target_link_libraries(run_tests rwengine sfml-window sfml-system sfml-graphics ${OPENGL_LIBRARIES} GLEW BulletDynamics BulletCollision LinearMath ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY} iconv) target_link_libraries(run_tests
rwengine
sfml-window
sfml-system
sfml-graphics
${OPENGL_LIBRARIES}
GLEW
BulletDynamics
BulletCollision
LinearMath
${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
add_test(UnitTests run_tests) add_test(UnitTests run_tests)