[MacPorts] #52205: CMake PortGroup: set compiler explicitly

MacPorts noreply at macports.org
Sun Sep 11 14:59:11 CEST 2016


#52205: CMake PortGroup: set compiler explicitly
-------------------------+--------------------------------
 Reporter:  rjvbertin@…  |      Owner:  macports-tickets@…
     Type:  enhancement  |     Status:  new
 Priority:  Normal       |  Milestone:
Component:  ports        |    Version:
 Keywords:  haspatch     |       Port:  cmake
-------------------------+--------------------------------
 A recent CMake update changed the way the compiler choice is cached in the
 cmake build directory. Before it was possible to force a compiler change
 during an incremental build simply by removing CMakeCache.txt from
 build.dir; this would cause CMake to heed any changed changes in the CC
 and CXX env. variables.

 To achieve the same thing it is now required to add something like the
 following to the PortGroup:

 {{{
     # force newer CMake versions to take a change in compiler choice into
 account
     # even if it is invoked in a build.dir that was configured before.
     if {${configure.cc} ne ""} {
         configure.args-append \
                     -DCMAKE_C_COMPILER=${configure.cc}
     }
     if {${configure.cxx} ne ""} {
         configure.args-append \
                     -DCMAKE_CXX_COMPILER=${configure.cxx}
     }
 }}}

 I'm attaching the complete diff of the stock cmake PortGroup vs. mine.

-- 
Ticket URL: <https://trac.macports.org/ticket/52205>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list