Categories: boostC++

CMake could not find boost

Create a new CMakeFiles.txt below in a new folder.

cmake_minimum_required(VERSION 3.7)

set(Boost_DEBUG 1)
set(Boost_DETAILED_FAILURE_MSG 1)

set(Boost_INCLUDE_DIR Y:/L/boost_1_53_0)
set(Boost_LIBRARY_DIR Y:/L/boost_1_53_0/lib)


set(Boost_USE_STATIC_LIBS        ON)
set(Boost_USE_MULTITHREADED      ON)

find_package(Boost 1.53 REQUIRED COMPONENTS
              date_time filesystem iostreams)

include_directories(${Boost_INCLUDE_DIR})
link_directories(${Boost_LIBRARY_DIR})

Adjust Boost_INCLUDE_DIR and Boost_LIBRARY_DIR to your environment and try to switch ON and OFF for Boost_USE_STATIC_LIBS and Boost_USE_MULTITHREADED.

admin

View Comments

Recent Posts

Obtain global IP in bash

In current Internet environment, every PC is assigned a private IP. If global IP is…

3 years ago

Create log file in the directory of the script in Python

__file__ is the script file itself. From python3.9 above, it is an absolute path, otherwise…

3 years ago

RichTextBox’s font changes automatically in C#

You need to clear these two flags IMF_DUALFONT and IMF_AUTOFONT to keep font unchanged.

3 years ago

Test post to check image URL

This is an image inserted by wordpress 'Add Media'

3 years ago

msbuild says ‘target does not exist’

I don't know what is going wrong but... How to fix it Open the solution…

3 years ago

Creating a break point that hits on calling win32 api

Create a break point that hits when CreateProcess was called Enter a Function Breakpoint Enter…

4 years ago