diff --git a/CMakeLists.txt b/CMakeLists.txt index 38a790aa..c355026a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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})