mirror of
https://github.com/rwengine/openrw.git
synced 2024-09-04 01:29:45 +02:00
cmake: make bullet an imported target
This commit is contained in:
parent
e555331748
commit
6ccf85b770
17
cmake/modules/FindBullet.cmake
Normal file
17
cmake/modules/FindBullet.cmake
Normal file
@ -0,0 +1,17 @@
|
||||
# Override CMake's FindBullet module:
|
||||
# create an IMPORTED TARGET
|
||||
|
||||
include("${CMAKE_ROOT}/Modules/FindBullet.cmake")
|
||||
|
||||
if(BULLET_FOUND)
|
||||
list(GET BULLET_LIBRARIES 0 BULLET_FIRST_LIBRARY)
|
||||
set(BULLET_OTHER_LIBRARIES "${BULLET_LIBRARIES}")
|
||||
list(REMOVE_AT BULLET_OTHER_LIBRARIES 0)
|
||||
add_library(bullet::bullet UNKNOWN IMPORTED)
|
||||
set_target_properties(bullet::bullet PROPERTIES
|
||||
IMPORTED_LINK_INTERFACE_LANGUAGES "C;CXX"
|
||||
IMPORTED_LOCATION "${BULLET_FIRST_LIBRARY}"
|
||||
INTERFACE_LINK_LIBRARIES "${BULLET_OTHER_LIBRARIES}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${BULLET_INCLUDE_DIR}"
|
||||
)
|
||||
endif()
|
@ -148,6 +148,7 @@ add_library(rwengine
|
||||
target_link_libraries(rwengine
|
||||
PUBLIC
|
||||
rwlib
|
||||
bullet::bullet
|
||||
ffmpeg::ffmpeg
|
||||
glm::glm
|
||||
PRIVATE
|
||||
@ -157,7 +158,6 @@ target_link_libraries(rwengine
|
||||
target_include_directories(rwengine
|
||||
SYSTEM
|
||||
PUBLIC
|
||||
${BULLET_INCLUDE_DIR}
|
||||
${OPENAL_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
|
@ -49,7 +49,6 @@ target_include_directories(rwgame
|
||||
SYSTEM
|
||||
PRIVATE
|
||||
${Boost_INCLUDE_DIRS}
|
||||
${BULLET_INCLUDE_DIR}
|
||||
${OPENAL_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
@ -63,7 +62,6 @@ target_link_libraries(rwgame
|
||||
rwengine
|
||||
${Boost_PROGRAM_OPTIONS_LIBRARY}
|
||||
${OPENGL_LIBRARIES}
|
||||
${BULLET_LIBRARIES}
|
||||
SDL2::SDL2
|
||||
)
|
||||
|
||||
|
@ -24,16 +24,11 @@ add_executable(rwviewer
|
||||
AnimationListWidget.cpp
|
||||
)
|
||||
|
||||
target_include_directories(rwviewer
|
||||
SYSTEM
|
||||
PRIVATE
|
||||
${BULLET_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
target_link_libraries(rwviewer
|
||||
rwengine
|
||||
${OPENGL_LIBRARIES}
|
||||
${BULLET_LIBRARIES})
|
||||
)
|
||||
|
||||
qt5_use_modules(rwviewer Widgets OpenGL)
|
||||
|
||||
install(TARGETS rwviewer RUNTIME DESTINATION "${BIN_DIR}")
|
||||
|
@ -60,7 +60,6 @@ target_include_directories(run_tests
|
||||
SYSTEM
|
||||
PRIVATE
|
||||
${Boost_INCLUDE_DIRS}
|
||||
${BULLET_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
target_include_directories(run_tests
|
||||
@ -73,7 +72,6 @@ target_link_libraries(run_tests
|
||||
PRIVATE
|
||||
rwengine
|
||||
${OPENGL_LIBRARIES}
|
||||
${BULLET_LIBRARIES}
|
||||
SDL2::SDL2
|
||||
${PNG_LIBRARIES}
|
||||
${Boost_FILESYSTEM_LIBRARY}
|
||||
|
Loading…
Reference in New Issue
Block a user