Author: Stig-Ørjan Smelror Date: 2018-02-23 Subject: Encountered CMP0004 error Description: While compiling ecFlow with Python 3 support I encountered a CMP0004 error: Target "xxxx" links to item " -L/usr/lib64 -lpython3" which has leading or trailing whitespace. This is now an error according to policy CMP0004. The cause of this error is that $LIBPLUSED is not always set. The fix is to move this to the second place. Index: Python-3.6.2/Misc/python-config.sh.in =================================================================== --- Python-3.6.2/Misc/python-config.sh.in +++ Python-3.6.2/Misc/python-config.sh.in 2018-02-22 23:58:43.704175751 +0100 @@ -96,7 +96,7 @@ if [ "$PY_ENABLE_SHARED" = "0" ] ; then LIBPLUSED="-L$LIBPL" fi - echo "$LIBPLUSED -L$libdir $LIBS $LINKFORSHAREDUSED" + echo "-L$libdir $LIBPLUSED $LIBS $LINKFORSHAREDUSED" ;; --extension-suffix) echo "$SO"