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

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)

posted @ 2023-03-02 21:39  rainbow70626  阅读(646)  评论(0编辑  收藏  举报