[CMake] EXECUTABLE_OUTPUT_PATH on Mac OS X

Karl Merkley karl at elemtech.com
Tue Dec 7 11:20:21 EST 2004


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?

	Thanks,
		Karl



More information about the CMake mailing list