Hi,everyone.
While using cmake to generate a code::blocks project, I met a problem. I
can not send argument to "int main(int argc,char *argv[])". I found some
suggestions like that: add arguments in "projects-send programs'
argument". It works in my testing project which is directly generated
by code::blocks, but if the project is generated by cmake, there is an
error "You can not run a commands-only target".
Also, I notice that the cmake project doesn't contain Debug/Releas
directories.
my test.cpp:
*********************************
#include <iostream>
int main(int argc,char* argv[])
{
std::cout << "argc:" << argc << std::endl;
std::cout << "argv:" << argv[1] << std::endl;
return 0;
}
************************************
my CMakeLists.txt
************************************
cmake_minimum_required(VERSION 2.8)
add_executable(hello hello.cpp)
*************************************
Hope someone can do me a favor,any suggestion will be appreciated.
_______________________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ
Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake