美文网首页
CMake Options without GUI

CMake Options without GUI

作者: XBruce | 来源:发表于2021-09-03 14:50 被阅读0次

cmake -LA

To list all option( and set( CACHE (cached) variables do:

mkdir build
cd build
cmake ..
cmake -LA | awk '{if(f)print} /-- Cache values/{f=1}'

Sample stdout:

AUTOGEMM_ARCHITECTURE:STRING=Hawaii
BLAS_DEBUG_TOOLS:BOOL=OFF
BLAS_DUMP_CLBLAS_KERNELS:BOOL=OFF
BLAS_KEEP_KERNEL_SOURCES:BOOL=ON
BLAS_PRINT_BUILD_ERRORS:BOOL=O

The -A switch also show options marked as advanced, so you will likely want to omit it when casually browsing the most useful options.

ccmake ncurses

sudo apt-get install cmake-curses-gui
ccmake ..

shows:

image.png

You can do cmake -LAH too. The H flag will provide you help for each option.

Another solution is to print these variables at the end of my CMakeLists.txt to see the settings.

MESSAGE(STATUS "Build type: " {CMAKE_BUILD_TYPE}) MESSAGE(STATUS "Library Type: "{LIB_TYPE})
MESSAGE(STATUS "Compiler flags:" {CMAKE_CXX_COMPILE_FLAGS}) MESSAGE(STATUS "Compiler cxx debug flags:"{CMAKE_CXX_FLAGS_DEBUG})
MESSAGE(STATUS "Compiler cxx release flags:" {CMAKE_CXX_FLAGS_RELEASE}) MESSAGE(STATUS "Compiler cxx min size flags:"{CMAKE_CXX_FLAGS_MINSIZEREL})
MESSAGE(STATUS "Compiler cxx flags:" ${CMAKE_CXX_FLAGS})

相关文章

网友评论

      本文标题:CMake Options without GUI

      本文链接:https://www.haomeiwen.com/subject/fkdkwltx.html