Creating .bundle file with CMake on MAC OSX

I want to generate an executable in a file .bundleon Mac OSX 10.6.8using CMake. My CMakeLists.txt file looks like this:

cmake_minimum_required(VERSION 2.8)
PROJECT(TESTProject)
SET(MACOSX_BUNDLE_BUNDLE_NAME TEST)
ADD_EXECUTABLE(TEST MACOSX_BUNDLE main.cpp)
SET_TARGET_PROPERTIES(TEST PROPERTIES MACOSX_BUNDLE TRUE)

Then I call CMake:

CMake -G"Xcode" .

However, when I compile this program with Xcode 3.2.1, I constantly get a file TEST.appinstead of a file TEST.bundle.

What am I doing wrong here?

+5
source share
2 answers

Use the target property BUNDLE_EXTENSION to get a different extension than the default value. http://www.cmake.org/cmake/help/v2.8.10/cmake.html#prop_tgt:BUNDLE_EXTENSION

, , .app - . , .bundle .

?

+6

, .bundle, CMake 3.0:

add_library(Foo MODULE ${SOURCES} ${HEADERS})
set_target_properties(Foo PROPERTIES BUNDLE TRUE)

MODULE not SHARED. - CMake BUNDLE .

+1

All Articles