2019-01-07 01:00:58 +01:00
|
|
|
cmake_minimum_required(VERSION 2.8.11)
|
2019-04-05 23:09:00 +02:00
|
|
|
|
2019-08-26 02:00:47 +02:00
|
|
|
include(CheckIncludeFiles)
|
|
|
|
include(CheckFunctionExists)
|
|
|
|
|
2019-04-05 23:09:00 +02:00
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
|
2019-01-07 01:00:58 +01:00
|
|
|
set(CMAKE_CXX_STANDARD 11)
|
2019-07-08 21:59:07 +02:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++11 -U__STRICT_ANSI__ -Wall -Woverloaded-virtual -Wno-sign-compare -fpermissive")
|
2019-01-11 01:04:13 +01:00
|
|
|
|
2019-09-15 20:27:32 +02:00
|
|
|
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra -Wimplicit-fallthrough=0 -Wpedantic")
|
|
|
|
endif()
|
|
|
|
|
2019-08-26 02:00:47 +02:00
|
|
|
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)
|
|
|
|
QT5_WRAP_CPP(SINGLEAPP-SOURCES-MOC ${SINGLEAPP-MOC-HEADERS})
|
|
|
|
ADD_LIBRARY(singleapplication STATIC ${SINGLEAPP-SOURCES} ${SINGLEAPP-SOURCES-MOC})
|
|
|
|
target_link_libraries(singleapplication Qt5::Core Qt5::Widgets Qt5::Network)
|
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)
|
|
|
|
QT5_WRAP_CPP(SINGLECOREAPP-SOURCES-MOC ${SINGLECOREAPP-MOC-HEADERS})
|
|
|
|
ADD_LIBRARY(singlecoreapplication STATIC ${SINGLECOREAPP-SOURCES} ${SINGLECOREAPP-SOURCES-MOC})
|
|
|
|
target_link_libraries(singlecoreapplication Qt5::Core Qt5::Widgets Qt5::Network)
|
2019-08-26 02:00:47 +02:00
|
|
|
|
|
|
|
configure_file(config.h.in "${CMAKE_CURRENT_BINARY_DIR}/config.h")
|
|
|
|
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|