cegui icon indicating copy to clipboard operation
cegui copied to clipboard

A broken symlink named "!(*_d).dylib" gets created

Open ryandesign opened this issue 5 years ago • 0 comments

Hi, I'm working on getting cegui 0.8.7 into MacPorts and I noticed a bug.

cmake/CEGUIMacros.cmake contains this line (and another very much like it):

                COMMAND if test x${_CEGUI_BUILD_CONFIG} == xDebug \; then ce_ext=\"${CEGUI_BUILD_SUFFIX}\"\; ce_libglob=\"*${CEGUI_BUILD_SUFFIX}.dylib\"\; else ce_ext=\"\"\; shopt -s extglob\; ce_libglob=\"!\(*${CEGUI_BUILD_SUFFIX}\).dylib\"\; fi\; ${_ACTIONCMD} ${CMAKE_PREFIX_PATH}/lib/dynamic/$$ce_libglob \"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_TARGET_NAME}$$ce_ext.app/Contents/Frameworks/\"

This ends up generating code in a build.make file like this:

	cd somewhere && if test xMacPorts == xDebug ; then ce_ext="_d"; ce_libglob="*_d.dylib"; else ce_ext=""; shopt -s extglob; ce_libglob="!(*_d).dylib"; fi; ln -sf /opt/local/share/cmake/Modules/lib/dynamic/$$ce_libglob "somewhere/bin/CEGUISampleFramework-0.8$$ce_ext.app/Contents/Frameworks/"

This doesn't seem to do what you want. A symlink literally named "!(*_d).dylib" gets created, pointing to a nonexistent file. I think this happens because this code gets run by a shell that was spawned by make, and the shell that make spawns is sh, and sh doesn't understand shopt -s extglob.

ryandesign avatar Jul 16 '20 20:07 ryandesign