[CMake] Fwd: [Insight-users] Problem with CMakelist

John Drescher drescherjm at gmail.com
Sat Nov 7 10:03:23 EST 2009


---------- Forwarded message ----------
From: Wen Shi <wsa18 at sfu.ca>
Date: Sat, Nov 7, 2009 at 2:19 AM
Subject: Re: [Insight-users] Problem with CMakelist
To: John Drescher <drescherjm at gmail.com>


Hi john,
Thank you for your reply.
But actually I first used " INCLUDE(${VXL_USE_FILE})"
But when I use CMake to generate the project, there is a error saying
that "INCLUDE" can only take one argument.
So I used INCLUDE_DIRECTORIES(${VXL_USE_FILE}).
I don't know why it says that.

THanks again

Wen Shi
----- 原始邮件 -----
发件人: "John Drescher" <drescherjm at gmail.com>
收件人: "Wen Shi" <wsa18 at sfu.ca>
发送时间: 2009年 11 月 06日, 星期五 下午 6:12:26 GMT -08:00 美国/加拿大太平洋
主题: Re: [Insight-users] Problem with CMakelist

On Fri, Nov 6, 2009 at 8:01 PM, Wen Shi <wsa18 at sfu.ca> wrote:
> Hi Guys,
> I am new to CMake and have little experiences in writing CMakelist files.
> Currently I want to generate a project which calls VXL libraries.
> Below is my CMakelist file:
>
> CMAKE_MINIMUM_REQUIRED(VERSION 2.4)
> IF(COMMAND CMAKE_POLICY)
>  CMAKE_POLICY(SET CMP0003 NEW)
> ENDIF(COMMAND CMAKE_POLICY)
>
>
>
> PROJECT(Hello)
>
> FIND_PACKAGE(VXL REQUIRED)
> IF(VXL_FOUND)
>        INCLUDE_DIRECTORIES(${VXL_USE_FILE})
>
> ENDIF(VXL_FOUND)
>
> ADD_EXECUTABLE(Hello Hello.cpp)
>
> TARGET_LINK_LIBRARIES(Hello vbl vcsl vgl vgui vidl vidl1 vidl_vil1 vil vil1 vnl vpl vsl vul)
>
> My Hello.cpp is as follows:
> // Include standard C++ input/output library
> #include <vcl_iostream.h>
>
> // main is the first function to be called
> int main()
> {
>  // send string "hello world" to the standard
>  // output stream cout.
>  vcl_cout << "Hello world\n";
>
>  // Must return something from main
>  return 0;
> }
>
> I used CMake to generate the project files and there is no problems.
> But When try to run the project, I always receive the error:
> can't find the include file or directory 'vcl_iostream.h'.
> I am wondering if some of you can point out the errors.
> Thanks a lot
>

replace

 INCLUDE_DIRECTORIES(${VXL_USE_FILE})

with

 INCLUDE(${VXL_USE_FILE})

John



-- 
John M. Drescher


More information about the CMake mailing list