1

I am new to OSG & CMake, and am trying to build the OpenSceneGraph for iOS as specified in the README file. Here are the platform and tools specifications. MAC OSX 10.10.4 XCode 6.4 iOS 8.4 iOS Simulator 8.4 OpenSceneGraph 3.4.0-rc9 CMake 3.3.0

Steps to reproduce the error: 1: Modify and save CMakeLists.txt in OSG folder for OPTION(OSG_BUILD_PLATFORM_IPHONE "Enable IPhoneSDK Device support" ON) OPTION(OSG_BUILD_PLATFORM_IPHONE_SIMULATOR "Enable IPhoneSDK Simulator support" OFF)

2: in CMake GUI update 'Where is the source code:' and 'Where to build binaries:' to OSG folder. Set the following options.

  • OSG_BUILD_PLATFORM_IPHONE:BOOL=ON \
  • CMAKE_CXX_FLAGS:STRING="-ftree-vectorize -fvisibility-inlines-hidden -mno-thumb -arch armv6 -pipe -no-cpp-precomp -miphoneos-version-min=3.1 -mno-thumb" \
  • BUILD_OSG_APPLICATIONS:BOOL=OFF \
  • OSG_BUILD_FRAMEWORKS:BOOL=OFF \
  • OSG_WINDOWING_SYSTEM:STRING=IOS \
  • CMAKE_OSX_ARCHITECTURES:STRING="armv6;armv7" \
  • CMAKE_OSX_SYSROOT:STRING=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.4.sdk \
  • OSG_GL1_AVAILABLE:BOOL=OFF \
  • OSG_GL2_AVAILABLE:BOOL=OFF \
  • OSG_GLES1_AVAILABLE:BOOL=ON \
  • OSG_GL_DISPLAYLISTS_AVAILABLE:BOOL=OFF \
  • OSG_GL_FIXED_FUNCTION_AVAILABLE:BOOL=ON \
  • OSG_GL_LIBRARY_STATIC:BOOL=OFF \
  • OSG_GL_MATRICES_AVAILABLE:BOOL=ON \
  • OSG_GL_VERTEX_ARRAY_FUNCS_AVAILABLE:BOOL=ON \
  • OSG_GL_VERTEX_FUNCS_AVAILABLE:BOOL=OFF \
  • DYNAMIC_OPENSCENEGRAPH:BOOL=OFF \
  • DYNAMIC_OPENTHREADS:BOOL=OFF .

Trying to configure with these configurations, but getting the following error.

The C compiler identification is AppleClang 6.1.0.6020053
The CXX compiler identification is AppleClang 6.1.0.6020053
Check for working C compiler using: Xcode
Check for working C compiler using: Xcode -- broken
CMake Error at /Applications/CMake.app/Contents/share/cmake-3.3/Modules/CMakeTestCCompiler.cmake:61
(message):
  The C compiler
  "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang"
  is not able to compile a simple test program.

  It fails with the following output:

   Change Dir: /Users/adithiathreya/Downloads/OpenSceneGraph-3.4.0-rc9/CMakeFiles/CMakeTmp



  Run Build Command:"/usr/bin/xcodebuild" "-project"
  "CMAKE_TRY_COMPILE.xcodeproj" "build" "-target" "cmTC_665b5"
  "-configuration" "Debug"

  === BUILD TARGET cmTC_665b5 OF PROJECT CMAKE_TRY_COMPILE WITH CONFIGURATION
  Debug ===



  Check dependencies

  target specifies product type 'com.apple.product-type.tool', but there's no
  such product type for the 'iphoneos' platform



  ** BUILD FAILED **





  The following build commands failed:

      Check dependencies

  (1 failure)





  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:52 (PROJECT)


Configuring incomplete, errors occurred!

I tried these configurations, with required changes for iPhone Simulator too, but got similar error. Could you please tell me where am I going wrong?

usr1234567
  • 21,601
  • 16
  • 108
  • 128

1 Answers1

0

You should specify IOS SDK version and iPhone version min in cmake.

cmake ../ -G Xcode -DOSG_BUILD_PLATFORM_IPHONE:BOOL=ON \
-DIPHONE_SDKVER="10.3" \
-DIPHONE_VERSION_MIN="8.0" \
-DOPENGL_PROFILE:STRING=GLES2 \
-DBUILD_OSG_APPLICATIONS:BOOL=OFF \
-DBUILD_OSG_EXAMPLES:BOOL=ON \
-DOSG_WINDOWING_SYSTEM:STRING=IOS \
-DOSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX="imageio" \
-DDYNAMIC_OPENSCENEGRAPH:BOOL=OFF \
-DDYNAMIC_OPENTHREADS:BOOL=OFF \
-DCURL_INCLUDE_DIR:PATH="$THIRDPARTY_PATH/curl-ios-device/include" \
-DCURL_LIBRARY:PATH="$THIRDPARTY_PATH/curl-ios-device/lib/libcurl.a"     \
-DFREETYPE_INCLUDE_DIR_freetype2:PATH="$THIRDPARTY_PATH/freetype-ios-          universal/include/freetype" \
-DFREETYPE_INCLUDE_DIR_ft2build:PATH="$THIRDPARTY_PATH/freetype-ios-  universal/include" \
-DFREETYPE_LIBRARY:PATH="$THIRDPARTY_PATH/freetype-ios-universal/lib/libFreeType_iphone_universal.a" \
-DTIFF_INCLUDE_DIR:PATH="$THIRDPARTY_PATH/tiff-ios-device/include" \
-DTIFF_LIBRARY:PATH="$THIRDPARTY_PATH/tiff-ios-device/lib/libtiff.a" \
-DGDAL_INCLUDE_DIR:PATH="$THIRDPARTY_PATH/gdal-ios-device/include" \
-DGDAL_LIBRARY:PATH="$THIRDPARTY_PATH/gdal-ios-device/lib/libgdal.a"

$THIRDPARTY_PATH is the dir of 3rdparties you downloaded.