Hello,
I came across the following link:
http://stackoverflow.com.80bola.com/questions/7462129/cmake-xib-to-nib-compilation-for-ios-target?s=1|0.8637
Described is how to set up a CMakeLists.txt in order to have .xib files
automatically compiled to .nib files and placed in the Resources folder
within the app bundle for iOS targets. Nice and simple. Unfortunately, I've
tried grafting the relevant parts onto a project that targets Mac OSX, and
while the .xib is copied to the Resources directory, it is not compiled. Do
I need to do it manually, as pointed out elsewhere, if I target OSX?
By the way, I've attached my version of the CMakeLists.txt file. Note that
if I invoke:
cmake -GXcode ..
from a "build" subdirectory, a foo.xcodeproj file is created, as expected,
which "does the right thing". My problem is that I'd like to elide Xcode
and build from the command line. (I'm aware of xcodebuild but I'm curious
if I can do it just using make, because I'd like to build in Clion.)
Many thanks in advance,
Martin Percossi
cmake_minimum_required(VERSION 2.8.8)
project(foo)
set(CMAKE_OSX_SYSROOT
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk)
set(CMAKE_OSX_ARCHITECTURES "i386;x86_64")
set(CMAKE_XCODE_EFFECTIVE_PLATFORMS "macosx")
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.10)
set(RESOURCES MainMenu.xib)
add_executable(
foo
MACOSX_BUNDLE
AppDelegate.h
AppDelegate.mm
main.mm
${RESOURCES}
)
set_target_properties(foo PROPERTIES
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_LIST_DIR}/plist.in
RESOURCE "${RESOURCES}"
)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -framework AppKit")
--
Powered by www.kitware.com
Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ
Kitware offers various services to support the CMake community. For more
information on each offering, please visit:
CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake