Many thanks!

Hao



On Fri, Jul 19, 2013 at 12:13 PM, Wheeler, Frederick W (GE Global Research) <wheeler@ge.com> wrote:

 

That looks good.  There is good documentation for CMake on the CMake home page.

 

Fred

 

 

From: Hao Wu [mailto:haowu128@gmail.com]
Sent: Friday, July 19, 2013 1:07 PM


To: Wheeler, Frederick W (GE Global Research)
Cc: vxl-users@lists.sourceforge.net
Subject: Re: [Vxl-users] HelloWorld

 

Oh, I find a mistake I made after I built VXL. I changed the build folder name after building it. Now I have changed it to the original name and it works now. :)

 

I have one question, is the following steps correct when creating a CMakeLists.txt file?

1.  write the following lines in CMakeLists :

 

FIND_PACKAGE(VXL)

IF(VXL_FOUND)

  INCLUDE(${VXL_CMAKE_DIR}/UseVXL.cmake)

ENDIF(VXL_FOUND)

 

2. then ADD_EXECUTABLE and TARGET_LINK_LIBRARIES. 

 

Thanks so much!

Hao

 

 

 

 

 

On Fri, Jul 19, 2013 at 11:59 AM, Wheeler, Frederick W (GE Global Research) <wheeler@ge.com> wrote:

 

For problems like this you just need to read carefully and start debugging.  Does the file VXLLibraryDepends.cmake exist there?  Is it somewhere else?  Did VXL build OK for you?

 

 

 

From: Hao Wu [mailto:haowu128@gmail.com]
Sent: Friday, July 19, 2013 12:55 PM
To: Wheeler, Frederick W (GE Global Research)
Cc: vxl-users@lists.sourceforge.net
Subject: Re: [Vxl-users] HelloWorld

 

Thanks for responding! I add this line but CMake gives me the following errors when I configure it:

 

CMake Error at E:/VXL/VXL_BIN/VXLConfig.cmake:33 (INCLUDE):

include could not find load file:

E:/VXL/VXL_BIN2/VXLLibraryDepends.cmake

Call Stack (most recent call first):

CMakeLists.txt:4 (FIND_PACKAGE)

Configuring incomplete, errors occurred!

 

 

What does this mean? 

 

Best regards,

Hao Wu

 

 

On Fri, Jul 19, 2013 at 11:46 AM, Wheeler, Frederick W (GE Global Research) <wheeler@ge.com> wrote:

 

Have a look at section B.1.3 in the VXL book for examples of how to set up your CMakeLists.txt file.  You are missing this line:

 

FIND_PACKAGE(VXL)

 

http://public.kitware.com/vxl/doc/release/books/core/book_16.html#SEC196

 

Fred

 

From: Hao Wu [mailto:haowu128@gmail.com]
Sent: Friday, July 19, 2013 12:17 PM
To: vxl-users@lists.sourceforge.net
Subject: [Vxl-users] HelloWorld

 

Hi,

 

I am new to VXL and I just installed it on Windows. I want to test it by building my first project "VXL_HelloWorld" but it failed when building in Visual Studio 2010. 

 

Here is my CMakeLists.txt:

 

CMAKE_MINIMUM_REQUIRED(VERSION 2.6)

PROJECT(VXL_HelloWorld)

 

IF(VXL_FOUND)

  INCLUDE(${VXL_CMAKE_DIR}/UseVXL.cmake)

ENDIF(VXL_FOUND)

 

ADD_EXECUTABLE(HelloWorld HelloWorld.cxx )

TARGET_LINK_LIBRARIES( HelloWorld vcl )

 

 

And here is my source code:

 

#include <vcl_iostream.h>

int main()

{

  // send string "hello world" to the standard output stream cout.

  vcl_cout << "Hello world\n";

  return 0;

}

 

 

After I use CMake to compile and generate the project, I opened the .sln file and try to build it but it failed and gives the following errors:

Error  1          error C1083: Cannot open include file: 'vcl_iostream.h': No such file or directory  

          2          IntelliSense: cannot open source file "vcl_iostream.h"          

          3          IntelliSense: identifier "vcl_cout" is undefined

 

 

I guess there may be some problem with my CMakeLists.txt. 

Could you help me find out the problem?

 

Thanks and best regards,

Hao Wu