CefClient as basis for custom project

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

CefClient as basis for custom project

Postby zakalwe » Thu Jan 23, 2020 4:01 pm

I'm using cef_binary_79.1.31+gfc9ef34+chromium-79.0.3945.117

I have followed instructions from CEF_ROOT/CMakeLists.txt Example 2 (line 139) and Example 3 (line 158), although I'm not sure what the differences are.

When I copied over cefclient into a new myproject directory I got it to build, however I realized that it is still referencing all the include paths from CEF_ROOT/tests/cefclient and shared, etc. For example. tests/cefclient/browser/browser_window.cc line 5:
#include "tests/cefclient/browser/browser_window.h"

What is the recommended way of adjusting include paths such that I pick up the framework headers from CEF_ROOT/include but not CEF_ROOT/tests ? I could do this manually in the generated project settings (I'm on MacOs and Linux) but it seems better to use cmake for this. Ultimately I would still go an edit all the sources to remove 'tests' from the include paths.

I'm going for maximum automation and repeatability, anticipating a day in the future when I will need to upgrade my version of cef so I don't want to deviate too much from recommended project structure.

Thanks,
Z
zakalwe
Newbie
 
Posts: 7
Joined: Thu Jan 23, 2020 3:49 pm

Re: CefClient as basis for custom project

Postby magreenblatt » Thu Jan 23, 2020 11:40 pm

CMake can’t rewrite the #include lines so, unless you plan to keep the tests/cefclient directory structure, you will need to rewrite them manually (or via search/replace). Paths can be relative to the directory containing the CMakeLists.txt file or you can explicitly add a path using include_directories.
magreenblatt
Site Admin
 
Posts: 12408
Joined: Fri May 29, 2009 6:57 pm

Re: CefClient as basis for custom project

Postby zakalwe » Fri Jan 24, 2020 2:53 pm

Thanks.
I was able to add an additional include path and rebuild the cefclient, but as you said, it does require rewriting all of the include statements. The tricky bit is that one still wants to have an include path for cef core framework headers but not anything in tests.
zakalwe
Newbie
 
Posts: 7
Joined: Thu Jan 23, 2020 3:49 pm


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 50 guests