2016-11-03 12:06:33 +00:00
|
|
|
#
|
|
|
|
# Core setup
|
|
|
|
#
|
2020-12-22 11:19:46 +00:00
|
|
|
option(DISABLE_ALL "Set this to ON disable all targets. Individual targets can be enabled explicitly." OFF)
|
2017-01-26 16:17:02 +00:00
|
|
|
|
2020-12-22 11:19:46 +00:00
|
|
|
# If all targets are disabled, we set the default value for options that are on
|
|
|
|
# by default to OFF
|
|
|
|
if (DISABLE_ALL)
|
|
|
|
set(DEFAULT_ON OFF)
|
|
|
|
else()
|
|
|
|
set(DEFAULT_ON ON)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
option(BUILD_POLYBAR "Build the main polybar executable" ${DEFAULT_ON})
|
|
|
|
option(BUILD_POLYBAR_MSG "Build polybar-msg" ${DEFAULT_ON})
|
|
|
|
option(BUILD_TESTS "Build testsuite" OFF)
|
|
|
|
option(BUILD_DOC "Build documentation" ${DEFAULT_ON})
|
|
|
|
|
|
|
|
if (BUILD_POLYBAR OR BUILD_TESTS)
|
|
|
|
set(BUILD_LIBPOLY ON)
|
|
|
|
else()
|
|
|
|
set(BUILD_LIBPOLY OFF)
|
|
|
|
endif()
|
2016-11-03 12:06:33 +00:00
|
|
|
|
2020-12-22 11:19:46 +00:00
|
|
|
if (BUILD_LIBPOLY OR BUILD_POLYBAR_MSG)
|
|
|
|
set(HAS_CXX_COMPILATION ON)
|
|
|
|
else()
|
|
|
|
set(HAS_CXX_COMPILATION OFF)
|
|
|
|
endif()
|
2017-01-26 16:17:02 +00:00
|
|
|
|
2016-11-03 12:06:33 +00:00
|
|
|
# Export compile commands used for custom targets
|
|
|
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
|
|
|
|
|
|
|
# Set default build type if not specified
|
|
|
|
if(NOT CMAKE_BUILD_TYPE)
|
2018-12-23 21:38:05 +00:00
|
|
|
set(CMAKE_BUILD_TYPE "Release")
|
|
|
|
message_colored(STATUS "No build type specified; using ${CMAKE_BUILD_TYPE}" 33)
|
2016-11-03 12:06:33 +00:00
|
|
|
endif()
|
2017-01-27 12:30:23 +00:00
|
|
|
string(TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_UPPER)
|