Cmake very simple set failure -
i trying start using cmake simplest helloworld example, in ubuntu 12.04, cmake 2.8.7. first tried 1 from:
http://www.elpauer.org/stuff/learning_cmake.pdf
project( helloworld ) set( srcfiles helloworld.cpp ) add_executable( helloworld ${srcfiles} )
i have source file called "helloworld.cpp" side of cmakelists.txt. created directory called "configure", went inside , called "cmake ..". following:
-- c compiler identification gnu -- cxx compiler identification gnu -- check working c compiler: /usr/bin/gcc -- check working c compiler: /usr/bin/gcc -- works -- detecting c compiler abi info -- detecting c compiler abi info - done -- check working cxx compiler: /usr/bin/c++ -- check working cxx compiler: /usr/bin/c++ -- works -- detecting cxx compiler abi info -- detecting cxx compiler abi info - done cmake error @ cmakelists.txt:3 (add_executable): add_executable called incorrect number of arguments -- configuring incomplete, errors occurred!
trying figure out wrong got following changes:
project( helloworld ) set( srcfiles helloworld.cpp ) message ( "src ${srcfiles}" ) set(x helloworld.cpp) set(y 2) message(${x}${y}) message(${x}${y}) message(${srcfiles}) add_executable( helloworld ${srcfiles} ) add_executable( helloworld ${x} ) add_executable( helloworld helloworld.cpp )
the results again finish with:
... -- detecting cxx compiler abi info - done src helloworld.cpp2 helloworld.cpp2 cmake error @ cmakelists.txt:8 (message): message called incorrect number of arguments cmake error @ cmakelists.txt:10 (add_executable): add_executable called incorrect number of arguments cmake error @ cmakelists.txt:11 (add_executable): add_executable called incorrect number of arguments cmake error @ cmakelists.txt:12 (add_executable): add_executable called incorrect number of arguments -- configuring incomplete, errors occurred!
finally, trivial
project( helloworld ) add_executable( helloworld helloworld.cpp )
fails with:
... -- detecting cxx compiler abi info - done cmake error @ cmakelists.txt:2 (add_executable): add_executable called incorrect number of arguments -- configuring incomplete, errors occurred!
before each trial remove files within compile. can't figure out missing , why variable set.. not set... useless?
thank help.
you copied same corrupted text webpage did. there must hidden character in text. re-writing line manually solved me.
Comments
Post a Comment