Tweak how FORCE_LOCAL_LIBS works
This commit is contained in:
parent
ef8618d446
commit
6ef6f0f5c0
2 changed files with 16 additions and 7 deletions
|
@ -321,12 +321,15 @@ endif()
|
|||
|
||||
# Find dependencies
|
||||
|
||||
find_package(SDL2)
|
||||
if(TARGET SDL2::SDL2 AND NOT FORCE_LOCAL_LIBS)
|
||||
if(NOT FORCE_LOCAL_LIBS)
|
||||
find_package(SDL2)
|
||||
endif()
|
||||
|
||||
if(TARGET SDL2::SDL2)
|
||||
# CMake-generated config (Arch, vcpkg, Raspbian)
|
||||
message(STATUS "Using system SDL2")
|
||||
target_link_libraries(CSE2 SDL2::SDL2 SDL2::SDL2main)
|
||||
elseif(SDL2_FOUND AND NOT FORCE_LOCAL_LIBS)
|
||||
elseif(SDL2_FOUND)
|
||||
# Autotools-generated config (MSYS2)
|
||||
message(STATUS "Using system SDL2")
|
||||
target_include_directories(CSE2 PRIVATE ${SDL2_INCLUDE_DIRS})
|
||||
|
@ -339,8 +342,11 @@ else()
|
|||
target_link_libraries(CSE2 SDL2-static SDL2main)
|
||||
endif()
|
||||
|
||||
find_package(Freetype)
|
||||
if(FREETYPE_FOUND AND NOT FORCE_LOCAL_LIBS)
|
||||
if(NOT FORCE_LOCAL_LIBS)
|
||||
find_package(Freetype)
|
||||
endif()
|
||||
|
||||
if(FREETYPE_FOUND)
|
||||
message(STATUS "Using system FreeType")
|
||||
target_include_directories(CSE2 PRIVATE ${FREETYPE_INCLUDE_DIRS})
|
||||
target_link_libraries(CSE2 ${FREETYPE_LIBRARIES})
|
||||
|
|
|
@ -24,8 +24,11 @@ if(MSVC)
|
|||
endif()
|
||||
|
||||
# Find FLTK
|
||||
find_package(FLTK)
|
||||
if(FLTK_FOUND AND NOT FORCE_LOCAL_LIBS)
|
||||
if(NOT FORCE_LOCAL_LIBS)
|
||||
find_package(FLTK)
|
||||
endif()
|
||||
|
||||
if(FLTK_FOUND)
|
||||
message(STATUS "Using system FLTK")
|
||||
target_include_directories(DoConfig PRIVATE ${FLTK_INCLUDE_DIR})
|
||||
target_link_libraries(DoConfig ${FLTK_LIBRARIES})
|
||||
|
|
Loading…
Add table
Reference in a new issue