3
A
回答
6
您可以使用CMAKE_SYSTEM_NAME
和CMAKE_SYSTEM_VERSION
## Check for Windows ##
if(WIN32) # true if windows (32 and 64 bit)
## Check for Version ##
if(${CMAKE_SYSTEM_VERSION} EQUAL 6.1) # Windows 7
# Do something here
elseif(${CMAKE_SYSTEM_VERSION} EQUAL 6.2) # Windows 8
# Do something here
else() # Some other Windows
# Do something here
endif()
endif()
相關問題
- 1. 在安裝時有cmake檢查版本
- 2. 木偶檢查Windows版本
- 3. 如何在Java中檢查Windows版本?
- 4. 檢查Windows註冊表版本c#
- 5. Python的檢查Windows服務器版本
- 6. 檢查Windows安裝程序版本
- 7. 如何檢查Windows上的OpenMP版本
- 8. cmake查找模塊wrt版本
- 9. NSIS檢測Windows版本
- 10. 檢查Flash版本的腳本沒有真正檢查版本
- 11. 檢查Pygame版本
- 12. 檢查Android版本
- 13. 檢查PEAR版本
- 14. Python版本檢查
- 15. 如何檢查Windows版本是否爲正版?
- 16. Bitbake git版本和cmake
- 17. Cmake更改破解版本
- 18. CMake目標版本增量
- 19. wix - 檢查Excel 2013版本
- 20. 如何檢查LS版本
- 21. 檢查G ++版本的Makefile
- 22. 檢查sdk版本,如果
- 23. 檢查互斥量版本
- 24. 的Android版本檢查
- 25. 檢查JIRA REST API版本?
- 26. 檢查版本在Perl
- 27. 哪個Java版本檢查
- 28. Apache版本檢查失敗
- 29. 檢查Tomcat 7版本linux
- 30. 檢查庫版本netcdf linux
您可以用'execute_process'和執行'ver'得到優化版本。 – bikram990