首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >包含CGAL共享库以部署CGAL程序

包含CGAL共享库以部署CGAL程序
EN

Stack Overflow用户
提问于 2019-06-11 22:11:38
回答 1查看 110关注 0票数 0

我正在使用CGAL构建一个C++程序,并且我正在编写CMake安装规则来部署所述程序,这样我就可以CPack结果,最终用户不必安装CGAL或它的任何依赖项即可使用它。为了做到这一点,我需要包含每个共享库( Windows上的DLL),但是我找不到一个允许我这样做的CMake变量。我在CGAL仓库里找过了,但没找到。我试过使用${CGAL_LIBRARIES},但它们不提供路径,而且看起来${CGAL_LIBRARIES_DIRS}不是一种东西。

我当前的CMakeLists是基于专用CGAL脚本生成的:

代码语言:javascript
复制
# Created by the script cgal_create_CMakeLists
# This is the CMake script for compiling a set of CGAL applications.

project( MeshCleaner )

cmake_minimum_required(VERSION 2.8.11)

set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)

# CGAL and its components
find_package( CGAL QUIET COMPONENTS  )

if ( NOT CGAL_FOUND )

  message(STATUS "This project requires the CGAL library, and will not be compiled.")
  return()  

endif()


# Boost and its components
find_package( Boost REQUIRED )

if ( NOT Boost_FOUND )

  message(STATUS "This project requires the Boost library, and will not be compiled.")

  return()  

endif()

# include for local directory
include_directories( BEFORE include )

# include for local package


# Creating entries for target: meshCleaner
# ############################

add_executable( ${PROJECT_NAME}  main.cpp )

add_to_cached_list( CGAL_EXECUTABLE_TARGETS ${PROJECT_NAME} )

# Link the executable to CGAL and third-party libraries
target_link_libraries(${PROJECT_NAME}   ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES} )

install(TARGETS ${PROJECT_NAME} DESTINATION . COMPONENT Libraries)

message(${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES})

if(WIN32)
    set(CMAKE_INSTALL_OPENMP_LIBRARIES TRUE)
    include(InstallRequiredSystemLibraries)
endif()

include(${PROJECT_NAME}CPack)
EN

回答 1

Stack Overflow用户

发布于 2019-06-13 21:58:08

“修复”这个问题的最简单方法是使用CGAL作为唯一的头文件。请检查说明书。这是the direct link to the installation manual of CGAL-4.14, section "Header-only with CMake Configuration".

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56545699

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档