Support #4755

Problem with CMake find the correct libraries when cross compiling Wt

Added by Brad Millman almost 7 years ago. Updated almost 7 years ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:


Hi everyone. I am new to Wt. I have had some CMake experiece in the past, but have learned a lot in the past couple of days.

My project is to cross compile and use Wt on an ARM processor with a 'custom' Linux OS. I have cross compiled Boost and installed it in a 'non-standard' location, so it does not interfere with the 'native' boost installation.

While running CMake I use the CMAKE_TOOLCHAIN_FILE variable (on the command line) to set up the cross compiler.

In that file I set WT_BOOST_DISCOVERY to FALSE, BOOST_VERSION to 1_53 and BOOST_DIR to my custom installed boost library (/home/...blah..blah..blah/Boost/install).

When I run CMAKE I get:

--- Looking for pthread_create in pthread - found

--- Found Threads: TRUE

CMake Error at CMakeLists.txt:333 (MESSAGE):

Could not find a boost installation in


One question is the CMake variable BOOST_PREFIX does not seem to do anything. How does it differ from BOOST_DIR. (When I set BOOST_PREFIX, the error message tells me it can't find the libary in the host's normal libary path.) A second question is the format of the BOOST_VERSION CMake variable. The help message says 1_53, but looking at the CMake file supplied with Wt, I get the impression that it might really want 1.53 (or should I use 1_53_0 or 1.52.0?)

Also, given that I am using the arm-xilinx-linux-gnueabi compiler, is that the correct value for BOOST_COMPILER?

I have put some CMake 'message' commands in the various Wt CMake files and believe that even my WT_BOOST_DISCOVERY doesn't seem to be working properly as the WtFindBoost-vintage.txt file seems to be included in the CMake, not the WtFindBoost-cmake.txt.

Could somebody give me some suggestions about getting this straightened out.

BTW, I can build Wt for the native _x86 Linux host machine; it just does not work for cross compiling


Updated by Wim Dumon almost 7 years ago

Hey Brad,

Note that the installation notes of some of the more exotic platforms on the wiki may contain information that is applicable to your build. The method to build for the raspbery pi may be of interest to you.

It's important to know that Wt has two mechanisms to look for boot: the default CMake method and one that we used before boost was included in cmake. See WtFindBoost.txt.

cmake's boost finding method should work out of the box, but Wt's method is a bit more configuable. Depending on what flags you set, one of both methods will be chosen (I believe this explanation is printed when boost has not been found).

Also available in: Atom PDF