mirror of
https://github.com/rwengine/openrw.git
synced 2024-11-22 02:12:45 +01:00
cmake: make OpenGL an imported target
This commit is contained in:
parent
5dc707aaed
commit
06c4bf09f7
14
cmake/modules/FindOpenGL.cmake
Normal file
14
cmake/modules/FindOpenGL.cmake
Normal file
@ -0,0 +1,14 @@
|
||||
include("${CMAKE_ROOT}/Modules/FindOpenGL.cmake")
|
||||
|
||||
if(OPENGL_FOUND)
|
||||
list(GET OPENGL_LIBRARIES 0 OPENGL_FIRST_LIBRARY)
|
||||
set(OPENGL_OTHER_LIBRARIES "${OPENGL_LIBRARIES}")
|
||||
list(REMOVE_AT OPENGL_OTHER_LIBRARIES 0)
|
||||
add_library(OpenGL::OpenGL UNKNOWN IMPORTED)
|
||||
set_target_properties(OpenGL::OpenGL PROPERTIES
|
||||
IMPORTED_LINK_INTERFACE_LANGUAGES "C;CXX"
|
||||
IMPORTED_LOCATION "${OPENGL_FIRST_LIBRARY}"
|
||||
INTERFACE_LINK_LIBRARIES "${OPENGL_OTHER_LIBRARIES}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${OPENGL_INCLUDE_DIR}"
|
||||
)
|
||||
endif()
|
@ -60,7 +60,6 @@ target_link_libraries(rwgame
|
||||
PRIVATE
|
||||
rwengine
|
||||
${Boost_PROGRAM_OPTIONS_LIBRARY}
|
||||
${OPENGL_LIBRARIES}
|
||||
SDL2::SDL2
|
||||
)
|
||||
|
||||
|
@ -57,7 +57,7 @@ target_link_libraries(rwlib
|
||||
PUBLIC
|
||||
openrw::interface
|
||||
PRIVATE
|
||||
${OPENGL_LIBRARIES}
|
||||
OpenGL::OpenGL
|
||||
${Boost_FILESYSTEM_LIBRARY}
|
||||
${Boost_SYSTEM_LIBRARY}
|
||||
)
|
||||
|
@ -26,7 +26,6 @@ add_executable(rwviewer
|
||||
|
||||
target_link_libraries(rwviewer
|
||||
rwengine
|
||||
${OPENGL_LIBRARIES}
|
||||
)
|
||||
|
||||
qt5_use_modules(rwviewer Widgets OpenGL)
|
||||
|
@ -71,7 +71,6 @@ target_include_directories(run_tests
|
||||
target_link_libraries(run_tests
|
||||
PRIVATE
|
||||
rwengine
|
||||
${OPENGL_LIBRARIES}
|
||||
SDL2::SDL2
|
||||
${PNG_LIBRARIES}
|
||||
${Boost_FILESYSTEM_LIBRARY}
|
||||
|
Loading…
Reference in New Issue
Block a user