I have created a new project, per instructions in $CEF_ROOT/CMakeLists.txt, chose "Example 3" with having a CEF_ROOT environment variable pointing to a CEF binary distribution and copied the "cefclient" into the project as a starting point. At that point, everything builds fine, however then I tried adding new files "$PROJECT_ROOT/cefclient/common/pdf_print_callback.h" and "$PROJECT_ROOT/cefclient/common/pdf_print_callback.cc" (which contain CefPdfPrintCallback implementation) and including them in "$PROJECT_ROOT/cefclient/browser/root_window_mac.mm" (I'm testing this on Mac OS Sierra) like this:
- Code: Select all
#include "cefclient/common/pdf_print_callback.h"
... project build started failing with the message
fatal error: 'cefclient/common/pdf_print_callback.h' file not found
Adding paths to these files to CEFCLIENT_COMMON_COMMON_SRCS collection in $PROJECT_ROOT/cefclient/CMakeLists.txt did not help either, not even sure it is supposed to.
This is a bit weird because already existing files do not fail the build, I'm absolutely sure I'm missing something obvious. Does anyone have an idea what I'm doing wrong?
Also I'm not sure whether this is CMake- or CEF-related issue, I apologise if this has nothing to do with CEF.
I'm building the project (in my $PROJECT_ROOT/build directory) like this:
- Code: Select all
cmake -G "Ninja" -DPROJECT_ARCH="x86_64" -DCMAKE_BUILD_TYPE=Debug ..
ninja cefclient
I also tried using -G "XCode", however it also resulted in pdf_print_callback.h not being found.
For reference, complete contents of both files of mine below:
pdf_print_callback.h
- Code: Select all
#ifndef CEF_TESTS_CEFCLIENT_COMMON_PDF_PRINT_CALLBACK_H
#define CEF_TESTS_CEFCLIENT_COMMON_PDF_PRINT_CALLBACK_H
#pragma once
#include "include/cef_browser.h"
namespace client {
class PdfPrintCallback: public CefPdfPrintCallback {
public:
PdfPrintCallback();
virtual ~PdfPrintCallback();
void OnPdfPrintFinished(const CefString& path, bool ok) override;
private:
IMPLEMENT_REFCOUNTING(PdfPrintCallback);
};
} //namespace client
#endif /* CEF_TESTS_CEFCLIENT_COMMON_PDF_PRINT_CALLBACK_H */
pdf_print_callback.cc:
- Code: Select all
#include "cefclient/common/pdf_print_callback.h"
namespace client {
PdfPrintCallback::PdfPrintCallback() {
}
PdfPrintCallback::~PdfPrintCallback() {
}
void PdfPrintCallback::OnPdfPrintFinished(const CefString& path, bool ok) {
}
} //namespace client