2020-04-23 20:59:09 +02:00
|
|
|
cmake_minimum_required(VERSION 3.0)
|
2019-04-05 23:09:00 +02:00
|
|
|
|
2019-08-26 02:00:47 +02:00
|
|
|
include(CheckIncludeFiles)
|
|
|
|
include(CheckFunctionExists)
|
|
|
|
|
|
|
|
if(CMAKE_VERSION VERSION_GREATER 3.0)
|
|
|
|
check_function_exists(geteuid HAVE_GETEUID)
|
|
|
|
check_function_exists(getpwuid HAVE_GETPWUID)
|
|
|
|
endif()
|
|
|
|
|
2019-01-07 01:00:58 +01:00
|
|
|
set(SINGLEAPP-SOURCES singleapplication.cpp singleapplication_p.cpp)
|
|
|
|
set(SINGLEAPP-MOC-HEADERS singleapplication.h singleapplication_p.h)
|
2020-10-01 19:43:39 +02:00
|
|
|
if(BUILD_WITH_QT6)
|
2020-07-18 04:47:54 +02:00
|
|
|
qt6_wrap_cpp(SINGLEAPP-SOURCES-MOC ${SINGLEAPP-MOC-HEADERS})
|
|
|
|
else()
|
|
|
|
qt5_wrap_cpp(SINGLEAPP-SOURCES-MOC ${SINGLEAPP-MOC-HEADERS})
|
|
|
|
endif()
|
2020-04-23 20:59:09 +02:00
|
|
|
add_library(singleapplication STATIC ${SINGLEAPP-SOURCES} ${SINGLEAPP-SOURCES-MOC})
|
2020-06-26 23:26:04 +02:00
|
|
|
target_include_directories(singleapplication SYSTEM PRIVATE
|
2020-07-18 04:47:54 +02:00
|
|
|
${QtCore_INCLUDE_DIRS}
|
|
|
|
${QtWidgets_INCLUDE_DIRS}
|
|
|
|
${QtNetwork_INCLUDE_DIRS}
|
2020-06-17 22:56:20 +02:00
|
|
|
)
|
2020-06-26 23:26:04 +02:00
|
|
|
target_include_directories(singleapplication PRIVATE
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}
|
|
|
|
)
|
2020-06-17 22:56:20 +02:00
|
|
|
target_link_libraries(singleapplication PRIVATE
|
2020-07-18 04:47:54 +02:00
|
|
|
${QtCore_LIBRARIES}
|
|
|
|
${QtWidgets_LIBRARIES}
|
|
|
|
${QtNetwork_LIBRARIES}
|
2020-06-17 22:56:20 +02:00
|
|
|
)
|
2019-01-11 01:04:13 +01:00
|
|
|
|
|
|
|
set(SINGLECOREAPP-SOURCES singlecoreapplication.cpp singlecoreapplication_p.cpp)
|
|
|
|
set(SINGLECOREAPP-MOC-HEADERS singlecoreapplication.h singlecoreapplication_p.h)
|
2020-10-01 19:43:39 +02:00
|
|
|
if(BUILD_WITH_QT6)
|
2020-07-18 04:47:54 +02:00
|
|
|
qt6_wrap_cpp(SINGLECOREAPP-SOURCES-MOC ${SINGLECOREAPP-MOC-HEADERS})
|
|
|
|
else()
|
|
|
|
qt5_wrap_cpp(SINGLECOREAPP-SOURCES-MOC ${SINGLECOREAPP-MOC-HEADERS})
|
|
|
|
endif()
|
2020-04-23 20:59:09 +02:00
|
|
|
add_library(singlecoreapplication STATIC ${SINGLECOREAPP-SOURCES} ${SINGLECOREAPP-SOURCES-MOC})
|
2020-06-26 23:26:04 +02:00
|
|
|
target_include_directories(singlecoreapplication SYSTEM PRIVATE
|
2020-07-18 04:47:54 +02:00
|
|
|
${QtCore_INCLUDE_DIRS}
|
|
|
|
${QtNetwork_INCLUDE_DIRS}
|
2020-06-26 23:26:04 +02:00
|
|
|
)
|
2020-06-17 22:56:20 +02:00
|
|
|
target_include_directories(singlecoreapplication PRIVATE
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}
|
|
|
|
)
|
|
|
|
target_link_libraries(singlecoreapplication PRIVATE
|
2020-07-18 04:47:54 +02:00
|
|
|
${QtCore_LIBRARIES}
|
|
|
|
${QtNetwork_LIBRARIES}
|
2020-06-17 22:56:20 +02:00
|
|
|
)
|
2019-08-26 02:00:47 +02:00
|
|
|
|
|
|
|
configure_file(config.h.in "${CMAKE_CURRENT_BINARY_DIR}/config.h")
|