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

2009-11-07 Thread John Drescher
-- Forwarded message --
From: Wen Shi 
Date: Sat, Nov 7, 2009 at 2:19 AM
Subject: Re: [Insight-users] Problem with CMakelist
To: John Drescher 


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" 
收件人: "Wen Shi" 
发送时间: 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  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 
>
> // 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
___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

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

2009-11-07 Thread Bill Hoffman
John Drescher wrote:
> -- Forwarded message --
> From: Wen Shi 
> Date: Sat, Nov 7, 2009 at 2:19 AM
> Subject: Re: [Insight-users] Problem with CMakelist
> To: John Drescher 
> 
> 
> 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.
> 

Try: INCLUDE("${VXL_USE_FILE}")

It might be that you have a space in the path.

-Bill
___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake