Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(cmake): Allow targets to be enabled individually
Each major target of polybar can now be enabled/disabled while configuring (even polybar itself). The cmake code specific to each target will only run if the target is enabled. This allows us to for example just build the documentation without having to run all the cmake code related to compilation or having the polybar dependencies installed (other than sphinx).
- Loading branch information
Showing
14 changed files
with
379 additions
and
349 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
option(DISABLE_ALL "Set this to ON disable all targets. Individual targets can be enabled explicitly." OFF) | ||
|
||
# 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() | ||
|
||
if (BUILD_LIBPOLY OR BUILD_POLYBAR_MSG) | ||
set(HAS_CXX_COMPILATION ON) | ||
else() | ||
set(HAS_CXX_COMPILATION OFF) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.