Clion Upgrade on windows 7

I need a simple example of how to enable boost libraries / headers with CMake in the Clion IDE under Windows 7. I
need this for C ++ 11.
Boost libs and headers are set in user directories.
I installed cygwin x64 for the compiler.

some solution:
i just included forward headers with cygdrive format

include_directories("/cygdrive/e/Libs/BoostLibs/include/boost-1_57")

But still don't understand where Clion gets lib files from.

The best solution is
to install var, BOOST_ROOT
so I did (and used more variables):

set(BOOST_ROOT "/cygdrive/e/Libs/BoostLibs/include/boost-1_57")

then you can find it and turn it on

FIND_PACKAGE(Boost REQUIRED)
IF (Boost_FOUND)
    INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR})
    ADD_DEFINITIONS( "-DHAS_BOOST" )
ENDIF()
+4
source share
3 answers

JetBrains CLion EAP ( 140.1740.3) Boost framework v1.57.0. , "CMakeLists.txt" ( CLion).

set(BOOST_ROOT "C:\boost_1_57_0")
set(BOOSTROOT "C:\boost_1_57_0")

find_package(Boost 1.57.0)

if(NOT Boost_FOUND)
    message(FATAL_ERROR "Could not find boost!")
endif()
+3

, CLion . CMake .

, :

set(Boost_Path "e:/Libs/BoostLibs/include")
set(Boost_INCLUDE_DIR "${Boost_Path}/boost_1_57_0")
find_package(Boost 1.57.0)

, , , :

message("Boost_INCLUDE_DIR: " ${Boost_INCLUDE_DIR })

if(Boost_FOUND)
    message(STATUS "It works!")
    include_directories(${Boost_INCLUDE_DIRS})
endif()

, Boost_INCLUDE_DIR, , Boost, .

, .

+1

CLion, IMO Visual Studio 2013 Community Edition Windows. Windows Windows Unix Unix. , , .

-2

Source: https://habr.com/ru/post/1570730/


All Articles