mirror of
https://github.com/strawberrymusicplayer/strawberry
synced 2024-12-15 10:14:43 +01:00
47 lines
1.5 KiB
CMake
47 lines
1.5 KiB
CMake
cmake_minimum_required(VERSION 3.0)
|
|
|
|
include(CheckIncludeFiles)
|
|
include(CheckFunctionExists)
|
|
|
|
if(CMAKE_VERSION VERSION_GREATER 3.0)
|
|
check_function_exists(geteuid HAVE_GETEUID)
|
|
check_function_exists(getpwuid HAVE_GETPWUID)
|
|
endif()
|
|
|
|
set(SINGLEAPP-SOURCES singleapplication.cpp singleapplication_p.cpp)
|
|
set(SINGLEAPP-MOC-HEADERS singleapplication.h singleapplication_p.h)
|
|
if(BUILD_WITH_QT6)
|
|
qt6_wrap_cpp(SINGLEAPP-SOURCES-MOC ${SINGLEAPP-MOC-HEADERS})
|
|
else()
|
|
qt5_wrap_cpp(SINGLEAPP-SOURCES-MOC ${SINGLEAPP-MOC-HEADERS})
|
|
endif()
|
|
add_library(singleapplication STATIC ${SINGLEAPP-SOURCES} ${SINGLEAPP-SOURCES-MOC})
|
|
target_include_directories(singleapplication PRIVATE
|
|
${CMAKE_CURRENT_SOURCE_DIR}
|
|
${CMAKE_CURRENT_BINARY_DIR}
|
|
)
|
|
target_link_libraries(singleapplication PRIVATE
|
|
${QtCore_LIBRARIES}
|
|
${QtWidgets_LIBRARIES}
|
|
${QtNetwork_LIBRARIES}
|
|
)
|
|
|
|
set(SINGLECOREAPP-SOURCES singlecoreapplication.cpp singlecoreapplication_p.cpp)
|
|
set(SINGLECOREAPP-MOC-HEADERS singlecoreapplication.h singlecoreapplication_p.h)
|
|
if(BUILD_WITH_QT6)
|
|
qt6_wrap_cpp(SINGLECOREAPP-SOURCES-MOC ${SINGLECOREAPP-MOC-HEADERS})
|
|
else()
|
|
qt5_wrap_cpp(SINGLECOREAPP-SOURCES-MOC ${SINGLECOREAPP-MOC-HEADERS})
|
|
endif()
|
|
add_library(singlecoreapplication STATIC ${SINGLECOREAPP-SOURCES} ${SINGLECOREAPP-SOURCES-MOC})
|
|
target_include_directories(singlecoreapplication PRIVATE
|
|
${CMAKE_CURRENT_SOURCE_DIR}
|
|
${CMAKE_CURRENT_BINARY_DIR}
|
|
)
|
|
target_link_libraries(singlecoreapplication PRIVATE
|
|
${QtCore_LIBRARIES}
|
|
${QtNetwork_LIBRARIES}
|
|
)
|
|
|
|
configure_file(config.h.in "${CMAKE_CURRENT_BINARY_DIR}/config.h")
|