2022-03-19 17:08:28 +00:00
|
|
|
cmake_minimum_required(VERSION 3.9.4)
|
2016-10-30 01:37:38 +00:00
|
|
|
project(LocalPeer)
|
|
|
|
|
2022-05-02 20:34:09 +01:00
|
|
|
if(QT_VERSION_MAJOR EQUAL 5)
|
|
|
|
find_package(Qt5 COMPONENTS Core Network REQUIRED)
|
|
|
|
elseif(Launcher_QT_VERSION_MAJOR EQUAL 6)
|
|
|
|
find_package(Qt6 COMPONENTS Core Network Core5Compat REQUIRED)
|
|
|
|
list(APPEND LocalPeer_LIBS Qt${QT_VERSION_MAJOR}::Core5Compat)
|
|
|
|
endif()
|
2016-10-30 01:37:38 +00:00
|
|
|
|
|
|
|
set(SINGLE_SOURCES
|
|
|
|
src/LocalPeer.cpp
|
|
|
|
src/LockedFile.cpp
|
|
|
|
src/LockedFile.h
|
|
|
|
include/LocalPeer.h
|
|
|
|
)
|
|
|
|
|
|
|
|
if(UNIX)
|
|
|
|
list(APPEND SINGLE_SOURCES
|
|
|
|
src/LockedFile_unix.cpp
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(WIN32)
|
|
|
|
list(APPEND SINGLE_SOURCES
|
|
|
|
src/LockedFile_win.cpp
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
add_library(LocalPeer STATIC ${SINGLE_SOURCES})
|
|
|
|
target_include_directories(LocalPeer PUBLIC include)
|
|
|
|
|
2022-05-02 20:34:09 +01:00
|
|
|
target_link_libraries(LocalPeer Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Network ${LocalPeer_LIBS})
|