1

I am trying to compile the VRPN library on my OS X 10.10.5.

I set up the cmake configuration with : ccmake ../vrpn. And when I try to configure the project I get the following error :

CMake Error at /usr/local/Cellar/cmake/3.4.0/share/cmake/Modules/Platform/Darwin.cmake:76 (message):
   CMAKE_OSX_DEPLOYMENT_TARGET is '10.10' but CMAKE_OSX_SYSROOT:
    ""
   is not set to a MacOSX SDK with a recognized version.  Either set
   CMAKE_OSX_SYSROOT to a valid SDK or set CMAKE_OSX_DEPLOYMENT_TARGET to
   empty.
Call Stack (most recent call first):
   /usr/local/Cellar/cmake/3.4.0/share/cmake/Modules/CMakeSystemSpecificInformation.cmake:36 (include)
   CMakeLists.txt:3 (project)

CMake Error: Internal CMake error, TryCompile configure of cmake failed

nal CMake error, TryCompile configure of cmake failed

And I see in the configuration the variable :

CMAKE_OSX_DEPLOYMENT_TARGET      10.10

When trying to configure the project again, I get the following message along with the previous error :

CMAKE_OSX_DEPLOYMENT_TARGET is '10.10' but the matching SDK does not exist
   at:
"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk"

Instead using SDK:
 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk".

Obviously, the problem is that the default cmake configuration sets the wrong SDK version.

I change the version to 10.11 :

CMAKE_OSX_DEPLOYMENT_TARGET      10.11

And I set the CMAKE_OSX_SYSROOT as required :

CMAKE_OSX_SYSROOT    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk

The configuration is fine but then I get the following error :

Could NOT find Threads (missing: Threads_FOUND)

What surprises me is that on another CMakeLists.txt I try to fetch the Threads library and the cmake execution is fine :

cmake_minimum_required (VERSION 3.4) 
find_package(Threads REQUIRED)

I supposed that the problem is that the custom CMAKE_OSX_SYSROOT and CMAKE_OSX_DEPLOYMENT_TARGET make the Threads package not findable. But each time I try and remove the CMAKE_OSX_DEPLOYMENT_TARGET and CMAKE_OSX_SYSROOT from the ccmake configuration, I get the first error message and the CMAKE_OSX_DEPLOYMENT_TARGET is reset to 10.10.

Do you have any information/tests that I can try to solve this ?

nobe4
  • 2,802
  • 3
  • 28
  • 54
  • Have you tried the latest CMake version (currently 3.4)? Why is the required CMake version 2.6 and not 3.0 or 2.8.10 or similar? – usr1234567 Dec 16 '15 at 14:24
  • similar results with `3.4`, this version was in an example that I've copied too quickly. I've updated my question, thanks for pointing this out. – nobe4 Dec 16 '15 at 15:08
  • I've come acaross the same problem, cmake recognizes my system as 10.4 and i'm running 10.11. i can't stand cmake, it's a POS, just give me a makefile or configure. i've tried setting ENV variables, bash subshells with nothing from the system, bash subshell with everything included. still wants to install as 10.4 with old powerpc lib. there must be some stupid test cmake is doing that it's choking on. – μολὼν.λαβέ Feb 01 '16 at 06:05

1 Answers1

1

Updating Xcode to 8.1 and Installing Command line tools solved it for me

xcode-select --install
Daniel Georgiev
  • 1,292
  • 16
  • 14