[CMake] Boost Link errors in CMAKE

Ravi Tej Kavalipati ravi.kavalipati at gmail.com
Mon Jun 23 16:34:05 EDT 2008


Hi,
i have done it.. but still am getting the same errors.
i have also done in an alternative way
_______________________________________________________________
# alternative way
set (BOOST_ROOT /usr/local)
set (BOOST_LIBRARYDIR /usr/local/lib)
set (BOOST_INCLUDEDIR /usr/local/include)

find_package(Boost 1.35.0 COMPONENTS date_time filesystem graph regex
serialization thread system signals)

# with this im getting a different set of errors

________________________________________________________
# initial version
find_package(Boost 1.35.0 REQUIRED)

 INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR})
#INCLUDE_DIRECTORIES(${Boost_LIBRARY_DIRS})

# We need to include the hpx directory for includes
include_directories (${hpx_SOURCE_DIR})
include_directories (${hpx_SOURCE_DIR}/external/coroutine)
include_directories (${hpx_SOURCE_DIR}/external/exception)
include_directories (${hpx_SOURCE_DIR}/external/endian)
include_directories (${hpx_SOURCE_DIR}/external/logging)
include_directories (${hpx_SOURCE_DIR}/external/singleton)

target_link_libraries( hpx ${Boost_system_LIBRARY})
target_link_libraries( hpx ${Boost_signals_LIBRARY})
target_link_libraries( hpx ${Boost_thread_LIBRARY})
target_link_libraries( hpx ${Boost_serialization_LIBRARY})
target_link_libraries( hpx ${Boost_iostreams_LIBRARY})
target_link_libraries( hpx ${Boost_date_time_LIBRARY})

if(WIN32)
    add_definitions(-D_WIN32_WINNT=0x0501)
    add_definitions(-D_SCL_SECURE_NO_WARNINGS)
    add_definitions(-D_CRT_SECURE_NO_WARNINGS)
    add_definitions(-D_SCL_SECURE_NO_DEPRECATE)
    add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
endif(WIN32)

# Recurse into the "src" and "test" subdirectories.  This does not actually
# cause another cmake executable to run.  The same process will walk through
# the project's entire directory structure.
add_subdirectory (src)
add_subdirectory (examples)
add_subdirectory (runtime)
________________________________________________________________


On Mon, Jun 23, 2008 at 12:33 PM, Andreas Pakulat <apaku at gmx.de> wrote:

> On 23.06.08 12:25:38, Ravi Tej Kavalipati wrote:
> > I am using the Cmake to link the boost libraries to my project HPX, But
> im
> > getting various link errors in the process.
> > can anyone please let me know if I am misrepresenting anything.
> >
> ___________________________________________________________________________
> > #CMakeLists.txt
> > # Distributed under the Boost Software License, Version 1.0. (See
> > accompanying
> > # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
> >
> > # We require at least CMake V2.6
> > cmake_minimum_required(VERSION 2.6)
> >
> > # The name of our project is "hpx".  CMakeLists files in this project can
> > # refer to the root source directory of the project as ${hpx_SOURCE_DIR}
> and
> > # to the root binary directory of the project as ${hpx_BINARY_DIR}.
> > project (hpx)
> >
> > # We need to use Boost
> > find_package(Boost 1.35.0 COMPONENTS system filesystem threads signals
> > archive )
>
> Are you using target_link_libraries with your target and the variables
> set by FindBoost.cmake? Just having
>
> > LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
>
> This won't magically link yout executables against the needed boost
> libs.
>
> Andreas
>
> --
> You will be audited by the Internal Revenue Service.
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20080623/ebaeca10/attachment-0001.htm>


More information about the CMake mailing list