- Build Type
-
cmake -DCMAKE_BUILD_TYPE=Debug/Release ..
- Dump all variables
function(dump_cmake_variables) get_cmake_property(_variableNames VARIABLES) list (SORT _variableNames) foreach (_variableName ${_variableNames}) if (ARGV0) unset(MATCHED) string(REGEX MATCH ${ARGV0} MATCHED ${_variableName}) if (NOT MATCHED) continue() endif() endif() message(STATUS "${_variableName}=${${_variableName}}") endforeach() endfunction()
- Q: 加了 link_directories, link 時仍找不到 library
- 確定 link_directories 指令加在 add_executable 之前
- Q: How to enable C++11?
-
set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON)
- 或是
ADD_DEFINITIONS( -std=c++11 # or -std=c++0x )
2020年10月7日 星期三
[CMake] FAQ
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言