Warning: Argument not separated from preceding token by whitespace.

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Warning: Argument not separated from preceding token by whitespace.

ycollette.nospam
Hello,

I've got the following code in a cmake file:

109 add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/tmp-pcode-matlab/knitromatlab_fsolve.p
110                           ${CMAKE_BINARY_DIR}/tmp-pcode-matlab/knitromatlab_lsqnonlin.p
111                           ${CMAKE_BINARY_DIR}/tmp-pcode-matlab/knitromatlab_mip.p
112                    COMMAND ${Matlab_MAIN_PROGRAM} -nodisplay -nodesktop -nosplash -r \"run('${CMAKE_BINARY_DIR}/generate_pcode.m')\;\"
113                    WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
114                    COMMENT "Generating PCode")


When I run cmake, I've got the following warning message:

CMake Warning (dev) in matlab/CMakeLists.txt:
  Syntax Warning in cmake code at

    /home/jenkins/workspace/Knitro/KnitroLinux/KNITROdir/matlab/CMakeLists.txt:112:131

  Argument not separated from preceding token by whitespace.
This warning is for project developers.  Use -Wno-dev to suppress it.

I have tried several combinations of ;,\\", \\\\", ... and  I haven't found any solution to get rid of this warning.
What is the correct syntax for this line ?

Best regards,

YC
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Warning: Argument not separated from preceding token by whitespace.

Nils Gladitz-2
On Mon, Jun 26, 2017 at 10:33 AM, <[hidden email]> wrote:
Hello,

I've got the following code in a cmake file:

109 add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/tmp-pcode-matlab/knitromatlab_fsolve.p
110                           ${CMAKE_BINARY_DIR}/tmp-pcode-matlab/knitromatlab_lsqnonlin.p
111                           ${CMAKE_BINARY_DIR}/tmp-pcode-matlab/knitromatlab_mip.p
112                    COMMAND ${Matlab_MAIN_PROGRAM} -nodisplay -nodesktop -nosplash -r \"run('${CMAKE_BINARY_DIR}/generate_pcode.m')\;\"
113                    WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
114                    COMMENT "Generating PCode")


When I run cmake, I've got the following warning message:

CMake Warning (dev) in matlab/CMakeLists.txt:
  Syntax Warning in cmake code at

    /home/jenkins/workspace/Knitro/KnitroLinux/KNITROdir/matlab/CMakeLists.txt:112:131


Try:

add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/tmp-pcode-matlab/knitromatlab_fsolve.p
     ${CMAKE_BINARY_DIR}/tmp-pcode-matlab/knitromatlab_lsqnonlin.p
     ${CMAKE_BINARY_DIR}/tmp-pcode-matlab/knitromatlab_mip.p
     COMMAND ${Matlab_MAIN_PROGRAM} -nodisplay -nodesktop -nosplash -r "run('${CMAKE_BINARY_DIR}/generate_pcode.m');"
     VERBATIM
     WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
     COMMENT "Generating PCode")

Note the removal of all escape sequences and the addition of VERBATIM.
You don't want literal quotes but rather want to leave platform/generator specific quoting to CMake.

Nils

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Warning: Argument not separated from preceding token by whitespace.

ycollette.nospam
Thanks a lot, it works fine.

----- Mail original -----
De: "Nils Gladitz" <[hidden email]>
À: "ycollette nospam" <[hidden email]>
Cc: "cmake" <[hidden email]>
Envoyé: Lundi 26 Juin 2017 12:50:42
Objet: Re: [CMake] Warning: Argument not separated from preceding token by whitespace.


On Mon, Jun 26, 2017 at 10:33 AM, < [hidden email] > wrote:




Hello,

I've got the following code in a cmake file:

109 add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/tmp-pcode-matlab/knitromatlab_fsolve.p
110 ${CMAKE_BINARY_DIR}/tmp-pcode-matlab/knitromatlab_lsqnonlin.p
111 ${CMAKE_BINARY_DIR}/tmp-pcode-matlab/knitromatlab_mip.p
112 COMMAND ${Matlab_MAIN_PROGRAM} -nodisplay -nodesktop -nosplash -r \"run('${CMAKE_BINARY_DIR}/generate_pcode.m')\;\"
113 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
114 COMMENT "Generating PCode")


When I run cmake, I've got the following warning message:

CMake Warning (dev) in matlab/CMakeLists.txt:
Syntax Warning in cmake code at

/home/jenkins/workspace/Knitro/KnitroLinux/KNITROdir/matlab/CMakeLists.txt:112:131



Try:

add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/tmp-pcode-matlab/knitromatlab_fsolve.p
${CMAKE_BINARY_DIR}/tmp-pcode-matlab/knitromatlab_lsqnonlin.p
${CMAKE_BINARY_DIR}/tmp-pcode-matlab/knitromatlab_mip.p
COMMAND ${Matlab_MAIN_PROGRAM} -nodisplay -nodesktop -nosplash -r "run('${CMAKE_BINARY_DIR}/generate_pcode.m');"
VERBATIM

WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMENT "Generating PCode")

Note the removal of all escape sequences and the addition of VERBATIM.

You don't want literal quotes but rather want to leave platform/generator specific quoting to CMake.



Nils
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Loading...