Skip to content
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

WIP: Example 13.BRDF_Explorer #291

Merged
merged 82 commits into from
Jun 1, 2019

Conversation

manhnt9
Copy link
Contributor

@manhnt9 manhnt9 commented May 1, 2019

#279
MSVC 2019 will be supported first, then Linux GCC.

Changes to irrbaw:

  • Add IRR_BUILD_CEGUI option, default is OFF to save time
  • Root CMake detect and set ${IRR_PARALLEL_BUILD_JOBS}, you can use for subprojects too
  • New global variables: CEGUI_INCLUDE_PATH, CEGUI_LIBS

DevSH's CMake guidelines (copied from Discord chat)

my main guideline for CMake and modules etc
is that build system is not allowed to make files etc outside of the build directory
with the SOLE exception of OpenSSL
also stuff installed SHOULD only be irrlicht headers and irrlicht static lib, there might be a legitimate reason to go against this
dependencies should not install together with that (which means they must be statically linked so they are inside irrlicht lib) - example, none of libpng, libjpeg etc are visible to the outside nor are they installed
the only exception is a dependency of an irr::ext (since irr::ext can be enabled and disabled separately from the main lib, and main lib never actually includes and links extensions)
then headers CAN install (if necessary) to $INSTALL_PREFIX/include/irr/ext/YOUR_EXT_NAME/3rdparty/YOUR_EXTS_3RDPARTY_DEPENDENCY
the library CAN install to $INSTALL_PREFIX/lib/irr/ext/YOUR_EXT_NAME/3rdparty/YOUR_EXTS_3RDPARTY_DEPENDENCY (but why do it if it can be statically linked?)
Example, Bullet with an $INSTALL_PREFIX=./install/win64-msvc/
Sample Header

./install/win64-gcc/include/irr/ext/Bullet/3rdparty/include/bullet/Bullet-C-Api.h

Sample lib

./install/win64-gcc/lib/irr/ext/Bullet/3rdparty/libBulletCollision.so

however if your irr::ext::something requires 3rdparty libraries you should really build it as a static library itself, install the irr::ext::something library and not install the dependencies.
Also think if you "really" need the top level API of your irr::ext to expose the 3rdparty dependency headers... unless you expect the user to want to have access to the internals, maybe don't expose
For example it may be good for users to have access to all of Bullet's API, that saves irr::ext::bullet being a silly pointless wrapper of the entire Bullet API

3rdparty/CEGUI/CMakeLists.txt Outdated Show resolved Hide resolved
@manhnt9
Copy link
Contributor Author

manhnt9 commented May 2, 2019

CEGUI build is integrated in to irrbaw, but don't try it yet, still has some errors.

The building process is done, I will have to set correct configurations for CEGUI.

@manhnt9
Copy link
Contributor Author

manhnt9 commented May 3, 2019

Proposed changes, please review @devshgraphicsprogramming @Crisspl.
(Approved by devsh on Discord).

In order to link more libs to an example, we'd have to modify macro(irr_create_executable_project).
CMake complains if I use target_link_libraries in CMake of example, after irr_create_executable_project("" "") since it's called before in the macro(irr_create_executable_project).

So target_link_libraries should be called once.

To let example add more libs, the macro can be changed to: macro(irr_create_executable_project _EXTRA_SOURCES _EXTRA_OPTIONS _EXTRA_INCLUDES _EXTRA_LIBS).

Further changes required:

  • Find and replace irr_create_executable_project("" "") with irr_create_executable_project("" "" "" "")

@devshgraphicsprogramming
Copy link
Collaborator

Double approved.

@manhnt9
Copy link
Contributor Author

manhnt9 commented May 3, 2019

I pushed the changes several hours ago, it appears before the comment because my Windows time is f**ked by Linux. Have just fixed my LVM partitions, relocated and resized, etc so still no code yet. My environment is stable now. From here we can expect frequent code updates.

@manhnt9
Copy link
Contributor Author

manhnt9 commented May 6, 2019

Linux can now build CEGUI and base project.

@manhnt9
Copy link
Contributor Author

manhnt9 commented May 6, 2019

In the waiting of the IMG loaders, I will use STB image for the time being.

@manhnt9
Copy link
Contributor Author

manhnt9 commented May 6, 2019

The progress is still new, I will notify when it's ready to be reviewed.

@manhnt9
Copy link
Contributor Author

manhnt9 commented May 6, 2019

According to @Florastamine, Native File Dialogs library has bugs on Linux so he had to replace with Portable File Dialogs, and it works well.

Bug description:
The implementation of NDF which uses zenity (nfd_zenity.c) on a few occasions would skip right through the file dialog, which would return garbage because the window just flashes and closes right after without the user be able to choose anything.
PDF also uses zenity and doesn't exhibit the same problem, plus its single header.
It's in active development (more than NDF) and is made by a OSS supporter Sam Hocevar, the guy who invented WTFPL license.

.gitignore Outdated Show resolved Hide resolved
@manhnt9
Copy link
Contributor Author

manhnt9 commented May 7, 2019

I had to remove this include, it produces conflicts with glew that CEGUI uses.
#include "../source/Irrlicht/COpenGLExtensionHandler.h"

@manhnt9
Copy link
Contributor Author

manhnt9 commented May 7, 2019

Current CMake warning:
CMake Error at cmake/common.cmake:12 (add_executable):
Target "brdf_explorer" links to item
"IrrlichtBAW/build/3rdparty/CEGUI/build/install/lib/CEGUIOpenGLRenderer-0_Static.lib
" which has leading or trailing whitespace. This is now an error according
to policy CMP0004.
Call Stack (most recent call first):
examples_tests/13.BRDF_Explorer/CMakeLists.txt:13 (irr_create_executable_project)

I have to keep this because of the CMake's nature. The build still works correctly though. In fact, it needs this warning to work.

For example:

set(VAR
  lib1
  lib2
)
message(STATUS ${VAR}) # will print lib1lib2

# so I have to use
set(VAR
  "lib1 "
  "lib2 "
)

@devshgraphicsprogramming
Copy link
Collaborator

Current CMake warning:
CMake Error at cmake/common.cmake:12 (add_executable):
Target "brdf_explorer" links to item
"IrrlichtBAW/build/3rdparty/CEGUI/build/install/lib/CEGUIOpenGLRenderer-0_Static.lib
" which has leading or trailing whitespace. This is now an error according
to policy CMP0004.
Call Stack (most recent call first):
examples_tests/13.BRDF_Explorer/CMakeLists.txt:13 (irr_create_executable_project)

I have to keep this because of the CMake's nature. The build still works correctly though. In fact, it needs this warning to work.

For example:

set(VAR
  lib1
  lib2
)
message(STATUS ${VAR}) # will print lib1lib2

# so I have to use
set(VAR
  "lib1 "
  "lib2 "
)

would it work as

set(VAR
  "lib1"
  "lib2"
)

?

@devshgraphicsprogramming
Copy link
Collaborator

Last thing, why is Portable File Dialog a submodule in irr::ext?

btw you have permission to put 3rdparty dependencies (even CEGUI) of any extension in the ./3rdparty folder as this simplifies life when multiple extensions or parts of the library need the same extension.
Just don't install them

@manhnt9
Copy link
Contributor Author

manhnt9 commented May 10, 2019

set(VAR
  "lib1"
  "lib2"
)

Doesn't work.

I'll relocate the submodules.

@devshgraphicsprogramming
Copy link
Collaborator

if we need a later version of CEGUI can you commit that you've pulled a later version of the submodule?
(if you pull a different submodule commit/branch, you can commit that fact)

@manhnt9
Copy link
Contributor Author

manhnt9 commented May 25, 2019

Yes I know that, just wondering if you've got the correct CEGUI version. Because it (glew linking errors) is strange since that is fixed in latest CEGUI.

@devshgraphicsprogramming
Copy link
Collaborator

well I reset and force intialized my submodules, what else can i do?

@manhnt9
Copy link
Contributor Author

manhnt9 commented May 25, 2019

Could you paste last 5 commits of git log after cd into 3rdparty/CEGUI/cegui?

@devshgraphicsprogramming
Copy link
Collaborator

Revision: fcc8d6cdc1992ba532db865ec56056e930850cc4
Author: ManhNT <[email protected]>
Date: 20/05/2019 11:35:35
Message:
Update CEGUI for static PCRE fix

----
Modified: 3rdparty/CEGUI/cegui

Revision: 7b86b751cec96158bf9214f3e49ab9467fd63dd4
Author: ManhNT <[email protected]>
Date: 20/05/2019 11:04:05
Message:
Update patched CEGUI

----
Modified: 3rdparty/CEGUI/CMakeLists.txt
Modified: 3rdparty/CEGUI/cegui

Revision: 3d5d0224eb7aaacf88d7f931325f0a13615b7675
Author: Manh NT <[email protected]>
Date: 02/05/2019 22:17:39
Message:
Update CEGUI submodule to ignore dependencies folder

----
Modified: 3rdparty/CEGUI/cegui

Revision: 272422997a98184f39a0945279f9c95d2deec785
Author: ManhNT <[email protected]>
Date: 01/05/2019 11:34:00
Message:
Add submodules

----
Modified: .gitmodules
Added: 3rdparty/CEGUI/cegui
Added: examples_tests/media/cegui_alfisko

@manhnt9
Copy link
Contributor Author

manhnt9 commented May 25, 2019

Yeah that's an old module. My log is below, notice that the first commit hash is the same as what I pushed: https://github.com/manhnt9/IrrlichtBAW/tree/sRGB/3rdparty/CEGUI

commit 160161abafdafe2b033b1d84c3df10eb6f45cbda (HEAD -> saga, origin/saga, origin/HEAD)
Author: ManhNT <[email protected]>
Date:   Mon May 20 16:33:55 2019 +0700

    Add utility files

commit 1795c87bbb250c9b10322a0f10f3bfb731cc3f68
Author: Manh NT <[email protected]>
Date:   Mon May 20 16:31:38 2019 +0700

    Add PCRE to static dependencies config

commit 8c1906537df085f46ac962856cd8ef881a470ae8
Author: Manh NT <[email protected]>
Date:   Mon May 20 14:54:58 2019 +0700

    Initial static dependencies patch

commit a19029730a24ceb7ff1eec522d7b18b1bddc1fd2
Author: Manh NT <[email protected]>
Date:   Wed Apr 17 10:59:45 2019 +0700

    Revert missing patch

commit 18802fcdbbaa864d8d9bd95c8ff420100d471854
Author: Manh NT <[email protected]>
Date:   Wed Apr 17 10:55:59 2019 +0700

    Revert incompatible change

@manhnt9
Copy link
Contributor Author

manhnt9 commented May 25, 2019

Oooh, strange, but the latest commit message should be Add utility files instead of Update CEGUI for static PCRE fix shown in https://github.com/manhnt9/IrrlichtBAW/tree/sRGB/3rdparty/CEGUI.

I think Git is messed up somehow. I'm checking.

@manhnt9
Copy link
Contributor Author

manhnt9 commented May 25, 2019

Solved, besides Git URL a submodule needs the branch name if it's not using master as default branch. My CEGUI branch is saga. Adding submodule without branch name works for the first time but it can't update without knowing which branch later. Git is dumb in this issue, not producing a sensible output and just assume the updated status somehow.

@manhnt9
Copy link
Contributor Author

manhnt9 commented May 25, 2019

You can pull and try updating the CEGUI module.

@devshgraphicsprogramming
Copy link
Collaborator

I couldn't pull because despite the pull of the main repo (where the branch is specified) git told me I'm not on a branch when pulling a submodule

So I had to pull explicitly, and it told me I'm up to date

C:\work\IrrlichtBAW\manhnt\3rdparty\CEGUI\cegui>git pull origin saga
From https://gitlab.com/InnerPieceOSS/cegui
 * branch              saga       -> FETCH_HEAD
Already up to date.

C:\work\IrrlichtBAW\manhnt\3rdparty\CEGUI\cegui>

Why do I need to mess around with the module manually if you update the submodules file?
Its not like I had any tracked or untrack file changes there.

And after all this I get extra compiler errors + cannot find glew.h .

@manhnt9
Copy link
Contributor Author

manhnt9 commented May 25, 2019

For any submodule, you'll have to checkout its branch before pulling.

git checkout saga (or master for other modules)
git pull origin saga

@devshgraphicsprogramming
Copy link
Collaborator

I've done that manually, question is why on earth do I have to do that by myself, shouldn't we all be synced up nicely regarding what branch and revision/commit of a submodule we're using?

Especially after a hard reset?

@devshgraphicsprogramming
Copy link
Collaborator

I was all up to date and proper.

Seems that because the CEGUI deps are not proper targets, after a change of cegui the following happens:

  1. ZERO_CHECK doesn't work, as in it doesn't detect dependency
  2. "Configure" again doesn't work because of CMake cache

So I needed to delete cache, and do "Configure" with correct extra options from the ground up again.

@manhnt9
Copy link
Contributor Author

manhnt9 commented May 25, 2019

The submodule hassle is due to the git mirroring.
The git version has extra changes (.gitignore for example) which are not reasonable to put into original svn repo. And the sync process will break completely if the git repo has manually made commit via git.
So each time I sync, my sync script does some tricks that re-writing some git commits, I'd have to revert git changes, sync from svn, re-add git changes and commit, and push -f. Maybe the commit hashes are messed up.
For now, I can eliminate git changes from the repo (leaving out .gitignore and then dependencies folder generated by build will be detected by irrbaw's git, but we already have shaderc and openssl polluted the same way, shaderc needs a touch of new lib file before building and openssl only builds in the source folder).

About the CEGUI CMake cache, yes because CEGUI version has changed. I advise deleting the CEGUI folder generated in build/3rdparty and configure again. Also note that I've tried deleting my build folder and rebuild several times on both Windows and Linux, so it shouldn't meet any serious build problems now.

@devshgraphicsprogramming
Copy link
Collaborator

Actually OpenSSL building in the source dir is not a problem, because the submodule gets reset and pulled the latest version from the 1.0.2 branch every time it builds ;)

Yeah the shaderc thing is a drag, they were supposed to have already fixed it :(

I think CEGUI deps should be properly added and statically linked on Linux after we ship BRDF Explorer completely.

@devshgraphicsprogramming
Copy link
Collaborator

Update: I've experienced #299 when trying to build example 13 in the Release configuration straight away.

Nope still same glew linker errors

@devshgraphicsprogramming
Copy link
Collaborator

Even in Debug build

12>CEGUIOpenGLRenderer-0_Static_d.lib(RendererBase.obj) : error LNK2019: unresolved external symbol __imp_glewInit referenced in function "protected: void __cdecl CEGUI::OpenGLRendererBase::init(bool,bool)" (?init@OpenGLRendererBase@CEGUI@@IEAAX_N0@Z)
12>CEGUIOpenGLRenderer-0_Static_d.lib(RendererBase.obj) : error LNK2019: unresolved external symbol __imp_glewGetErrorString referenced in function "protected: void __cdecl CEGUI::OpenGLRendererBase::init(bool,bool)" (?init@OpenGLRendererBase@CEGUI@@IEAAX_N0@Z)
12>CEGUIOpenGLRenderer-0_Static_d.lib(RendererBase.obj) : error LNK2001: unresolved external symbol __imp_glewExperimental
12>CEGUIOpenGLRenderer-0_Static_d.lib(GL3Renderer.obj) : error LNK2001: unresolved external symbol __imp___glewActiveTexture
12>CEGUIOpenGLRenderer-0_Static_d.lib(GL3Renderer.obj) : error LNK2001: unresolved external symbol __imp___glewBlendFuncSeparate
12>CEGUIOpenGLRenderer-0_Static_d.lib(StateChangeWrapper.obj) : error LNK2001: unresolved external symbol __imp___glewBlendFuncSeparate
12>CEGUIOpenGLRenderer-0_Static_d.lib(GL3Renderer.obj) : error LNK2001: unresolved external symbol __imp___glewUniform1i
12>CEGUIOpenGLRenderer-0_Static_d.lib(GL3Renderer.obj) : error LNK2001: unresolved external symbol __imp___glewUseProgram
12>CEGUIOpenGLRenderer-0_Static_d.lib(Shader.obj) : error LNK2001: unresolved external symbol __imp___glewUseProgram
12>CEGUIOpenGLRenderer-0_Static_d.lib(GL.obj) : error LNK2001: unresolved external symbol __imp___glewGetStringi
12>CEGUIOpenGLRenderer-0_Static_d.lib(GL.obj) : error LNK2001: unresolved external symbol __imp___GLEW_VERSION_1_3
12>CEGUIOpenGLRenderer-0_Static_d.lib(GL.obj) : error LNK2001: unresolved external symbol __imp___GLEW_VERSION_2_0
12>CEGUIOpenGLRenderer-0_Static_d.lib(GL.obj) : error LNK2001: unresolved external symbol __imp___GLEW_VERSION_3_1
12>CEGUIOpenGLRenderer-0_Static_d.lib(GL.obj) : error LNK2001: unresolved external symbol __imp___GLEW_VERSION_3_2
12>CEGUIOpenGLRenderer-0_Static_d.lib(GL.obj) : error LNK2001: unresolved external symbol __imp___GLEW_ARB_texture_non_power_of_two
12>CEGUIOpenGLRenderer-0_Static_d.lib(Texture.obj) : error LNK2001: unresolved external symbol __imp___glewCompressedTexImage2D
12>CEGUIOpenGLRenderer-0_Static_d.lib(Texture.obj) : error LNK2001: unresolved external symbol __imp___glewCompressedTexSubImage2D
12>CEGUIOpenGLRenderer-0_Static_d.lib(Texture.obj) : error LNK2001: unresolved external symbol __imp___glewGetCompressedTexImage
12>CEGUIOpenGLRenderer-0_Static_d.lib(Texture.obj) : error LNK2001: unresolved external symbol __imp___glewBindBuffer
12>CEGUIOpenGLRenderer-0_Static_d.lib(GL3GeometryBuffer.obj) : error LNK2001: unresolved external symbol __imp___glewBindBuffer
12>CEGUIOpenGLRenderer-0_Static_d.lib(StateChangeWrapper.obj) : error LNK2001: unresolved external symbol __imp___glewBindBuffer
12>CEGUIOpenGLRenderer-0_Static_d.lib(Texture.obj) : error LNK2001: unresolved external symbol __imp___glewBindFramebuffer
12>CEGUIOpenGLRenderer-0_Static_d.lib(GL3FBOTextureTarget.obj) : error LNK2001: unresolved external symbol __imp___glewBindFramebuffer
12>CEGUIOpenGLRenderer-0_Static_d.lib(Texture.obj) : error LNK2001: unresolved external symbol __imp___glewDeleteFramebuffers
12>CEGUIOpenGLRenderer-0_Static_d.lib(GL3FBOTextureTarget.obj) : error LNK2001: unresolved external symbol __imp___glewDeleteFramebuffers
12>CEGUIOpenGLRenderer-0_Static_d.lib(Texture.obj) : error LNK2001: unresolved external symbol __imp___glewFramebufferTexture2D
12>CEGUIOpenGLRenderer-0_Static_d.lib(GL3FBOTextureTarget.obj) : error LNK2001: unresolved external symbol __imp___glewFramebufferTexture2D
12>CEGUIOpenGLRenderer-0_Static_d.lib(Texture.obj) : error LNK2001: unresolved external symbol __imp___glewGenFramebuffers
12>CEGUIOpenGLRenderer-0_Static_d.lib(GL3FBOTextureTarget.obj) : error LNK2001: unresolved external symbol __imp___glewGenFramebuffers
12>CEGUIOpenGLRenderer-0_Static_d.lib(Shader.obj) : error LNK2001: unresolved external symbol __imp___glewAttachShader
12>CEGUIOpenGLRenderer-0_Static_d.lib(Shader.obj) : error LNK2001: unresolved external symbol __imp___glewCompileShader
12>CEGUIOpenGLRenderer-0_Static_d.lib(Shader.obj) : error LNK2001: unresolved external symbol __imp___glewCreateProgram
12>CEGUIOpenGLRenderer-0_Static_d.lib(Shader.obj) : error LNK2001: unresolved external symbol __imp___glewCreateShader
12>CEGUIOpenGLRenderer-0_Static_d.lib(Shader.obj) : error LNK2001: unresolved external symbol __imp___glewDeleteProgram
12>CEGUIOpenGLRenderer-0_Static_d.lib(Shader.obj) : error LNK2001: unresolved external symbol __imp___glewDeleteShader
12>CEGUIOpenGLRenderer-0_Static_d.lib(Shader.obj) : error LNK2001: unresolved external symbol __imp___glewGetAttribLocation
12>CEGUIOpenGLRenderer-0_Static_d.lib(Shader.obj) : error LNK2001: unresolved external symbol __imp___glewGetProgramInfoLog
12>CEGUIOpenGLRenderer-0_Static_d.lib(Shader.obj) : error LNK2001: unresolved external symbol __imp___glewGetProgramiv
12>CEGUIOpenGLRenderer-0_Static_d.lib(Shader.obj) : error LNK2001: unresolved external symbol __imp___glewGetShaderInfoLog
12>CEGUIOpenGLRenderer-0_Static_d.lib(Shader.obj) : error LNK2001: unresolved external symbol __imp___glewGetShaderiv
12>CEGUIOpenGLRenderer-0_Static_d.lib(Shader.obj) : error LNK2001: unresolved external symbol __imp___glewGetUniformLocation
12>CEGUIOpenGLRenderer-0_Static_d.lib(Shader.obj) : error LNK2001: unresolved external symbol __imp___glewLinkProgram
12>CEGUIOpenGLRenderer-0_Static_d.lib(Shader.obj) : error LNK2001: unresolved external symbol __imp___glewShaderSource
12>CEGUIOpenGLRenderer-0_Static_d.lib(Shader.obj) : error LNK2001: unresolved external symbol __imp___glewBindFragDataLocation
12>CEGUIOpenGLRenderer-0_Static_d.lib(GL3GeometryBuffer.obj) : error LNK2001: unresolved external symbol __imp___glewBufferData
12>CEGUIOpenGLRenderer-0_Static_d.lib(GL3GeometryBuffer.obj) : error LNK2001: unresolved external symbol __imp___glewBufferSubData
12>CEGUIOpenGLRenderer-0_Static_d.lib(GL3GeometryBuffer.obj) : error LNK2001: unresolved external symbol __imp___glewDeleteBuffers
12>CEGUIOpenGLRenderer-0_Static_d.lib(GL3GeometryBuffer.obj) : error LNK2001: unresolved external symbol __imp___glewGenBuffers
12>CEGUIOpenGLRenderer-0_Static_d.lib(GL3GeometryBuffer.obj) : error LNK2001: unresolved external symbol __imp___glewEnableVertexAttribArray
12>CEGUIOpenGLRenderer-0_Static_d.lib(GL3GeometryBuffer.obj) : error LNK2001: unresolved external symbol __imp___glewUniformMatrix4fv
12>CEGUIOpenGLRenderer-0_Static_d.lib(GL3GeometryBuffer.obj) : error LNK2001: unresolved external symbol __imp___glewVertexAttribPointer
12>CEGUIOpenGLRenderer-0_Static_d.lib(GL3GeometryBuffer.obj) : error LNK2001: unresolved external symbol __imp___glewBindVertexArray
12>CEGUIOpenGLRenderer-0_Static_d.lib(StateChangeWrapper.obj) : error LNK2001: unresolved external symbol __imp___glewBindVertexArray
12>CEGUIOpenGLRenderer-0_Static_d.lib(GL3GeometryBuffer.obj) : error LNK2001: unresolved external symbol __imp___glewDeleteVertexArrays
12>CEGUIOpenGLRenderer-0_Static_d.lib(GL3GeometryBuffer.obj) : error LNK2001: unresolved external symbol __imp___glewGenVertexArrays
12>CEGUIOpenGLRenderer-0_Static_d.lib(GL3FBOTextureTarget.obj) : error LNK2001: unresolved external symbol __imp___glewCheckFramebufferStatus

Are you actually getting your glew from vcpkg or something and not the repo?
Otherwise I have no idea how you manage to build this

-DCEGUI_BUILD_TOLUAPP=OFF
-DCEGUI_BUILD_XERCES=OFF
-DCEGUI_BUILD_ZLIB=OFF
-DCEGUI_BUILD_EXPAT=ON
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see #308

@devshgraphicsprogramming
Copy link
Collaborator

devshgraphicsprogramming commented May 29, 2019

I think I found the issue, you're including the dependencies like this

..\..\..\3rdparty\CEGUI\cegui\dependencies\lib\XXXXX

When in-fact they are

..\..\3rdparty\CEGUI\cegui-cegui-dependencies-0ecdf3a9e49b\build\dependencies\lib\static\XXXXX

@devshgraphicsprogramming
Copy link
Collaborator

Damn it, that's not it

@devshgraphicsprogramming
Copy link
Collaborator

This might be definitely it

if (CEGUI_BUILD_SHARED_LIBS_WITH_STATIC_DEPENDENCIES AND CEGUI_USE_GLEW)
    add_definitions( -DGLEW_STATIC )
endif()

sources:
nigels-com/glew#161
nigels-com/glew#88
https://stackoverflow.com/questions/22213558/unresolved-external-symbol-imp-glewinit-vs-imp-glewinit0

@devshgraphicsprogramming
Copy link
Collaborator

This might be definitely it

Now it works, CEGUI needs CEGUI_BUILD_SHARED_LIBS_WITH_STATIC_DEPENDENCIES = ON

@manhnt9
Copy link
Contributor Author

manhnt9 commented May 30, 2019

CEGUI_BUILD_SHARED_LIBS_WITH_STATIC_DEPENDENCIES
is not intended. It's for dynamic libs with static dependencies. That's why I needed to patch CEGUI for static libs + static dependencies. Mine works without that option, I'm not able to dig into your case soon but in general that fix is discouraged.

@devshgraphicsprogramming
Copy link
Collaborator

It's for dynamic libs with static dependencies.

Seems not, also the only thing it seems to control is whether to define GLEW_STATIC

Mine works without that option

No idea how thats possible, maybe you're actually loading glew from a system installed dll.
GLEW_STATIC must be defined when compiling anything that used glew headers for a static glew to work.

@devshgraphicsprogramming
Copy link
Collaborator

Also funny story CEGUI_BUILD_SHARED_LIBS_WITH_STATIC_DEPENDENCIES does not show on the Linux CMake-GUI config screen ;)

@devshgraphicsprogramming devshgraphicsprogramming merged commit f3f6886 into buildaworldnet:sRGB Jun 1, 2019
@devshgraphicsprogramming
Copy link
Collaborator

Tested on Windows and Linux.

Merged as its 99% complete, further work should be done on a new PR (the helper refactoring etc.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants