[MacPorts] #52699: cmake portgroup version 1.1
MacPorts
noreply at macports.org
Thu Oct 27 00:39:03 CEST 2016
#52699: cmake portgroup version 1.1
--------------------------+----------------------
Reporter: mkae | Owner: mkae
Type: enhancement | Status: accepted
Priority: Normal | Milestone:
Component: ports | Version:
Resolution: | Keywords:
Port: cmake |
--------------------------+----------------------
Comment (by RJVB):
(I'm having difficulties finding the right button to submit comments, so
here's a reply that was still not posted :-/)
I found my additions significant enough to bother signing them.
Replying to [comment:16 larryv]:
> Why the weird `cmake.install_rpath` function?
Define weird?!
I have never found any documentation how to create custom variables with
-append, -prepend etc. functionality, so I rolled my own implementation.
I'm sorry (for you) if you find that weird...
`cmake_install_rpath` should just be an option so that it has the
appending/prepending functionality that all other portfile options have.
Then set
> {{{
> default configure.args {-DCMAKE_INSTALL_RPATH="[join
${cmake_install_rpath} ;]"}
> }}}
> to construct the path on the fly.
I must be doing something weird^H^H^H^Hrong then:
{{{
options cmake.out_of_source cmake.build_dir cmake.set_osx_architectures
cmake_install_rpath
#snip
default cmake_install_rpath ${prefix}/lib
default configure.args {-DCMAKE_INSTALL_RPATH="[join
${cmake_install_rpath} ;]"}
configure.args-append \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DCMAKE_COLOR_MAKEFILE=ON \
-DCMAKE_BUILD_TYPE=MacPorts \
-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \
-DCMAKE_INSTALL_NAME_DIR=${prefix}/lib \
-DCMAKE_SYSTEM_PREFIX_PATH="${prefix}\;/usr" \
-DCMAKE_MODULE_PATH=${cmake_share_module_dir} \
-DCMAKE_FIND_FRAMEWORK=LAST \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-Wno-dev
}}}
in a test Portfile:
{{{
PortGroup cmake 1.1
#snip
cmake_install_rpath-prepend ${qt_libs_dir}
ui_msg "cmake_install_rpath=${cmake_install_rpath}"
#snip
configure.args-append -Dfoo
#snip
ui_msg "configure.args=${configure.args}"
}}}
prints
{{{
cmake_install_rpath=/opt/local/libexec/qt5/lib /opt/local/lib
configure.args=-DCMAKE_INSTALL_RPATH="/opt/local/lib"
-DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_COLOR_MAKEFILE=ON
-DCMAKE_BUILD_TYPE=MacPorts -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON
-DCMAKE_INSTALL_NAME_DIR=/opt/local/lib
{-DCMAKE_SYSTEM_PREFIX_PATH="/opt/local;/usr"}
-DCMAKE_MODULE_PATH=/opt/local/share/cmake/Modules
-DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -Wno-dev
-Dfoo
}}}
in other words, the -prepend feature works, but the `default
configure.args` statement doesn't. I also don't see how it could work and
expand the final value of cmake_install_rpath as a default/initial value
for configure.arg when there's no guarantee about the order in which
cmake_install_rpath and configure.args get elements appended or prepended.
The only thing I could imagine is to append `[join
${cmake_install_rpath}]` in a pre-configure block,but even then you cannot
be certain that the user will not add one of those too that touches
cmake_install_rpath.
--
Ticket URL: <https://trac.macports.org/ticket/52699#comment:21>
MacPorts <https://www.macports.org/>
Ports system for OS X
More information about the macports-tickets
mailing list