Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7914865
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T14:15:43+00:00 2026-06-03T14:15:43+00:00

Does anyone know how to do specify the Mac OS X SDK to build

  • 0

Does anyone know how to do specify the Mac OS X SDK to build against with CMake? I have searched for cmake mac "base sdk" but this turned up nothing.

I am using CMake to generate Unix makefiles.

Update

On my 10.6 install, I see that /Developer/SDKs has the following:

  • MacOSX10.4u.sdk
  • MacOSX10.5.sdk
  • MacOSX10.6.sdk

Perhaps I can get CMake to pass one of these paths to the compiler somehow?

Also, my 10.7 install only has:

  • MacOSX10.6.sdk
  • MacOSX10.7.sdk

Does this mean that it can only build for these platforms?

Update 2

Damn, I just realised that actually I’m not using Xcode — so this may affect some answers. Also, I am now trying with Mac OS X 10.8 developer preview (with some weird results, see my answer).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T14:15:45+00:00Added an answer on June 3, 2026 at 2:15 pm

    After trying sakra’s valid answer (valid as far as CMake is suposed to behave) unsucessfully, I had a dig around and found that if I specify the --sysroot flag to the compiler, it seems to use the correct SDK!

    However, I now see this error when I compile against 10.7 (which I don’t see with 10.8):

    Undefined symbols for architecture i386:
      "_NXArgv", referenced from:
          execSelfNonDaemonized() in libarch.a(CArchDaemonUnix.o)
          CArchDaemonUnix::daemonize(char const*, int (*)(int, char const**)) in libarch.a(CArchDaemonUnix.o)
    ld: symbol(s) not found for architecture i386
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    make[2]: *** [bin/synergyc] Error 1
    make[1]: *** [src/cmd/synergyc/CMakeFiles/synergyc.dir/all] Error 2
    make: *** [all] Error 2
    

    Note: CArchDaemonUnix is a class in Synergy (an open source project I’m working on).

    Update:

    Just tried this on my 10.6 install, and I was getting a linker error when trying to compile for 10.5 — turns out you also need to specify the MACOSX_DEPLOYMENT_TARGET environment variable!

    Anyway, here’s what I’m doing when running on Mountain Lion (OSX 10.8) to compile for 10.7:

    Command line:

    MACOSX_DEPLOYMENT_TARGET=10.7
    
    cmake -G "Unix Makefiles" -DCMAKE_OSX_SYSROOT=/Developer/SDKs/MacOSX10.7.sdk/ -DCMAKE_OSX_DEPLOYMENT_TARGET=10.7 ../..
    

    CMakeLists.txt:

    set(CMAKE_CXX_FLAGS "--sysroot ${CMAKE_OSX_SYSROOT} ${CMAKE_CXX_FLAGS}")
    

    I hope this helps someone! 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I think the answer to this question is no... but does anyone know of
Does anyone know how to specify the MRL for the default camera on mac
Does anyone know the correct way to explicitly specify which rules Gendarme will use?
Does anyone know how to add an item to a list but do it
Does anyone know of a "similar words or keywords" algorithm available in open source
Does anyone know the proper syntax on how to specify the model that you
Does anyone know how to specify a bean as non lazy when using annotations
Does anyone know how to specify the sampling rate of the iphone GPS? I
does anyone know how to specify the height of a net.rim.device.api.browser.field2.BrowserField? I cannot find
I use VS2010 for unit testing. Does anyone know how to specify the location

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.