我正在尝试使用CMake构建一个ios应用程序,我遇到了一些警告和错误。首先,当我打电话给cmake时,我得到了这个:
CMake Error in CMakeLists.txt:
Syntax error in cmake code when parsing string
<string>arxan.${PRODUCT_NAME:rfc1034identifier}</string>
syntax error, unexpected cal_SYMBOL, expecting } (48)
它似乎仍然构建了一切,我可以运行make。但是,我收到以下警告:
clang: warning: no such sysroot directory: 'iphoneos'
和错误:
In file included from /Users/aottinger/TestFrameWorkiOS/AppDelegate.m:9:
/Users/aottinger/TestFrameWorkiOS/AppDelegate.h:9:9: fatal error:
'UIKit/UIKit.h' file not found
#import <UIKit/UIKit.h>
这是我的CMakeLists.txt:
cmake_minimum_required(VERSION 2.8)
project(auto_generated_xcodeproj)
set(NAME auto_generated_xcodeproj)
file(GLOB headers *.h)
file(GLOB sources *.c *.cpp *.cc *.m)
set(CMAKE_OSX_SYSROOT iphoneos7.1)
set(CMAKE_OSX_ARCHITECTURES "arm64")
set(CMAKE_XCODE_EFFECTIVE_PLATFORMS "-iphoneos")
add_executable(${NAME} MACOSX_BUNDLE ${APP_TYPE} ${headers} ${sources})
target_link_libraries(${NAME}
"-framework Foundation"
"-framework CoreGraphics"
"-framework UIKit"
"-framework XCTest")
set_target_properties(${NAME} PROPERTIES
MACOSX_BUNDLE_GUI_IDENTIFIER "com.arxan.auto_generated_xcodeproj"
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist
XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT "dwarf-with-dysm"
XCODE_ATTRIBUTE_GCC_PRECOMPILE_PREFIX_HEADER YES
XCODE_ATTRIBUTE_GCC_PREFIX_HEADER ${CMAKE_CURRENT_LIST_DIR}/Prefix.pch
XCODE_ATTRIBUTE_INFOPLIST_PREPROCESS YES
XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET 7.1)
我不明白为什么在我链接框架时找不到头文件,我对其他CMake错误和clang警告感到茫然。