Some more CMake fixes

This commit is contained in:
Clownacy 2019-04-26 05:13:50 +01:00
parent 469c25c93d
commit 58d7fb2ca7

View file

@ -318,6 +318,12 @@ if(FREETYPE_FOUND AND NOT FORCE_LOCAL_LIBS)
else()
# Compile it ourselves
message(STATUS "Using local FreeType")
if(FORCE_LOCAL_LIBS)
set(CMAKE_DISABLE_FIND_PACKAGE_HarfBuzz ON)
set(CMAKE_DISABLE_FIND_PACKAGE_ZLIB ON)
set(CMAKE_DISABLE_FIND_PACKAGE_PNG ON)
set(CMAKE_DISABLE_FIND_PACKAGE_BZip2 ON)
endif()
add_subdirectory(external/freetype EXCLUDE_FROM_ALL)
target_link_libraries(CSE2 freetype)
endif()
@ -361,6 +367,11 @@ else()
# of important functions. THAT was no fun to debug.
set(FLTK_LIBRARIES)
set(OPTION_BUILD_EXAMPLES OFF) # Needed to prevent a name collision
if(FORCE_LOCAL_LIBS)
set(OPTION_USE_SYSTEM_ZLIB OFF)
set(OPTION_USE_SYSTEM_LIBJPEG OFF)
set(OPTION_USE_SYSTEM_LIBPNG OFF)
endif()
add_subdirectory(external/fltk EXCLUDE_FROM_ALL)
get_target_property(DIRS fltk INCLUDE_DIRECTORIES) # FLTK doesn't mark its includes as PUBLIC or INTERFACE, so we have to do this stupidity
target_include_directories(DoConfig PRIVATE ${DIRS})