花几分钟快速过一下,基本就可以动手了。结合网上的代码片段,我终于写出了自己的第一个Cmake脚本——可以把Qt和VTK结合起来,同时也展示了如何使用Cmake引入第三方库。脚本贴在这里供大家参考:# This script help you to generate a project which combines VTK and Qt
# Author: Wei Wang
# Date: 2012/2/18
cmake_minimum_required(VERSION 2.8)
PROJECT(LayoutProto)
FIND_PACKAGE(VTK)
INCLUDE(${VTK_USE_FILE}) # include UseVTK.cmake
FIND_PACKAGE(Qt4 REQUIRED)
INCLUDE(${QT_USE_FILE}) # include UseQt4.cmake
# support for out-of-source build
INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_BINARY_DIR} #this is where ui_SimpleViewUI.h is generated