-
Notifications
You must be signed in to change notification settings - Fork 7.4k
[glui] Add new port #9155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
[glui] Add new port #9155
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
02864d4
[glui] Add new port
myd7349 2948298
[freeglut] Fix static linking
myd7349 086c546
[glui] Fix description
myd7349 46491ce
Merge branch 'master' into glui-init
myd7349 912a864
[glui] Update
myd7349 a52ef88
Merge branch 'master' into glui-init
myd7349 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| Source: freeglut | ||
| Version: 3.0.0-7 | ||
| Version: 3.0.0-8 | ||
| Homepage: https://sourceforge.net/projects/freeglut/ | ||
| Description: Open source implementation of GLUT with source and binary backwards compatibility. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| Source: glui | ||
| Version: 2019-11-30 | ||
| Description: GLUI is a GLUT-based C++ user interface library | ||
| Homepage: https://github.com/libglui/glui | ||
| Build-Depends: freeglut |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
| index c0f7d32..8446f3c 100644 | ||
| --- a/CMakeLists.txt | ||
| +++ b/CMakeLists.txt | ||
| @@ -59,6 +59,22 @@ target_include_directories(glui_obj | ||
| # create static *and* shared libraries without double compilation | ||
| set_target_properties( glui_obj PROPERTIES POSITION_INDEPENDENT_CODE 1) | ||
|
|
||
| +if (MSVC) | ||
| + target_compile_options(glui_obj | ||
| + PRIVATE | ||
| + /D_CRT_SECURE_NO_WARNINGS | ||
| + /wd4244 | ||
| + /wd4305 | ||
| + ) | ||
| +endif() | ||
| + | ||
| +if(BUILD_SHARED_LIBS) | ||
| + if(WIN32) | ||
| + target_compile_definitions(glui_obj | ||
| + PRIVATE GLUI_BUILDING_LIB | ||
| + PUBLIC GLUIDLL | ||
| + ) | ||
| + endif() | ||
| add_library(glui SHARED $<TARGET_OBJECTS:glui_obj>) | ||
| target_include_directories(glui | ||
| PUBLIC | ||
| @@ -71,7 +87,7 @@ set_target_properties(glui PROPERTIES | ||
| DEBUG_POSTFIX "d" | ||
| VERSION ${PROJECT_VERSION} | ||
| SOVERSION ${PROJECT_VERSION}) | ||
| - | ||
| +else() | ||
| add_library(glui_static STATIC $<TARGET_OBJECTS:glui_obj>) | ||
| target_include_directories(glui_static | ||
| PUBLIC | ||
| @@ -81,7 +97,9 @@ target_include_directories(glui_static | ||
| ${GLUT_INCLUDE_DIR}) | ||
| target_link_libraries(glui_static PUBLIC ${GLUT_LIBRARIES} ${OPENGL_LIBRARIES}) | ||
| set_target_properties(glui_static PROPERTIES DEBUG_POSTFIX "d") | ||
| +endif() | ||
|
|
||
| +if(GLUI_BUILD_EXAMPLES) | ||
| add_executable(ppm2array tools/ppm.cpp tools/ppm2array.cpp) | ||
| target_link_libraries(ppm2array) | ||
|
|
||
| @@ -97,7 +115,7 @@ add_executable(example5 example/example5.cpp) | ||
| target_link_libraries(example5 glui_static ${GLUT_LIBRARIES} ${OPENGL_LIBRARIES}) | ||
| add_executable(example6 example/example6.cpp) | ||
| target_link_libraries(example6 glui_static ${GLUT_LIBRARIES} ${OPENGL_LIBRARIES}) | ||
| - | ||
| +endif() | ||
|
|
||
|
|
||
| #### | ||
| @@ -130,8 +148,13 @@ configure_package_config_file( | ||
| ) | ||
|
|
||
| # Targets: | ||
| +if(BUILD_SHARED_LIBS) | ||
| + set(glui_target glui) | ||
| +else() | ||
| + set(glui_target glui_static) | ||
| +endif() | ||
| install( | ||
| - TARGETS glui_static glui | ||
| + TARGETS ${glui_target} | ||
| EXPORT "${targets_export_name}" | ||
| LIBRARY DESTINATION "lib" | ||
| ARCHIVE DESTINATION "lib" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| vcpkg_from_github( | ||
| OUT_SOURCE_PATH SOURCE_PATH | ||
| REPO libglui/glui | ||
| REF 093edc777c02118282910bdee59f8db1bd46a84d | ||
| SHA512 650e169a6a55cd7d599176ac0767cd95b511fbc0a9b27aab2fa4f94a6395fa1a5762b6c23f5f1a9fc5ac9ce70c44fee4e4cbb6d6afd2307130cedfb80aae877a | ||
| HEAD_REF master | ||
| PATCHES | ||
| install-one-flavor.patch | ||
| ) | ||
|
|
||
| vcpkg_configure_cmake( | ||
| SOURCE_PATH ${SOURCE_PATH} | ||
| PREFER_NINJA | ||
| ) | ||
|
|
||
| vcpkg_install_cmake() | ||
|
|
||
| vcpkg_copy_pdbs() | ||
|
|
||
| vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/${PORT}) | ||
|
|
||
| file(COPY | ||
| ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake | ||
| DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} | ||
| ) | ||
|
|
||
| file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) | ||
|
|
||
| if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) | ||
| vcpkg_replace_string( | ||
| ${CURRENT_PACKAGES_DIR}/include/GL/glui.h | ||
| "ifdef GLUIDLL" | ||
| "if 1 //ifdef GLUIDLL" | ||
| ) | ||
| endif() | ||
|
|
||
| file(INSTALL ${SOURCE_PATH}/license.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| _find_package(${ARGS}) | ||
|
|
||
| if(TARGET glui::glui AND NOT TARGET glui::glui_static) | ||
| add_library(glui::glui_static INTERFACE IMPORTED) | ||
| set_target_properties(glui::glui_static PROPERTIES INTERFACE_LINK_LIBRARIES glui::glui) | ||
| elseif(TARGET glui::glui_static AND NOT TARGET glui::glui) | ||
| add_library(glui::glui INTERFACE IMPORTED) | ||
| set_target_properties(glui::glui PROPERTIES INTERFACE_LINK_LIBRARIES glui::glui_static) | ||
| endif() |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Due to editing the sources in the buildtree folder and not the installed ones, after this PR has been merged if you install freeglut in a static triplet and then install freeglut in a dynamic triplet, without deleting the buildtree folder (which is not required nor even suggested to users) everything is damaged and the compiler crashes. @vicroms
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi! Nice catch! @cenit Thanks for pointing it out. I should have patched it carefully. I have created a PR #9725 for fixing this.