cmake didn't generate xcodeproj file

Hi,

I ran cmake on my Mac and it seemed to work, except that I don't have any xcodeproj file, which I gather is what I need in order to run anything. There was an error with CMakesLists.txt not included in Build, which other people seem to have had trouble with before, but I couldn't find a solution to it.

Thanks in advance
Cmake creates the XCode project for you. I have done this on my MBP and it worked.
Well, it didn't, so I don't really know where to go from here. My Box2D folder contains:

Box2D/
Build/
Building.txt
cmake_install.cmake
CMakeCache.txt
CMakeFiles/
CmakeLists.txt
Documentation/
freeglut/
glui/
HelloWorld/
License.txt
Makefile
Readme.txt
Testbed/

No XCode proj in any of them...
What were your Source and Build directories you set in cmake? What did the cmake output say when you tried to generate the project?
The first time I did it from the command line, as it says to do in Building.txt:

Code:
cd $BOX2DPATH/Build
cmake -DBOX2D_INSTALL=ON -DBOX2D_BUILD_SHARED=ON ..
make
make install


When I got to the make line, it said:

Code:
ld: library not found for -lGLUT
collect2: ld returned 1 exit status
make[2]: *** [Testbed/Testbed] Error 1
make[1]: *** [Testbed/CMakeFiles/Testbed.dir/all] Error 2
make: *** [all] Error 2


I also tried from the CMake application, setting the entire Box2D directory as the source and as the build, and generating it gave this:

Code:
CMake Warning (dev) at Testbed/CMakeLists.txt:70 (add_executable):
  Policy CMP0003 should be set before this line.  Add code such as

    if(COMMAND cmake_policy)
      cmake_policy(SET CMP0003 NEW)
    endif(COMMAND cmake_policy)

[.....etc.......]

This warning is for project developers.  Use -Wno-dev to suppress it.

Generating done
The last one makes it look like it succeeded. That was just a warning.
cmake -DBOX2D_INSTALL=ON -DBOX2D_BUILD_SHARED=ON -G Xcode ..

is what you want, I think.

Might have to delete the cache file before it will run, if it's already generated the Unix makefiles.
ewjordan - thanks! it generated an XCode project file.

However, when I do 'make' on the next line, I still get this error:

Code:
ld: library not found for -lGLUT
collect2: ld returned 1 exit status
make[2]: *** [Testbed/Testbed] Error 1
make[1]: *** [Testbed/CMakeFiles/Testbed.dir/all] Error 2
make: *** [all] Error 2


Similarly when I compile and run Testbed in XCode, I get this error:

Code:
library not found for -lGLUT
Command /Developer/usr/bin/g++-4.0 failed with exit code 1
Here's the exact list of commands that work for me, starting from scratch just now.

    0) cd (wherever you like to put code)
    1) svn checkout http://box2d.googlecode.com/svn/trunk/ box2d-svn
    (lots of output snipped)
    ...Checked out revision 141.
    2) cd box2d-svn/Box2D/Build
    3) cmake -DBOX2D_INSTALL=ON -DBOX2D_BUILD_SHARED=ON -G Xcode ..
    Code:
    -- The C compiler identification is GNU
    -- The CXX compiler identification is GNU
    -- Checking whether C compiler has -isysroot
    -- Checking whether C compiler has -isysroot - yes
    -- Checking whether C compiler supports OSX deployment target flag
    -- Checking whether C compiler supports OSX deployment target flag - yes
    -- Check for working C compiler using: Xcode
    -- Check for working C compiler using: Xcode -- works
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - failed
    -- Checking whether CXX compiler has -isysroot
    -- Checking whether CXX compiler has -isysroot - yes
    -- Checking whether CXX compiler supports OSX deployment target flag
    -- Checking whether CXX compiler supports OSX deployment target flag - yes
    -- Check for working CXX compiler using: Xcode
    -- Check for working CXX compiler using: Xcode -- works
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - failed
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /workspace/box2d-svn/Box2D/Build

    4) open Box2D.xcodeproj

..and the project pops open in XCode. I just had to hit "Build and Run" (CMD+ENTER), and the whole thing built properly (target: ALL_BUILD, executable: HelloWorld). Switch the active executable to Testbed, CMD+ENTER again, and the testbed should run.

However, I'd previously successfully run make/make install on this computer, I don't know if the XCode project depends on that having completed or not (I don't think it does, but I could be wrong?).
Thanks again. It worked exactly according to plan except:
Code:
Command /Developer/usr/bin/g++-4.0 failed with exit code 1

came up, as well as many warnings, when I did build and go for the entire thing and just Testbed. I've successfully compiled programs with this version of XCode on this machine very recently. From a quick google search it looks like a lot of people get this error. oh well

Original thread: https://box2d.org/forum/viewtopic.php?t=5697