How to set C++ compiler outside Macports?

Mojca Miklavec mojca.miklavec.lists at
Sun Jul 29 10:18:54 PDT 2012

On Sun, Jul 29, 2012 at 8:35 AM, Ian Wadham < at> wrote:
> On 29/07/2012, at 3:43 PM, Jeremy Huddleston Sequoia wrote:
>> On Jul 28, 2012, at 21:35, Ian Wadham < at> wrote:
>>> In my Mac OS X environment, /usr/bin/c++ is a symbolic link to
>>> llvm-g++-4.2, but I need it to be to the same compiler as Macports
>>> used to build kdelibs4.  Then I can compile and link my own code
>>> correctly with that library and continue developing and testing my
>>> source code for the next release of KDE.
>> Why are you using /usr/bin/c++?  Just use /usr/bin/clang++ (or 'xcrun clang++' if you didn't install the command line tools).
> It's not that simple.  I never use a compiler directly, just CMake initially,
> including all the KDE macros and dependencies, then "make" on later
> runs.  CMake picks up /usr/bin/c++, by default, but could no doubt be
> made to do something else.

Try to run
   ccmake path/to/your/sources
to see what variables you can change. You can either change them
inside ccmake or call
    cmake -DCMAKE_CXX_COMPILER=/usr/bin/clang++ <all_other_variables>


More information about the macports-users mailing list