Skip to content

Commit

Permalink
Let CI test generated TGUIConfig.cmake file with more configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
texus committed Jul 24, 2024
1 parent df5b636 commit 7cd8e51
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 29 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
45 changes: 16 additions & 29 deletions cmake/TGUIConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7cd8e51

Please sign in to comment.