首页 > 其他分享 >在CLion中如何为CMakeLists.txt文件添加第三方依赖库

在CLion中如何为CMakeLists.txt文件添加第三方依赖库

时间:2023-03-02 21:44:07浏览次数:63  
标签:CMakeLists 3rdParty INCLUDE subdirectory add set txt CLion DIR

cmake_minimum_required(VERSION 3.5)
project(ImageBasedModellingEdu)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/" ${CMAKE_MODULE_PATH})
set(EIGEN_INCLUDE_DIR "C:/ImageBasedModellingEdu/3rdParty/Eigen/include")

set(ZLIB_INCLUDE_DIR "C:/3rdParty/OpenCV2.4.4/3rdparty/zlib")
set(ZLIB_LIBRARY "C:/3rdParty/OpenCV2.4.4/build/x64/vc11/staticlib/zlib.lib")

set(PNG_PNG_INCLUDE_DIR "C:/3rdParty/OpenCV2.4.4/3rdparty/libpng")
set(PNG_LIBRARY "C:/3rdParty/OpenCV2.4.4/build/x64/vc11/staticlib/libpng.lib")

set(JPEG_INCLUDE_DIR "C:/3rdParty/OpenCV2.4.4/3rdparty/libjpeg")
set(JPEG_LIBRARY "C:/3rdParty/OpenCV2.4.4/build/x64/vc11/staticlib/libjpeg.lib")

set(TIFF_INCLUDE_DIR "C:/3rdParty/OpenCV2.4.4/3rdparty/libtiff")
set(TIFF_LIBRARY "C:/3rdParty/OpenCV2.4.4/build/x64/vc11/staticlib/libtiff.lib")


# Eigen (required)
find_package(Eigen REQUIRED)
include_directories(${EIGEN_INCLUDE_DIR})
add_definitions(-DEIGEN_USE_NEW_STDVECTOR -DEIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET)

include_directories(${ZLIB_INCLUDE_DIR})
# add_library(zlib ${ZLIB_LIBRARY})

include_directories(${PNG_PNG_INCLUDE_DIR})
# add_library(png ${PNG_LIBRARY})

include_directories(${JPEG_INCLUDE_DIR})
# add_library(jpeg ${JPEG_LIBRARY})

include_directories(${TIFF_INCLUDE_DIR})
# add_library(tiff ${TIFF_LIBRARY})

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_FLAGS "-fPIC")

add_subdirectory(core)
add_subdirectory(util)
add_subdirectory(features)
add_subdirectory(math)
add_subdirectory(sfm)
add_subdirectory(mvs)
add_subdirectory(examples)
add_subdirectory(surface)
add_subdirectory(texturing)
add_subdirectory(3rdParty/mrf)
add_subdirectory(3rdParty/coldet)
add_subdirectory(3rdParty/gco)
#add_subdirectory(3rdParty/rayint)
#add_subdirectory(3rdParty/eigen)
#add_subdirectory(3rdParty/mapmap)

标签:CMakeLists,3rdParty,INCLUDE,subdirectory,add,set,txt,CLion,DIR
From: https://www.cnblogs.com/rainbow70626/p/17173663.html

相关文章