RE [CMake] Eclipse CDT and CMake

Andy Dingfelder DingfelderA at SirTrack.com
Mon Jul 23 21:11:06 EDT 2007


sorry, I missed one step, from the wiki example.
Mike, you talk about manually running ccmake from the command line.

I am not clear why you do this... 
from what it asked me to do, my best guess is that this file is used to
define the output dirs for the libraries or executables the make
creates.

It would be super-nice if the cmake plugin could have these set up as
defaults within eclipse so you don't have to do this manually for each
project.

it also still seems that you still have to manually create a
CMakeLists.txt file before this step, such as:

# The name of our project is "HELLO".  CMakeLists files in this project
can
# refer to the root source directory of the project as
${HELLO_SOURCE_DIR} and
# to the root binary directory of the project as ${HELLO_BINARY_DIR}.
project (HELLO)

IF(CMAKE_COMPILER_IS_GNUCC)
  SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fmessage-length=0")
ENDIF(CMAKE_COMPILER_IS_GNUCC)
IF(CMAKE_COMPILER_IS_GNUCXX)
  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fmessage-length=0")
ENDIF(CMAKE_COMPILER_IS_GNUCXX)

SET(CMAKE_VERBOSE_MAKEFILE ON)

# Recurse into the "Hello" and "Demo" subdirectories.  This does not
actually
# cause another cmake executable to run.  The same process will walk
through
# the project's entire directory structure.
#add_subdirectory (Hello)
#add_subdirectory (Demo)
# Make sure the compiler can find include files from our Hello
library.
include_directories (${HELLO_SOURCE_DIR})

# Make sure the linker can find the Hello library once it is built.
link_directories (${HELLO_BINARY_DIR})

# Add executable called "helloDemo" that is built from the source
files
# "demo.cxx" and "demo_b.cxx".  The extensions are automatically
found.
add_executable (helloWorld helloworld.cpp)

# Link the executable to the Hello library.
#target_link_libraries (helloWorld Hello)

so you might want to add more info about what ccmake does in the wiki,
and add a default  CMakeLists.txt file.

Cheers,

Ding

>>> Andy Dingfelder 24/07/2007 10:51:21 a.m. >>>
I've been reading through the thread on Eclipse CDT and CMake and have
a couple questions.

I have installed the eclipse plugin from
http://www.cthing.com/CMakeEd.asp 
It color codes the CMakeLists.txt file, not sure what else it does, as
it did not have any documentation I could see and  there is no help or
faq on their website.

I ran through the instructions on the wiki:
http://paraview.org/Wiki/CMake:Eclipse 
and was not clear on a couple of points.  

First of all, the example refers to a helloworld.cpp file, which does
not exist by default... perhaps it needs to be added to the wiki? 
I could use eclipse to generate a class file named helloworld but I am
not sure if the example needs any particular code.

the example also shows a CMakeLists.txt file which also does not
exist.

What would go into it?

Moving on and guessing about where I could go from here, I then
downloaded the example code from http://www.cmake.org/HTML/Examples.html
and dropped it into my new project, and did an eclipse "build all".

It did a build, and generated some files, but did not make the
executable output that I expected.

...
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
WARNING: This email and any attachments may be confidential and/or
privileged. They are intended for the addressee only and are not to be read,
used, copied or disseminated by anyone receiving them in error.  If you are
not the intended recipient, please notify the sender by return email and
delete this message and any attachments.

The views expressed in this email are those of the sender and do not
necessarily reflect the official views of Landcare Research.  

SirTrack
http://www.sirtrack.com
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++




More information about the CMake mailing list