5

求教,cmake找不到库,帮帮忙,感激

1.cmake老是提示找不到boost库图片说明
2.我增加了link_directories(F:/Proj/20150519/superviseddescent-master/superviseddescent-master/boost_1_54_0/lib64-msvc-10.0)还是没有用
3.cmakelist.text 主

 project(superviseddescent)
cmake_minimum_required(VERSION 2.8.7)
set(superviseddescent_VERSION_MAJOR 0)
set(superviseddescent_VERSION_MINOR 3)
set(superviseddescent_VERSION_PATCH 0)
set (BOOST_ROOT,"F:/Proj/20150519/superviseddescent-master/superviseddescent-master/boost_1_54_0")
set(Boost_LIBRARIES,"F:/Proj/20150519/superviseddescent-master/superviseddescent-master/boost_1_54_0/lib64-msvc-10.0")
message(STATUS "BOOST_ROOT: ${BOOST_ROOT}")
# g++ needs a compiler flag to enable C++11 support
include(CheckCXXCompilerFlag)
check_cxx_compiler_flag(-std=c++11 HAS_CXX11_FLAG)
if (HAS_CXX11_FLAG)
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
endif()

# All the options for building the library. Can be changed on the command-line or in initial_cache.cmake.
message(STATUS "Options:")
option(BUILD_TESTS "Builds the unit tests." ON)
message(STATUS "BUILD_TESTS: ${BUILD_TESTS}")
option(BUILD_EXAMPLES "Build the example applications." ON)
message(STATUS "BUILD_EXAMPLES: ${BUILD_EXAMPLES}")
option(BUILD_DOCUMENTATION "Build the library documentation." ON)
message(STATUS "BUILD_DOCUMENTATION: ${BUILD_DOCUMENTATION}")

# Build a CPack driven installer package:
include(InstallRequiredSystemLibraries) # This module will include any runtime libraries that are needed by the project for the current platform
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
set(CPACK_PACKAGE_VERSION_MAJOR "${superviseddescent_VERSION_MAJOR}")
set(CPACK_PACKAGE_VERSION_MINOR "${superviseddescent_VERSION_MINOR}")
set(CPACK_PACKAGE_VERSION_PATCH "${superviseddescent_VERSION_PATCH}")
include(CPack)
#set(Boost_USE_STATIC_LIBS OFF)

# Find dependencies:
find_package(OpenCV 2.4.3 REQUIRED core)
message(STATUS "OpenCV include dir found at ${OpenCV_INCLUDE_DIRS}")
message(STATUS "xxxxxxBoost found at ${Boost_INCLUDE_DIRS}")
message(STATUS "OpenCV lib dir found at ${OpenCV_LIB_DIR}")

link_directories(F:/Proj/20150519/superviseddescent-master/superviseddescent-master/boost_1_54_0/lib64-msvc-10.0)
link_directories(F:/Proj/20150519/superviseddescent-master/superviseddescent-master/boost_1_54_02/bin/vc10/lib)
find_package(Boost 1.48.0 COMPONENTS system serialization REQUIRED)
if(Boost_FOUND)
  #message(STATUS "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa ${Boost_INCLUDE_DIRS}/bin/vc10/lib")
 message(STATUS "Boost found at ${Boost_INCLUDE_DIRS}")
else(Boost_FOUND)
  message(FATAL_ERROR "Boost not found")
endif()
message(STATUS "xxxxxxxxxxxxxxxxxxxxxxxx   ${Boost_LIBRARIES}")
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
find_package(Eigen3 REQUIRED)
message(STATUS "Eigen3 found: ${EIGEN3_FOUND}")
message(STATUS "Eigen3 include dir found at ${EIGEN3_INCLUDE_DIR}")
message(STATUS "Eigen3 version: ${EIGEN3_VERSION}")

# Source and header files
set(HEADERS
    include/superviseddescent/superviseddescent.hpp
    include/superviseddescent/regressors.hpp
    include/superviseddescent/matserialisation.hpp
    include/superviseddescent/utils/ThreadPool.h
)

# Add header includes:
include_directories("include")
include_directories(${Boost_INCLUDE_DIRS})
include_directories(${OpenCV_INCLUDE_DIRS})
include_directories(${EIGEN3_INCLUDE_DIR})

# The install target:
install(DIRECTORY ${CMAKE_SOURCE_DIR}/include/ DESTINATION include)


if(BUILD_TESTS)
    message(STATUS "Configuring gtest-1.7.0...")
    set(gtest_force_shared_crt ON CACHE BOOL "Use shared (DLL) run-time lib (CRT) even when Google Test is built as static lib.") # THIS IS NEWEST
    add_subdirectory(3rdparty/gtest-1.7.0)
    message(STATUS "Finished configuring gtest.")
    enable_testing() # Enables CTest
    add_custom_target(check-dbg COMMAND ${CMAKE_CTEST_COMMAND} -V -C Debug) # to get detailed output on VS
    add_custom_target(check-rel COMMAND ${CMAKE_CTEST_COMMAND} -V -C Release)
    add_subdirectory(test)
endif()

if(BUILD_EXAMPLES)
    add_subdirectory(examples)
endif()

if(BUILD_DOCUMENTATION)
    add_subdirectory(doc)
endif()

cmakelist.text 子文件夹

 # Unit tests
# ==========
# Note: All the variables in here are inherited from the parent CMakeLists
find_package(OpenCV 2.4.3 REQUIRED core)
message(STATUS "OpenCV include dir found at ${OpenCV_INCLUDE_DIRS}")
message(STATUS "OpenCV lib dir found at ${OpenCV_LIB_DIR}")
message(STATUS "OpenCV lib dir aaaaaat ${OpenCV_LIB_DIR}")

include_directories(${gtest_SOURCE_DIR}/include)

set(TEST_LINREG1D test_LinearRegressor1D)
add_executable(${TEST_LINREG1D} test_LinearRegressor1D.cpp)
#link_directories(${BOOST_ROOT}/bin/vc10/lib)
target_link_libraries(${TEST_LINREG1D} ${OpenCV_LIBS} ${Boost_LIBRARIES} gtest_main gtest)

add_test(${TEST_LINREG1D} ${TEST_LINREG1D}) # Syntax: testname exename

set(TEST_LINREGND test_LinearRegressorND)
add_executable(${TEST_LINREGND} test_LinearRegressorND.cpp)
target_link_libraries(${TEST_LINREGND} ${OpenCV_LIBS} ${Boost_LIBRARIES} gtest_main gtest)
add_test(${TEST_LINREGND} ${TEST_LINREGND})

set(TEST_SDO test_SupervisedDescentOptimiser)
add_executable(${TEST_SDO} test_SupervisedDescentOptimiser.cpp)
target_link_libraries(${TEST_SDO} ${OpenCV_LIBS} ${Boost_LIBRARIES} gtest_main gtest)
add_test(${TEST_SDO} ${TEST_SDO})

4.目录如下图片说明
5.boost目录图片说明
6.boost库图片说明

查看全部
cheatingdeath
cheatingdeath
2015/05/20 00:50
  • cmake
  • 点赞
  • 收藏
  • 回答
    私信

8个回复