c++boostcmakewt

Error on building a Wt project. Cannot open include file: 'boost/any.hpp'


Wt v. 3.2.2 and boost libraries v. 1.47 had succesfully installed in my computer and no errors occured in the installation process. Some simple Wt and Boost examples were compiled and ran correctly in the testing process. I use CMake, configured for MSVC 2008, to create the build files for my own Wt projects.

However, when I try to build my own project, I get this error (Cannot open include file: 'boost/any.hpp'). As I saw, boost/any.hpp is included in Wt/WApplication header file.

For further help, my CMakeLists.txt files contents are: CMakeLists.txt placed on project directory:

CMAKE_MINIMUM_REQUIRED(VERSION 2.8)

PROJECT(WT_EXAMPLE)

SET (WT_CONNECTOR "wthttp" CACHE STRING "Connector used (wthttp or wtfcgi)")

ADD_SUBDIRECTORY(source)

CMakeLists.txt placed on source directory:

CMAKE_MINIMUM_REQUIRED(VERSION 2.8)

SET(WT_INSTALL_DIR "C:/Program Files/WT/boost_1_47")
SET(BOOST_INSTALL_DIR "C:/Program Files/boost")

ADD_EXECUTABLE(
 GOP.wt
 Main.C
)

SET(WT_LIBS
 optimized wthttp debug wthttpd
 optimized wt debug wtd)

SET(BOOST_LIBS
 boost_signals boost_regex boost_thread boost_filesystem boost_system
 boost_random boost_date_time boost_program_options)

TARGET_LINK_LIBRARIES (
 GOP.wt
 ${WT_LIBS} ${BOOST_LIBS} ${SYSTEM_LIBS}
)

LINK_DIRECTORIES (
 ${WT_INSTALL_DIR}/lib/
 ${BOOST_INSTALL_DIR}/lib/
)

INCLUDE_DIRECTORIES(${WT_INSTALL_DIR}/include)
INCLUDE_DIRECTORIES(${BOOST_INSTALL_DIR}/include)

As I saw in the CMakeCache.txt placed on Wt build directory, paths to boost libraries were found, but ...what about this line?

//The directory containing a CMake configuration file for Boost.
Boost_DIR:PATH=Boost_DIR-NOTFOUND

I asked this question on Wt support forum but I didn't get an answer for about 24 hours...

Update: I found that any.hpp is placed on C:\Program Files\boost\boost_1_47\boost\spirit\home\support\algorithm\any.hpp. So, i suspect that there's a concept with the path that searches any.hpp (it's not directly included in boost directory).


Solution

  • Problem solved. I did a new Wt build, I placed and rebuild boost in a new path and I wrote CMakeLists for this project with more caution.