1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-22 02:12:45 +01:00

cmake: Optionally create XXX:XXX targets for override packages

This commit is contained in:
Anonymous Maarten 2017-11-27 20:56:48 +01:00 committed by Daniel Evans
parent 4dc7da89ad
commit 934506f0c8
7 changed files with 6 additions and 6 deletions

0
.gitmodules vendored
View File

View File

@ -3,7 +3,7 @@
include("${CMAKE_ROOT}/Modules/FindBullet.cmake")
if(BULLET_FOUND)
if(BULLET_FOUND AND NOT TARGET bullet::bullet)
list(GET BULLET_LIBRARIES 0 BULLET_FIRST_LIBRARY)
set(BULLET_OTHER_LIBRARIES "${BULLET_LIBRARIES}")
list(REMOVE_AT BULLET_OTHER_LIBRARIES 0)

View File

@ -61,7 +61,7 @@ ${FFMPEG_LIBAVUTIL}
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(FFmpeg DEFAULT_MSG FFMPEG_LIBRARIES FFMPEG_INCLUDE_DIR)
if(FFMPEG_FOUND)
if(FFMPEG_FOUND AND NOT TARGET ffmpeg::ffmpeg)
list(GET FFMPEG_LIBRARIES 0 FFMPEG_FIRST_LIBRARY)
set(FFMPEG_OTHER_LIBRARIES "${FFMPEG_LIBRARIES}")
list(REMOVE_AT FFMPEG_OTHER_LIBRARIES 0)

View File

@ -64,7 +64,7 @@ IF(GLM_FOUND)
ENDIF(NOT GLM_FIND_QUIETLY)
ENDIF(GLM_FOUND)
if(GLM_FOUND)
if(GLM_FOUND AND NOT TARGET glm::glm)
add_library(glm::glm INTERFACE IMPORTED)
set_target_properties(glm::glm PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${GLM_INCLUDE_DIR}"

View File

@ -3,7 +3,7 @@
include("${CMAKE_ROOT}/Modules/FindOpenAL.cmake")
if(OPENAL_FOUND)
if(OPENAL_FOUND AND NOT TARGET OpenAL::OpenAL)
add_library(OpenAL::OpenAL UNKNOWN IMPORTED)
set_target_properties(OpenAL::OpenAL PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "C;CXX"

View File

@ -1,6 +1,6 @@
include("${CMAKE_ROOT}/Modules/FindOpenGL.cmake")
if(OPENGL_FOUND)
if(OPENGL_FOUND AND NOT TARGET OpenGL::OpenGL)
list(GET OPENGL_LIBRARIES 0 OPENGL_FIRST_LIBRARY)
set(OPENGL_OTHER_LIBRARIES "${OPENGL_LIBRARIES}")
list(REMOVE_AT OPENGL_OTHER_LIBRARIES 0)

View File

@ -195,7 +195,7 @@ IF(SDL2_STATIC)
ENDIF()
ENDIF(SDL2_STATIC)
if(SDL2_FOUND)
if(SDL2_FOUND AND NOT TARGET SDL2::SDL2)
set(SDL2_EXTRA_LIBS "${SDL2_LIBRARY_TEMP}")
list(REMOVE_ITEM SDL2_EXTRA_LIBS "${SDL2_LIBRARY_PATH}")
add_library(SDL2::SDL2 UNKNOWN IMPORTED)