[CMake] Cmake error when adding Boost library

Parag Chandra parag at ionicsecurity.com
Fri Feb 20 12:20:02 EST 2015


Hi Daniel,

I had some trouble with this myself a while back. You may want to refer to the Boost module documentation for some help:

http://www.cmake.org/cmake/help/v3.1/module/FindBoost.html

There are some additional flags you can set which will help CMake locate Boost for you; I'm sorry I don't remember exactly which ones I set to locate it on Windows. In the end though, I needed to locate boost for many operating systems, so I compiled boost with system layout into individual configuration/architecture/operating system subdirectories, and then using the generic 'find_library' command.


Parag Chandra
Software Engineer, Mobile Team
Mobile: +1.919.824.1410

[https://www.ionicsecurity.com/IonicSigHz.png]<https://ionic.com>

Ionic Security Inc.
1170 Peachtree St. NE STE 400, Atlanta, GA 30309











From: Daniel Sáez <danst.18 at gmail.com<mailto:danst.18 at gmail.com>>
Date: Friday, February 20, 2015 at 11:31 AM
To: "cmake at cmake.org<mailto:cmake at cmake.org>" <cmake at cmake.org<mailto:cmake at cmake.org>>
Subject: [CMake] Cmake error when adding Boost library


Hello,

I am trying to add Boost library to my project using the CMakeLists.txt in the follwing way:

set(BOOST_INCLUDEDIR "C:/boost_1_57_0")set(BOOST_LIBRARYDIR "C:/boost_1_57_0/stage/lib")

find_package(Boost 1.57.0 COMPONENTS filesystem)
include_directories(${Boost_INCLUDE_DIRS})
add_executable(test test.cpp)
target_link_libraries(test ${Boost_LIBRARIES})

However, I get the followng error: LINK : fatal error LNK1104: cannot open file 'libboost_filesystem-vc120-mt-1_57.lib'

libboost_filesystem-vc120-mt-1_57.lib is located in the stage/lib folder, so I don't know what is going on. I am compiling with Visual Studio 2013.

Any thoughts?

Thank you,

Daniel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20150220/75323f0f/attachment-0001.html>


More information about the CMake mailing list