-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
59 lines (46 loc) · 1.33 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# CMakeLists.txt for libyui-mga-ncurses
#
# Usage:
#
# mkdir build
# cd build
# cmake ..
#
# make
# sudo make install
#
# Restart with a clean build environment:
# rm -rf build
#
# Show the complete compiler commands with all arguments:
# make VERBOSE=1
cmake_minimum_required( VERSION 3.17 )
project( libyui-mga-ncurses )
# Options usage:
#
# cmake -DBUILD_DOC=on -DBUILD_EXAMPLES=off ..
option( BUILD_SRC "Build in src/ subdirectory" on )
option( BUILD_DOC "Build class documentation" off )
option( WERROR "Treat all compiler warnings as errors" off )
# Non-boolean options
set( DOC_DESTDIR "" CACHE STRING "Destination directory prefix for installing docs" )
#----------------------------------------------------------------------
set( CMAKE_INSTALL_MESSAGE LAZY ) # Suppress "up-to-date" messages during "make install"
add_compile_options( "-Wall" )
IF (NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
# Initialize compiler flags for all targets in all subdirectories
add_compile_options( "-Os" ) # Optimize for size (overrides CMake's -O3 in RELEASE builds)
endif()
if ( WERROR )
add_compile_options( "-Werror" )
endif()
#
# Descend into subdirectories
#
if ( BUILD_SRC )
add_subdirectory( src )
endif()
# TODO
#if ( BUILD_DOC )
# add_subdirectory( doc )
#endif()