c++ - Cmake cannot find boost library -
i'm on mac os x, following cmake file, , boost v1.58.0 installed @ /usr/local/lib/boost_1_58_0, , every time run cmake prints "could not find boost". i've read through every stack overflow post can how working, , nothing has worked. there i'm missing?
cmake_minimum_required (version 3.1) project (helloworld) set (cmake_cxx_flags "--std=gnu++11 ${cmake_c_flags}") file (glob source_files "source/*.cpp") set (cmake_include_path ${cmake_include_path} /usr/local/lib/boost_1_58_0/boost) set (cmake_library_path ${cmake_library_path} /usr/local/lib/boost_1_58_0/stage/lib) set (boost_no_boost_cmake on) set (boost_no_system_paths on) set (boost_root /usr/local/lib/boost_1_58_0) set (boost_includedir /usr/local/lib/boost_1_58_0/boost) set (boost_librarydir /usr/local/lib/boost_1_58_0/stage/lib) set (boost_use_static_libs off) set (boost_use_multithreaded on) set (boost_use_static_runtime off) find_package (boost 1.58.0 components optional) if (boost_found) include_directories (${boost_include_dirs}) target_link_libraries (helloworld ${boost_libraries}) endif () include_directories ("source") add_executable (helloworld ${source_files})
this breaking because optional isn't library, it's header-only, changing find_package (boost 1.58.0)
fixed problem.
Comments
Post a Comment