Ticket #55382: cmake.diff

File cmake.diff, 4.1 KB (added by ryandesign (Ryan Carsten Schmidt), 6 years ago)
  • Portfile

     
    22
    33PortSystem          1.0
    44PortGroup           muniversal 1.0
    5 PortGroup           compiler_blacklist_versions 1.0
    65
    76# devel requires C++11 as of 2017-08-21
    87# https://gitlab.kitware.com/cmake/cmake/commit/c1f3eb9f2d628b2911aa17f65012fab0befc4b87
    98# release requires C++11 as of 3.10.0
     9if {!((${os.platform} eq "darwin" && ${os.major} < 10) || ${build_arch} eq "ppc" || ${build_arch} eq "ppc64")} {
     10    depends_lib-append port:libcxx
     11    configure.cxx_stdlib libc++
     12}
    1013PortGroup cxx11 1.1
    1114
    1215name                cmake
     
    108111                    CMAKE_INCLUDE_PATH=${prefix}/include/ncurses \
    109112                    CMAKE_LIBRARY_PATH=${prefix}/lib
    110113
    111 # when using libc++, require Clang 3.4 or newer; Clang 3.3 produces
    112 # bad stream reading code. See also MP ticket #44129:
    113 # < https://trac.macports.org/ticket/44129 >
    114 
    115 if {${configure.cxx_stdlib} eq "libc++"} {
    116     compiler.blacklist-append *gcc* {clang < 500} macports-clang-3.3
     114# On Lion, Clang 3.3 produces bad stream reading code when using libc++.
     115# See https://trac.macports.org/ticket/44129
     116# Clang 3.4 works. But Clang 3.7 doesn't work.
     117if {${os.platform} eq "darwin" && ${os.major} == 11 && ${configure.cxx_stdlib} eq "libc++"} {
     118    compiler.whitelist macports-clang-3.4
    117119}
     120# Clang 3.8 and later require cmake; avoid circular dependency.
     121compiler.blacklist-append macports-clang-3.8 macports-clang-3.9 macports-clang-4.0 macports-clang-5.0
    118122
    119123platform darwin {
    120124    configure.env-append \
     
    127131    }
    128132}
    129133
    130 # CMake 3.2 changed dependency requirements to include jsoncpp.
    131 # jsoncpp 1.0+ requires CMake for building. catch 22. So, have CMake
    132 # use its internal jsoncpp until a better solution comes about.
     134# jsoncpp 1.0+ requires CMake for building; circular dependencies are
     135# not possible in MacPorts. In addition, jsoncpp uses C++, so it would
     136# not be possible for CMake, which uses libc++ on 10.6-10.8, to link
     137# with a MacPorts copy of jsoncpp, which would usually use libstdc++
     138# on those systems. Fortunately CMake comes bundled with its own
     139# internal copy of jsoncpp, so we use that.
    133140
    134141configure.args-append --docdir=share/doc/cmake \
    135142                    --parallel=${build.jobs} \
     
    170177    set universal_archs_supported ${supported_archs}
    171178}
    172179
    173 platform darwin {
    174     # TODO: Figure out why using libc++ fails on Lion and fix the bootstrap
    175     #       script to honor CMAKE_OSX_SYSROOT and CMAKE_OSX_DEPLOYMENT_TARGET.
    176     #       Since nothing links against cmake and cmake is just using the STL,
    177     #       we're safe to force libstdc++
    178     #
    179     #       https://cmake.org/Bug/view.php?id=15039&nbn=16
    180     if {${os.major} < 12} {
    181         configure.cxx_stdlib libstdc++
    182     }
    183 }
    184 
    185180build.post_args VERBOSE=ON
    186181
    187182post-patch {
     
    231226
    232227variant gui description {Build Qt-based cmake-gui} {
    233228    configure.args-append --qt-gui
    234 
    235     # when building the GUI with Qt, CMake uses C++11. So, make sure
    236     # the compiler used is c++11 compliant.
    237 
    238     if {${configure.cxx_stdlib} eq "libstdc++"} {
    239 
    240         # *clang* when using libstdc++ do not seem to support C++11;
    241         # C++11 support seems to need GCC 4.7+ when using libstdc++;
    242         # could use C++0x support on GCC4.[56], but just ignore it since
    243         # there are newer compilers already in place as defaults.
    244 
    245         # Blacklist GCC compilers not supporting C++11 and all CLANG.
    246         # This is probably not necessary, but it's good practice.
    247 
    248         compiler.blacklist-append *clang* {*gcc-3*} {*gcc-4.[0-6]}
    249 
    250         # and whitelist those we do want to use. wish there were a better way.
    251         # these will be used in the order provided.
    252 
    253         compiler.whitelist macports-gcc-4.9 macports-gcc-4.8 macports-gcc-4.7
    254 
    255     } else {
    256 
    257         # using libc++;
    258         # Blacklist Clang not supporting C++11 in some form and all GCC.
    259         # Just use the cxx11 PortGroup for this specific case.
    260 
    261         PortGroup cxx11 1.0
    262 
    263     }
    264229}
    265230
    266231variant qt4 conflicts qt5 requires gui description {Build Qt GUI using Qt4} {