CMake not finding Boost program_options building PokerStove on Windows 10

147 Views Asked by At

I'm currently working on a project that involves using PokerStove, and I'm trying to use CMake gui to build the PokerStove library (https://github.com/andrewprock/pokerstove) on my Windows 10 Home (Version 1809) machine. However, I'm encountering issues with CMake not finding the program_options component of Boost.

Here are the details of my setup:

CMake version: 3.27.6 Boost version: 1.83.0 Compiler: Microsoft Visual Studio 17 2022 Operating System: Windows 10 Home, Version 1809

CMakeLists.txt:


cmake_minimum_required(VERSION 3.5)

project(pokerstove)

# Set C++ standard to C++14
set(CMAKE_CXX_STANDARD 14)

# Remove the deprecated register keywords
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-register")

# Set up gtest
add_subdirectory(src/ext/googletest)
include_directories(${GTEST_INCLUDE_DIRS})
link_directories(${GTEST_LIBS_DIR})
add_definitions("-fPIC")
enable_testing()

# Set up Boost
find_package(Boost REQUIRED COMPONENTS program_options)
include_directories(${Boost_INCLUDE_DIRS})

# Set the Boost library directory
set(Boost_LIBRARY_DIRS "C:/Users/baumn/Downloads/boost_1_83_0/boost_1_83_0/stage/lib")

link_directories(${Boost_LIBRARY_DIRS})
message(STATUS "Boost Include: ${Boost_INCLUDE_DIRS}")
message(STATUS "Boost Library Dirs: ${Boost_LIBRARY_DIRS}")
message(STATUS "Boost Libraries: ${Boost_LIBRARIES}")

# Include PROJECT_BINARY_DIR for config.h
include_directories("${PROJECT_BINARY_DIR}")

# Set the output directory for executables
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

# add the actual code
add_subdirectory(src)

# Add make install functionality
install(TARGETS peval)
install(TARGETS penum)
install(TARGETS ps-colex)
install(TARGETS ps-eval)
install(TARGETS ps-lut)

When I run CMake to configure the project, I'm encountering the following error:

CMake Error at .../FindPackageHandleStandardArgs.cmake:230 (message): Could NOT find Boost (missing: program_options) (found version "1.83.0")

I have already tried the following:

Ensured that Boost is correctly installed on my system. - (I successfully compiled a simple c++ program that used Boost.Asio)

Checked the Boost library directory and verified that the program_options library exists. Set the BOOST_LIBRARYDIR variable in my CMakeLists.txt. I set the environment variable BOOST_ROOT to the directory where I installed boost

Can anyone provide guidance on how to fix this problem while building PokerStove using CMake on Windows 10?

Any help would be greatly appreciated!

0

There are 0 best solutions below