[CMake] EXECUTABLE_OUTPUT_PATH on Mac OS X

Brad King brad.king at kitware.com
Wed Dec 8 20:17:10 EST 2004


Karl Merkley wrote:
> I have a directory structure that looks like this
> 
>           top-level
> exe dir1 dir2 dir3
> 
> In the exe directory I have the main.cpp and it links to libraries 
> created in all the other sub directories.  The CMakeLists.txt in the exe 
> directory I set the the output path to
> SET(EXECUTABLE_OUTPUT_PATH ${proj_BINARY_DIR})
> 
> and add the executable as follows
> IF(APPLE)
>    SET(GUI_EXECUTABLE MACOSX_BUNDLE)
> ENDIF(APPLE)
> 
> ADD_EXECUTABLE(proj ${GUI_EXECUTABLE} ${PROJ_APP_SRCS} 
> ${EXTRA_PROJ_APP_SRCS} ${PROJ_APP_HEADERS})
> 
> This works and creates the executable in the top-level directory on 
> Windows, Linux, and several flavors of UNIX.
> 
> The Mac however is giving me some problems.
> 
> The target generated in the Makefile is
> TARGETS =  \
> /Users/karl/build_proj/proj
> 
> but the build line in the generated Makefile is
> /Users/karl/build_proj/proj.app/Contents/MacOS/proj: some list of 
> dependencies
> 
> When the Makefile is executed it attempts to build TARGET but the 
> requested target does not exist in the Makefile.  I can cd to the exe 
> directory and do a make 
> /Users/karl/build_proj/proj.app/Contents/MacOS/proj and the final build 
> step works correctly.
> 
> Does anyone have any suggestions for making this work?

This looks like a bug.  Please try to reproduce it in a small test case 
and report the bug here:

http://www.cmake.org/Bug

You can include the small test case as an attachment once the bug report 
is created.

Thanks,
-Brad


More information about the CMake mailing list