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

John Drescher drescherjm at gmail.com
Fri Nov 6 21:12:40 EST 2009


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