我已经尝试了几种方法并在SO上阅读了一些相关的问题,但仍然无法在/ usr / include中包含之前获得自己的提升。
我正在使用Ubuntu 14.04 btw。
BOOST_ROOT="${CMAKE_CURRENT_SOURCE_DIR}/Libraries/hdm-boost-lib" \
BOOST_INCLUDE_DIRS="${CMAKE_CURRENT_SOURCE_DIR}/Libraries/hdm-boost-lib/include" \
Boost_NO_BOOST_CMAKE=TRUE \
Boost_NO_SYSTEM_PATHS=TRUE \
Boost_LIBRARY_DIRS="${CMAKE_CURRENT_SOURCE_DIR}/Libraries/hdm-boost-lib/lib" \
cmake -D CMAKE_BUILD_TYPE=Release \
-DBoost_NO_BOOST_CMAKE=TRUE \
-DBoost_NO_SYSTEM_PATHS=TRUE \
-DBoost_LIBRARY_DIRS:FILEPATH="${CMAKE_CURRENT_SOURCE_DIR}/Libraries/hdm-boost-lib/lib" \
.
这是我的CMakeLists.txt
# set (CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_FLAGS "-O2 -std=c++11 -Wall ${CMAKE_CXX_FLAGS}")
set (CMAKE_PREFIX_PATH "/opt/hdm")
set( serializer_SRC
main.cpp Serializer.cpp
)
add_executable(cadmiral-serializer ${serializer_SRC})
set(BOOST_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/../Libraries/hdm-boost-lib")
set(BOOST_INCLUDE_DIRS "${BOOST_ROOT}/include")
set(BOOST_LIBRARY_DIRS "${BOOST_ROOT}/lib")
#find_package(Boost REQUIRED regex date_time system filesystem thread graph program_options)
#find_package(geos)
#find_package(gdal)
include_directories(
"${CMAKE_CURRENT_SOURCE_DIR}/../Libraries/hdm-geo-common/hdm-geo-common/include"
"${BOOST_INCLUDE_DIRS}"
"${CMAKE_CURRENT_SOURCE_DIR}/../Libraries/hdm-geo-common/hdm-geo-common/include"
/opt/hdm/include
"${CMAKE_CURRENT_SOURCE_DIR}/../Libraries/hdm-boost-lib/include"
)
#find_library(GDAL_LIB libgdal /opt/hdm/gdal/lib)
#find_library(GEOS_LIB libgeos /opt/hdm/geos/lib)
target_link_libraries(cadmiral-serializer
"${CMAKE_CURRENT_SOURCE_DIR}/../Libraries/hdm-geo-common/hdm-geo-common/libhdm_geo_common.a"
/opt/hdm/geos/lib/libgeos.so
/opt/hdm/gdal/lib/libgdal.so
#${GEOS_LIB}
#${GDAL_LIB}
)
如何在Libraries / hdm-boost-lib / include中强制使用自己的标题?