How to create a CMakeLists.txt for a project containing CGAL and VTK libraries

天大地大妈咪最大 提交于 2019-12-06 13:30:21

Basically what needs to happen is that you need to provide include directories and link libraries from both of your dependencies to your executable.

cmake_minimum_required(VERSION 2.8.4)

project( cgal_vtk_test )

# Find CGAL
find_package(CGAL REQUIRED COMPONENTS Core) # If the dependency is required, use REQUIRED option - if it's not found CMake will issue an error
include( ${CGAL_USE_FILE} )

# Find VTK
find_package(VTK REQUIRED)
include(${VTK_USE_FILE})


# Setup your executable
include_directories (BEFORE "../../include")
include_directories (BEFORE "include")

include( CGAL_CreateSingleSourceCGALProgram )
create_single_source_cgal_program( "cgal_vtk_test.cpp" ) # This will create an executable target with name 'cgal_vtk_test'

# Add VTK link libraries to your executable target
target_link_libraries(cgal_vtk_test ${VTK_LIBRARIES})
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!