1 2 3 4 5 6 7 | 1 #include<iostream> 2 3 int main() 4 { 5 std::cout<<"Hello word!"<<std::endl; 6 return 0; 7 } |
1 2 3 4 | 1 PROJECT(main) 2 CMAKE_MINIMUM_REQUIRED(VERSION 2.6) 3 AUX_SOURCE_DIRECTORY(. DIR_SRCS) 4 ADD_EXECUTABLE(main ${DIR_SRCS}) |
1 | aux_source_directory(<dir> <variable>) |
1 | cmake [options] <path-to-source> |
1 2 3 4 5 6 | 1 PROJECT(main) 2 CMAKE_MINIMUM_REQUIRED(VERSION 2.6) 3 ADD_SUBDIRECTORY( src ) 4 AUX_SOURCE_DIRECTORY(. DIR_SRCS) 5 ADD_EXECUTABLE(main ${DIR_SRCS} ) 6 TARGET_LINK_LIBRARIES( main Test ) |
1 2 | 1 AUX_SOURCE_DIRECTORY(. DIR_TEST1_SRCS) 2 ADD_LIBRARY ( Test ${DIR_TEST1_SRCS}) |
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |