[CMake] where are the output files?

Michael Jackson mike.jackson at bluequartz.net
Tue Dec 8 23:47:14 EST 2009


Some projects have CMake code in the top most CMakeLists.txt file such  
as the following:

# ---------- Setup output Directories -------------------------
SET (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/Bin)

# --------- Setup the executable output Directory -------------
SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/Bin )

# --------- Setup the static Lib output Directory -------------
SET (CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/Bin )


So what this would do for your project would be to put all the final  
built products in /Users/me/Proj/build/Bin/Debug/   (at least for an  
Xcode project).

You may also want to look at the actual CMake Source code in the  
"Tests" directory. There is an example on how to write the CMake code  
to generate an OS X Framework.

There is also <http://www.cmake.org/Wiki/BundleUtilitiesExample> that  
explains how to use the "BundleUtilities" functions that will take  
care of using the 'install_name_tool' to correctly set the  
install_name of the framework and copy it into the Application Bundle.  
There is a downloadable Qt based project to use as an example.

  Hope some of that helps.

Mike Jackson

On Dec 8, 2009, at 8:49 PM, Glenn Hughes wrote:

> Ok, this is something that I thought was going to be easy, but I
> really can't figure it out...
> I've written a python script to smash my private frameworks into my
> built application, but, I need to know exactly where the frameworks
> and the app have been built.
> I know I can control the top-level binary directory for each target
> when I do my ADD_SUBDIRECTORY, and I know each target's name, since I
> specify that, but I can't figure out how to find the current build
> configuration...
>
> For example, here's the information I need:
> /Users/me/Proj/build/App/Debug/MyApp.app/
> /Users/me/Proj/build/Framework/Debug/MyFramework.framework/
>
> The only part of this path that isn't under my control is the  
> "Debug" part...
>
> I'm a bit overwhelmed by the number of paths floating around in the
> CMake universe. I've printed a bunch of them out, but none of them
> seem to be what I'm after.
>
> Any ideas?
>
> Thanks



More information about the CMake mailing list