Open anko opened 6 years ago
nice to see you again : ) i'll have a look at this on monday morning and get back to you!
@anko: I get this error message if I use spotify "CEF source" instead of "Minimal Distribution" as /path/to/cef/release
.
as the readme says:
cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DCEF_ROOT=/path/to/cef/release /path/to/cef-pdf
ninja
/path/to/cef/release
is the extracted "Minimal Distribution", /path/to/cef-pdf
is the local path to the git repository.
Here an example command-line that worked for me:
cmake -G "Visual Studio 15 2017" -DCMAKE_BUILD_TYPE=Release -DCEF_ROOT="C:/Users/MyUser/Documents/Visual Studio 2017/CEF/cef_binary_3.3626.1895.g7001d56_windows32_minimal" "C:/Users/MyUser/Documents/Visual Studio 2017/Projects/cef-pdf"
Note: You need to use forward-slash as directory-separator on Windows, otherwise you get something like
Invalid escape sequence \U Invalid escape sequence \S
On Linux, you can use
cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DCEF_ROOT=/path/to/cef/release /path/to/cef-pdf
ninja
and actually, you don't need "Ninja", you can just use plain old unix makefiles:
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCEF_ROOT=/home/username/Desktop/src/cef_binary_3.3626.1895.g7001d56_linux64_minimal /home/username/Desktop/src/cef-pdf
Cmake on Linux is a bit of a bitch. When you run cmake --version
, you might get
cmake: /usr/local/lib/libcurl.so.4: no version information available (required by cmake)
If you get that, you need to delete the symlink to libcurl.so.4, and create a new one
sudo rm /usr/local/lib/libcurl.so.4
sudo ln -s /usr/lib/x86_64-linux-gnu/libcurl.so.4.4.0 /usr/local/lib/libcurl.so.4
You might then get
CMake Error at CMakeLists.txt:49 (list): list does not recognize sub-command FILTER
Which is to be expected, as list(FILTER) was introduced in CMake 3.6, and if you have a cmake version < 3.6, such as 3.5.1 on ubuntu 16.04, then using filter can't work.
You then need to apt-get --purge cmake
, and subsequently install the latest version from cmake.org
wget https://cmake.org/files/v3.14/cmake-3.14.0-rc4-Linux-x86_64.sh
sudo sh cmake-3.14.0-rc4-Linux-x86_64.sh --prefix=/usr/local --exclude-subdir
Also, make might then treat warnings as erros.
So in the makefiles created by cmake, search for all files named flags.make, and remove -Werr, which treats warnings as errors (and because since some methods aren't being used, this creates a warning, and the with the -Werr
option on, warnings will cause the build to build to fail (-Werr: treat warnings as errors).
The way cmake works, is you open a command prompt in the directory where you want to build in.
Then you issue the cmake command, cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DCEF_ROOT=/path/to/cef/release /path/to/cef-pdf
, which generates the build files you need to compile the application. -G specifies the build target, can be Ninja, unix-makefiles, Visual-Studio solutions. Enter a bogus-name there, and cmake will list you the possible options for your machine.
You then use the makefiles or the Visual Studio solution to compile the project. Note: Visual Studio on a 64-Bit processor wants to link against the 32-Bit dlls BY DEFAULT, so use the CEF minimal distribution for Win32 when you create the visual-studio solution with cmake...
You also need to switch the build to "Release", because in "Debug", the build will fail because of missing CEF files.
Enjoy the sources updated for the latest version of Chromium per March 11, 2019 CET here: https://github.com/ststeiger/cef-pdf
I can recall having managed it in the past.
Following the current building instructions, I downloaded the correct CEF distribution files for my system,
cd
'd into a temp directory, then ran this command I constructed based on the instructions:It failed for me with this:
This is the first time I touch
cmake
, so I'm probably just dumb. What did I do wrong?Relatedly, could the build be adapted to only 1 step? It would help automate testing and packaging.