Project

General

Profile

CMake errors when building the Wt examples...

Added by Barca Roller about 4 years ago

I am trying to build the Wt examples but I'm not getting far.

When I run the following commands:

cmd> cp -f -r /usr/lib64/Wt /tmp

cmd> cd /tmp/Wt/examples

cmd> mkdir build

cmd> cd build

cmd> cmake ..

I get the following errors:

--- Not building blog example: requires boost headers.

--- Not building charts example: requires boost headers.

--- Not building chart3D example: requires boost headers.

--- Not building codingview example: requires a multi-threaded build.

--- Not building composer example: requires boost headers.

--- Not building broadcast feature example: requires a multi-threaded build.

--- Not building timezone example: requires boost headers.

--- Not building oidc example: requires boost headers.

--- Not building serverpush feature example: requires a multi-threaded build.

--- Not building socketnotifier feature example: requires a multi-threaded build.

--- Not building template-fun example: requires boost headers.

--- hello-widget set example requires the built-in http... Skipping.

--- Not building filetreetable example: requires boost_filesystem library.

--- Not building gitmodel example: requires boost_filesystem library.

--- Looking for crypt

CMake Error at /usr/share/cmake/Modules/CheckFunctionExists.cmake:87 (message):

CHECK_FUNCTION_EXISTS needs either C or CXX language enabled

Call Stack (most recent call first):

hangman/CMakeLists.txt:18 (CHECK_FUNCTION_EXISTS)

I do have boost and boost-devel installed, and in fact I use boost with my Qt applications (also using cmake) on the same system.

I was able to successfully build and run the Wt "Hello World" example as described in their "Introduction to Wt" page.

Does anyone know why cmake is not finding the boost headers/libraries?

Using Wt 4.2.2 with cmake 3.16.4 and gcc/g 9.2.1 and boost 1.69, on 64-bit Fedora 31


Replies (3)

RE: CMake errors when building the Wt examples... - Added by Roel Standaert about 4 years ago

Ah, yeah, the CMakeLists.txt in the examples directory only works as standalone when used on Windows. So if you want to actually build the examples on Linux you have to build the examples from the Wt source tree, or roll your own CMakeLists.txt. Making that CMakeLists.txt in the examples directory standalone on non-Windows is something that probably should be considered, if make install actually installs it.

So the CMakeLists.txt that you get on Fedora when you install wt-examples is mostly useless.

RE: CMake errors when building the Wt examples... - Added by Barca Roller about 4 years ago

Thanks; that worked. I pulled the entire Wt source code, rebuilt it ('cmake .. && make'), and noticed that the examples were not build. So I went into the examples directory, where cmake had already generated all the makefiles, and ran 'make' again. I will not run 'make install' because I do not want to disturb my existing Wt installation (via 'dnf install wt').

RE: CMake errors when building the Wt examples... - Added by Roel Standaert about 4 years ago

Yeah, if you just want to check out the examples a make install isn't necessary. I do usually do a make install when I'm building Wt from source, but I configure my install directory to be elsewhere with -DCMAKE_INSTALL_PREFIX. this also means you don't need root to do make install.

    (1-3/3)