[CMake] build of macosx bundle in a subdir

free man freeman_new2001 at yahoo.com
Sat Mar 12 17:20:27 EST 2005


hi all

i would make a CMakeLists.txt to build the target at
the subdir "bin" with a MaxOSX bundle. i tried the
following:

PROJECT(CocoaGL)
SET(EXECUTABLE_OUTPUT_PATH ${CocoaGL_SOURCE_DIR}/bin/
CACHE INTERNAL "Exe path")
INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/source/sources.cmake)

SET(cocoa_LIBRARY "-framework Cocoa" CACHE STRING
"Cocoa framework for OSX")
SET(gl_LIBRARY "-framework OpenGL" CACHE STRING
"OpenGL lib for OSX")

# ********** Include directories
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)

# ********** Executable
IF (APPLE)
	ADD_EXECUTABLE(CocoaGL MACOSX_BUNDLE ${sources} )
ELSE (APPLE)
	ADD_EXECUTABLE(CocoaGL ${sources} )
ENDIF (APPLE)

# Link the executable.
TARGET_LINK_LIBRARIES(CocoaGL ${cocoa_LIBRARY}
${gl_LIBRARY})

--------------------------------------------------------
sources.cmake

SET(sources
	${CocoaGL_SOURCE_DIR}/source/main.m
  ${CocoaGL_SOURCE_DIR}/source/GLView.m
)
--------------------------------------------------------
my directory looks like:

.
|-- CMakeCCompiler.cmake
|-- CMakeCXXCompiler.cmake
|-- CMakeCache.txt
|-- CMakeLists.txt
|-- CMakeOutput.log
|-- CMakeSystem.cmake
|-- CMakeTmp
|-- Makefile
|-- bin
|   |-- CocoaGL.app
|   |   `-- Contents
|   |       |-- Info.plist
|   |       `-- MacOS
|   `-- bin.cmake
|-- cmake.check_cache
|-- cmake.check_depends
|-- cmake.depends
|-- cmake_install.cmake
|-- include
|   `-- GLView.h
|-- source
|   |-- GLView.m
|   |-- main.m
|   `-- sources.cmake

----------------------------------------------------------

when i make it then i have:

make[1]: *** No rule to make target
`/Users/RE/src/CocoaGL/bin/CocoaGL', needed by `all'. 
Stop.

----------------------------------------------------------

and another question:

how can i make that the temp files (*.cmake and
others) goes in a subdir ?

thanks

Remo



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


More information about the CMake mailing list