On 12/5/2013 5:40 AM, Michael Jackson wrote:
I used to use Eclipse for coding with CMake and the what worked the best for me
was the following (This assumes you are on Unix/Linux/OSX).
Start in "Project A". Create a directory "Build". Have CMake generate "Makefiles" using
"Build" as the build directory.
Start up Eclipse. Create a new "Existing Makefile" project and during the setup of that
project you need to adjust the build command to "make -C ${ProjDirPath}/Build VERBOSE=1"
which tells Eclipse to run make but use your already created Build directory with your makefiles.
Then Eclipse will show you the complete "file system" of Project A, VCS works,
builds work (inside AND outside of Eclipse). The only downside is you get
.project/.cproject in your Project A directory which you can have VCS easily ignore with
a few config files. The procedure is described on the CMake wiki here
http://www.cmake.org/Wiki/CMake:Eclipse_UNIX_Tutorial Look for "Option 2".
THere are screen shots to help you through the setup.
Thanks Mike-
I gave this a go and I can definitely build and see all my source,
however Eclipse by default was very confused about where to find the
source. I read on the tutorial that when you run with VERBOSE=1 Eclipse
should be capable of picking up all the include directories, however
when I browse to Project Properties -> C/C++ General -> Paths and
Symbols nothing was showing up, so pretty much everything in my source
code was red. I discovered to get this working you need to go to
Project Properties -> C/C++ General -> Preprocessor Includes, and on the
Providers tab enable "CDT GCC Build Output Parser" and "CDT GCC Built-in
Compiler Settings". Afterward doing a clean/build, and re-index, and
everything was resolving as expected.
Thanks!
David
--
Powered by www.kitware.com
Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ
Kitware offers various services to support the CMake community. For more
information on each offering, please visit:
CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake