polybar-dwm/src/CMakeLists.txt

103 lines
2.6 KiB
CMake
Raw Normal View History

2016-06-15 03:32:35 +00:00
#
2017-01-26 16:17:02 +00:00
# Configure src
2016-06-15 03:32:35 +00:00
#
2016-05-19 14:41:06 +00:00
2017-01-26 16:17:02 +00:00
# Source tree {{{
2016-11-03 18:01:45 +00:00
2017-01-26 16:17:02 +00:00
file(GLOB_RECURSE files RELATIVE ${CMAKE_CURRENT_LIST_DIR} *.c[p]*)
list(REMOVE_ITEM files main.cpp ipc.cpp)
2016-10-24 23:46:26 +00:00
configure_file(
${CMAKE_CURRENT_LIST_DIR}/settings.cpp.cmake
${CMAKE_BINARY_DIR}/generated-sources/settings.cpp
ESCAPE_QUOTES)
list(APPEND files ${CMAKE_BINARY_DIR}/generated-sources/settings.cpp)
2017-01-26 16:17:02 +00:00
if(NOT ENABLE_ALSA)
list(REMOVE_ITEM files modules/alsa.cpp)
2017-01-26 16:17:02 +00:00
list(REMOVE_ITEM files adapters/alsa/control.cpp)
list(REMOVE_ITEM files adapters/alsa/mixer.cpp)
2016-11-02 19:22:45 +00:00
endif()
2017-01-26 16:17:02 +00:00
if(NOT ENABLE_CURL)
list(REMOVE_ITEM files modules/github.cpp)
list(REMOVE_ITEM files utils/http.cpp)
2016-11-02 19:22:45 +00:00
endif()
2017-01-26 16:17:02 +00:00
if(NOT ENABLE_MPD)
list(REMOVE_ITEM files modules/mpd.cpp)
list(REMOVE_ITEM files adapters/mpd.cpp)
2016-11-02 19:22:45 +00:00
endif()
2017-01-26 16:17:02 +00:00
if(NOT ENABLE_NETWORK)
list(REMOVE_ITEM files modules/network.cpp)
list(REMOVE_ITEM files adapters/net.cpp)
list(REMOVE_ITEM files adapters/net_iw.cpp)
list(REMOVE_ITEM files adapters/net_nl.cpp)
endif()
if(WITH_LIBNL)
list(REMOVE_ITEM files adapters/net_iw.cpp)
else()
list(REMOVE_ITEM files adapters/net_nl.cpp)
2016-11-26 14:42:48 +00:00
endif()
2017-01-26 16:17:02 +00:00
if(NOT ENABLE_I3)
list(REMOVE_ITEM files modules/i3.cpp)
list(REMOVE_ITEM files utils/i3.cpp)
endif()
if(NOT ENABLE_PULSEAUDIO)
list(REMOVE_ITEM files modules/pulseaudio.cpp)
list(REMOVE_ITEM files adapters/pulseaudio.cpp)
endif()
2017-01-26 16:17:02 +00:00
if(NOT WITH_XRANDR)
list(REMOVE_ITEM files x11/extensions/randr.cpp)
2016-11-26 14:42:48 +00:00
endif()
2017-01-26 16:17:02 +00:00
if(NOT WITH_XCOMPOSITE)
list(REMOVE_ITEM files x11/extensions/composite.cpp)
2016-10-24 23:46:26 +00:00
endif()
2017-01-26 16:17:02 +00:00
if(NOT WITH_XKB)
list(REMOVE_ITEM files x11/extensions/xkb.cpp)
list(REMOVE_ITEM files modules/xkeyboard.cpp)
2016-10-24 23:46:26 +00:00
endif()
2017-01-26 16:17:02 +00:00
if(NOT WITH_XRM)
list(REMOVE_ITEM files x11/xresources.cpp)
endif()
2017-09-06 06:35:29 +00:00
if(NOT WITH_XCURSOR)
list(REMOVE_ITEM files x11/cursor.cpp)
endif()
# }}}
2017-01-26 16:17:02 +00:00
# Target: polybar {{{
2016-11-20 22:04:31 +00:00
add_library(poly STATIC ${files})
target_include_directories(poly PUBLIC ${dirs})
target_link_libraries(poly ${libs} Threads::Threads)
target_compile_options(poly PUBLIC $<$<CXX_COMPILER_ID:GNU>:$<$<CONFIG:MinSizeRel>:-flto>>)
2016-11-20 22:04:31 +00:00
add_executable(polybar main.cpp)
target_link_libraries(polybar poly)
install(TARGETS polybar
DESTINATION ${CMAKE_INSTALL_BINDIR}
COMPONENT runtime)
2016-11-20 22:04:31 +00:00
# }}}
2017-01-26 16:17:02 +00:00
# Target: polybar-msg {{{
if(BUILD_IPC_MSG)
add_executable(polybar-msg
ipc.cpp
utils/env.cpp
utils/file.cpp
utils/string.cpp)
target_include_directories(polybar-msg PRIVATE ${dirs})
2017-01-26 16:17:02 +00:00
target_compile_options(polybar-msg PUBLIC $<$<CXX_COMPILER_ID:GNU>:$<$<CONFIG:MinSizeRel>:-flto>>)
install(TARGETS polybar-msg
DESTINATION ${CMAKE_INSTALL_BINDIR}
COMPONENT runtime)
endif()
# }}}
2016-10-24 23:46:26 +00:00
# Export source file list so that it can be used for test compilation
set(files ${files} PARENT_SCOPE)