我正在使用CGAL构建一个C++程序,并且我正在编写CMake安装规则来部署所述程序,这样我就可以CPack结果,最终用户不必安装CGAL或它的任何依赖项即可使用它。为了做到这一点,我需要包含每个共享库( Windows上的DLL),但是我找不到一个允许我这样做的CMake变量。我在CGAL仓库里找过了,但没找到。我试过使用${CGAL_LIBRARIES},但它们不提供路径,而且看起来${CGAL_LIBRARIES_DIRS}不是一种东西。
我当前的CMakeLists是基于专用CGAL脚本生成的:
# 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)发布于 2019-06-13 21:58:08
“修复”这个问题的最简单方法是使用CGAL作为唯一的头文件。请检查说明书。这是the direct link to the installation manual of CGAL-4.14, section "Header-only with CMake Configuration".
https://stackoverflow.com/questions/56545699
复制相似问题