2022-07-07 07:11:51 -04:00
cmake_minimum_required ( VERSION 3.0 )
project ( discord-screenaudio )
set ( CMAKE_CXX_STANDARD 17 )
set ( CMAKE_INCLUDE_CURRENT_DIR ON )
set ( CMAKE_AUTOMOC ON )
set ( CMAKE_AUTORCC ON )
2022-07-09 16:07:14 -04:00
set ( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG" )
2022-07-07 07:11:51 -04:00
# set(CMAKE_AUTOUIC ON)
find_package ( Qt5 CONFIG REQUIRED COMPONENTS
W i d g e t s
W e b E n g i n e W i d g e t s
)
set ( discord-screenaudio_SRC
s r c / m a i n . c p p
s r c / m a i n w i n d o w . c p p
s r c / v i r t m i c . c p p
2022-07-09 16:07:14 -04:00
s r c / d i s c o r d p a g e . c p p
s r c / s t r e a m d i a l o g . c p p
2022-07-07 07:11:51 -04:00
r e s o u r c e s . q r c
)
2022-07-26 10:33:34 -04:00
# Adapted from https://cliutils.gitlab.io/modern-cmake/chapters/projects/submodule.html
find_package ( Git QUIET )
if ( GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git" )
option ( GIT_SUBMODULE "Check submodules during build" ON )
if ( GIT_SUBMODULE )
message ( STATUS "Updating submodules" )
2022-07-26 10:53:13 -04:00
execute_process ( COMMAND ${ GIT_EXECUTABLE } submodule update --init --recursive --checkout
2022-07-26 10:33:34 -04:00
W O R K I N G _ D I R E C T O R Y $ { C M A K E _ C U R R E N T _ S O U R C E _ D I R }
R E S U L T _ V A R I A B L E G I T _ S U B M O D _ R E S U L T )
if ( NOT GIT_SUBMOD_RESULT EQUAL "0" )
2022-07-26 10:53:13 -04:00
message ( FATAL_ERROR "`git submodule update --init --recursive --checkout` failed with ${GIT_SUBMOD_RESULT}, please provide the submodules manually" )
2022-07-26 10:33:34 -04:00
endif ( )
endif ( )
endif ( )
if ( NOT EXISTS "${PROJECT_SOURCE_DIR}/submodules/rohrkabel/CMakeLists.txt" )
message ( FATAL_ERROR "Rohrkabel was not found since you are not in a Git checkout or have GIT_SUBMODULE disabled. Please provide rohrkabel manually to `./submodules/rohrkabel`." )
endif ( )
add_subdirectory ( submodules/rohrkabel )
2022-07-07 07:11:51 -04:00
add_executable ( discord-screenaudio ${ discord-screenaudio_SRC } )
target_link_libraries ( discord-screenaudio Qt5::Widgets Qt5::WebEngineWidgets rohrkabel )
install ( TARGETS discord-screenaudio DESTINATION bin )
install ( PROGRAMS assets/discord-screenaudio.desktop DESTINATION ${ CMAKE_INSTALL_PREFIX } /share/applications )