D_CRT_SECURE_NO_WARNINGS -D_WIN32_WINNT=0x601 -D_WINSOCK_DEPRECATED_NO_WARNINGS) endif() if(${CMAKE_BUILD_TYPE} MATCHES "debug") ... else() ... endif() 10.2 while…endwhile while(condition) ... endwhile() 10.3 foreach…endforeach foreach(loop_var RANGE start stop [step]) .....
-D_WIN32_WINNT=0x601 -D_WINSOCK_DEPRECATED_NO_WARNINGS)endif()if(${CMAKE_BUILD_TYPE} MATCHES "debug") ...else() ...endif() while break continue foreach end_while end_foreach 其他常用命令 message 显示一些消息 message(${MY_VAR})message("build with debug mode")message(WARNING"this is...
D_CRT_SECURE_NO_WARNINGS -D_WIN32_WINNT=0x601 -D_WINSOCK_DEPRECATED_NO_WARNINGS) endif() if(${CMAKE_BUILD_TYPE} MATCHES "debug") ... else() ... endif() 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 2. while…endwhile while...
if(MSVC) add_definitions(-D_WIN32_WINNT=0x600) endif() 1. 2. 3. 4. 5. 6. include_directories 关键字 添加头文件目录,相当于 gcc/g++ 命令的-I参数的功能,如 # 类似 gcc/g++ 中的 -I 选项 include_directories(../include) 1. 2. 也可以添加一个CPLUS_INCLUDE_PATH环境变量,并将目录追加到...
-D_WIN32_WINNT=0x601 -D_WINSOCK_DEPRECATED_NO_WARNINGS) endif() if(${CMAKE_BUILD_TYPE} MATCHES"debug") ... else() ... endif() 10.2 while…endwhile while(condition) ... endwhile() 10.3 foreach…endforeach foreach(loop_var RANGEstartstop [step]) ...
endif() if(UNIX) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fpermissive -g") else() add_definitions(-D_SCL_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -D_WIN32_WINNT=0x601 -D_WINSOCK_DEPRECATED_NO_WARNINGS) endif() 3-3、while循环语句 while(condition) ... endwhile(...
()target_link_libraries(demo${LINK_LIBS})#或者if(UNIX)set(CMAKE_CXX_FLAGS"${CMAKE_CXX_FLAGS} -std=c++11 -fpermissive -g")else()add_definitions(-D_SCL_SECURE_NO_WARNINGSD_CRT_SECURE_NO_WARNINGS-D_WIN32_WINNT=0x601-D_WINSOCK_DEPRECATED_NO_WARNINGS)endif()if(${CMAKE_BUILD_TYPE}...
-D_WIN32_WINNT=0x601 -D_WINSOCK_DEPRECATED_NO_WARNINGS) endif() if(${CMAKE_BUILD_TYPE} MATCHES "debug") ... else() ... endif() while…endwhile while(condition) ... endwhile() foreach…endforeach foreach(loop_var RANGE start stop [step]) ...
{LINK_LIBS})# 或者if(UNIX)set(CMAKE_CXX_FLAGS"${CMAKE_CXX_FLAGS} -std=c++11 -fpermissive -g")else()add_definitions(-D_SCL_SECURE_NO_WARNINGSD_CRT_SECURE_NO_WARNINGS-D_WIN32_WINNT=0x601-D_WINSOCK_DEPRECATED_NO_WARNINGS)endif()if(${CMAKE_BUILD_TYPE}MATCHES"debug")...else()......
-D_WIN32_WINNT=0x601 -D_WINSOCK_DEPRECATED_NO_WARNINGS) endif() if(${CMAKE_BUILD_TYPE} MATCHES "debug") ... else() ... endif() (2)while...endwhile while(condition) ... endwhile() (3)foreach...endforeach foreach(loop_var RANGE start stop [step]) ...