[CMake] Xcode paths not turning out right

Brad King brad.king at kitware.com
Fri Sep 18 16:12:06 EDT 2009


Robert Dailey wrote:
>     Where is the CMakeLists.txt file containing this line?
>     Perhaps "/Users/imac/work/redsword/CMakeLists.txt"?
> 
> 
> That's where the root one is, and this root script has all of the meat 
> that the subdirectories call. This script is the one that has the 
> functions that call add_executable() with the absolute paths. However, 
> the script *calling* that function is in:
> 
> /Users/imac/work/redsword/projects/foobar/CMakeLists.txt

I'm having trouble reproducing this.  I have

   # CMakeLists.txt
   cmake_minimum_required(VERSION 2.6) # but I'm running 2.7.20090918
   project(FOO C)
   function(my_add)
     add_executable(${ARGN})
   endfunction()
   add_subdirectory(A)

   # A/CMakeLists.txt
   my_add(foo ${FOO_SOURCE_DIR}/A/foo.mm foo.c)

In Xcode, the "Get Info" dialog for foo.mm says

   Name: A/foo.mm
   Full path: /path/to/source/tree/A/foo.mm

What is the symptom you're seeing?
Can you please send me a tarball with a minimal project?

> The version of xcode I'm using is the one that comes with the iPhone 3.1 
> SDK installer. I don't know how to find out the version number of xcode 
> on the mac. I think it is xcode 3.1 though.

Use the Xcode menu:

   Xcode -> About Xcode

to see a version dialog.

-Brad



More information about the CMake mailing list