diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 73cd961c1..a1f9f17e8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -341,6 +341,9 @@ jobs: -DSFML_DIR="${env:GITHUB_WORKSPACE}/SFML_INSTALL/lib/cmake/SFML/" -DGLFW_INCLUDE_DIR="${env:GITHUB_WORKSPACE}/glfw-${env:GLFW_VERSION}.bin.WIN64/include" -DGLFW_LIBRARY="${env:GITHUB_WORKSPACE}/glfw-${env:GLFW_VERSION}.bin.WIN64/lib-vc2019/glfw3_mt.lib" + -DFREETYPE_INCLUDE_DIR_ft2build="${env:GITHUB_WORKSPACE}/freetype-windows-binaries-${env:FREETYPE_VERSION}/include" + -FREETYPE_INCLUDE_DIR_freetype2="${env:GITHUB_WORKSPACE}/freetype-windows-binaries-${env:FREETYPE_VERSION}/include" + -FREETYPE_LIBRARIES="${env:GITHUB_WORKSPACE}/freetype-windows-binaries-${env:FREETYPE_VERSION}/release static/vs2015-2022/win64/freetype.lib" & "cmake-${env:CMAKE_VERSION}.${env:CMAKE_VERSION_PATCH}-win64-x64/bin/cmake.exe" --build tests/cmake/build --config Release diff --git a/cmake/TGUIConfig.cmake.in b/cmake/TGUIConfig.cmake.in index 96b22b33e..a0a2e7d38 100644 --- a/cmake/TGUIConfig.cmake.in +++ b/cmake/TGUIConfig.cmake.in @@ -153,40 +153,27 @@ if(@TGUI_HAS_FONT_BACKEND_SDL_TTF@) endif() endif() -# Search for OpenGL when a backend requires it -if(@TGUI_HAS_RENDERER_BACKEND_OPENGL3@) - find_dependency(OpenGL) -endif() +# When linking statically, we also need to search for libraries that are linked privately +if (TGUI_STATIC_LIBRARIES) + if(@TGUI_HAS_RENDERER_BACKEND_OPENGL3@) + find_dependency(OpenGL) + endif() -# Search for FreeType when a backend requires it -if(@TGUI_HAS_FONT_BACKEND_FREETYPE@) - if(TGUI_OS_WINDOWS AND TGUI_COMPILER_MSVC) - if(@FREETYPE_WINDOWS_BINARIES_PATH@) - if(NOT DEFINED FREETYPE_INCLUDE_DIR_ft2build) - set(FREETYPE_INCLUDE_DIR_ft2build "@FREETYPE_WINDOWS_BINARIES_PATH@/include") - endif() - if(NOT DEFINED FREETYPE_INCLUDE_DIR_freetype2) - set(FREETYPE_INCLUDE_DIR_freetype2 "@FREETYPE_WINDOWS_BINARIES_PATH@/include") - endif() - if(NOT DEFINED FREETYPE_LIBRARIES AND NOT DEFINED FREETYPE_LIBRARY_RELEASE) - if(@FREETYPE_LIBRARIES@) - set(FREETYPE_LIBRARIES "@FREETYPE_LIBRARIES@") - endif() - endif() - endif() + if(@TGUI_HAS_FONT_BACKEND_FREETYPE@) + find_dependency(Freetype) endif() - find_dependency(Freetype) -endif() + if(@TGUI_OS_LINUX@) + find_dependency(Threads) + endif() -# Search for pthreads on Linux (for FileDialog icon loader) -if(@TGUI_OS_LINUX@) - find_dependency(Threads) -endif() + if(@TGUI_OS_LINUX@ AND @TGUI_USE_X11@) + find_dependency(X11) + endif() -# Search for X11 when a backend requires it -if(@TGUI_OS_LINUX@ AND @TGUI_USE_X11@) - find_dependency(X11) + if(@TGUI_USE_SYSTEM_GLAD@) + find_dependency(glad CONFIG) + endif() endif() # Choose whether the target definitions of static or shared libs must be imported