2022-04-04 18:06:43 +02:00
|
|
|
project(ScreenPlayWorkshop
|
|
|
|
VERSION 0.1
|
|
|
|
LANGUAGES CXX)
|
2021-10-15 15:06:05 +02:00
|
|
|
|
2021-07-16 11:14:21 +02:00
|
|
|
|
|
|
|
set(CMAKE_AUTOMOC ON)
|
|
|
|
set(CMAKE_CXX_STANDARD 20)
|
2022-04-04 18:06:43 +02:00
|
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
2021-07-16 11:14:21 +02:00
|
|
|
|
|
|
|
find_package(
|
2021-09-10 11:09:38 +02:00
|
|
|
Qt6
|
2021-12-02 15:31:05 +01:00
|
|
|
COMPONENTS Quick Widgets Gui
|
2021-07-16 16:44:28 +02:00
|
|
|
REQUIRED)
|
2021-07-16 11:14:21 +02:00
|
|
|
|
2022-04-04 18:06:43 +02:00
|
|
|
|
|
|
|
set(QML
|
|
|
|
src/TestMain.qml)
|
|
|
|
|
2021-10-15 15:06:05 +02:00
|
|
|
set(SOURCES
|
2022-04-04 18:06:43 +02:00
|
|
|
|
2021-10-15 15:06:05 +02:00
|
|
|
src/installedlistmodel.cpp
|
2022-03-12 14:36:03 +01:00
|
|
|
src/steamaccount.cpp
|
|
|
|
src/steamapiwrapper.cpp
|
|
|
|
src/steamqmlimageprovider.cpp
|
2021-10-15 15:06:05 +02:00
|
|
|
src/steamworkshop.cpp
|
2022-03-12 14:36:03 +01:00
|
|
|
src/steamworkshopitem.cpp
|
2021-10-15 15:06:05 +02:00
|
|
|
src/steamworkshoplistmodel.cpp
|
2022-03-12 14:36:03 +01:00
|
|
|
src/workshop.cpp)
|
2021-10-15 15:06:05 +02:00
|
|
|
|
|
|
|
set(HEADER
|
2022-04-04 18:06:43 +02:00
|
|
|
|
2022-03-12 14:36:03 +01:00
|
|
|
src/installedlistmodel.h
|
|
|
|
src/steamaccount.h
|
2021-10-15 15:06:05 +02:00
|
|
|
src/steamapiwrapper.h
|
2022-03-12 14:36:03 +01:00
|
|
|
src/steamqmlimageprovider.h
|
|
|
|
src/steamworkshop.h
|
|
|
|
src/steamworkshopitem.h
|
2021-07-16 11:14:21 +02:00
|
|
|
src/steamworkshoplistmodel.h
|
|
|
|
src/uploadlistmodel.h
|
|
|
|
src/workshop.h
|
2022-03-12 14:36:03 +01:00
|
|
|
src/workshopitem.h)
|
2021-10-15 15:06:05 +02:00
|
|
|
|
|
|
|
set(STEAM_LIB_PATH "${CMAKE_CURRENT_SOURCE_DIR}/SteamSDK/redistributable_bin/")
|
2021-07-16 11:14:21 +02:00
|
|
|
|
|
|
|
if(WIN32)
|
2021-11-12 15:26:24 +01:00
|
|
|
set(WORKSHOP_PLUGIN_DIR ${CMAKE_BINARY_DIR}/bin/Workshop)
|
2021-10-15 15:06:05 +02:00
|
|
|
set(STEAM_LIB "${STEAM_LIB_PATH}/win64/steam_api64.lib")
|
|
|
|
set(STEAM_BIN "${STEAM_LIB_PATH}/win64/steam_api64.dll")
|
2021-07-16 11:14:21 +02:00
|
|
|
elseif(APPLE)
|
2021-11-12 15:26:24 +01:00
|
|
|
set(WORKSHOP_PLUGIN_DIR ${CMAKE_BINARY_DIR}/bin/ScreenPlay.app/Contents/MacOS/Workshop)
|
2021-12-18 13:24:03 +01:00
|
|
|
set(MACOS_FRAMEWORKS_DIR ${CMAKE_BINARY_DIR}/bin/ScreenPlay.app/Contents/Frameworks/)
|
2021-10-15 15:06:05 +02:00
|
|
|
set(STEAM_LIB "${STEAM_LIB_PATH}/osx/libsteam_api.dylib")
|
|
|
|
set(STEAM_BIN ${STEAM_LIB})
|
2021-07-16 11:14:21 +02:00
|
|
|
elseif(UNIX)
|
2021-11-12 15:26:24 +01:00
|
|
|
set(WORKSHOP_PLUGIN_DIR ${CMAKE_BINARY_DIR}/bin/Workshop)
|
2021-10-15 15:06:05 +02:00
|
|
|
set(STEAM_LIB "${STEAM_LIB_PATH}/linux64/libsteam_api.so")
|
|
|
|
set(STEAM_BIN ${STEAM_LIB})
|
2021-07-16 11:14:21 +02:00
|
|
|
endif()
|
|
|
|
|
2022-04-04 18:06:43 +02:00
|
|
|
qt_add_library(${PROJECT_NAME} STATIC)
|
|
|
|
# Needed by the automatic generated target missing includes
|
|
|
|
# https://github.com/qt/qtdeclarative/blob/7a7064e14f094e843e1ee832cc927e86f887621a/src/qml/Qt6QmlMacros.cmake#L2042
|
|
|
|
target_include_directories(${PROJECT_NAME} PUBLIC src/)
|
2022-03-12 14:36:03 +01:00
|
|
|
target_link_libraries(
|
|
|
|
${PROJECT_NAME}
|
2022-04-04 18:06:43 +02:00
|
|
|
PUBLIC Qt6::Core
|
2022-03-12 14:36:03 +01:00
|
|
|
Qt6::Quick
|
|
|
|
${STEAM_LIB}
|
|
|
|
ScreenPlayUtil
|
2022-04-04 18:06:43 +02:00
|
|
|
SteamSDK
|
|
|
|
SteamSDKQtEnums)
|
2021-12-18 13:24:03 +01:00
|
|
|
|
2021-11-12 15:26:24 +01:00
|
|
|
qt_add_qml_module(
|
|
|
|
${PROJECT_NAME}
|
2021-12-31 13:32:37 +01:00
|
|
|
URI
|
|
|
|
"Workshop"
|
2022-04-04 18:06:43 +02:00
|
|
|
OUTPUT_DIRECTORY
|
|
|
|
${WORKSHOP_PLUGIN_DIR}
|
|
|
|
VERSION
|
|
|
|
1.0
|
|
|
|
QML_FILES
|
|
|
|
${QML}
|
2021-12-31 13:32:37 +01:00
|
|
|
SOURCES
|
|
|
|
${SOURCES}
|
2022-04-04 18:06:43 +02:00
|
|
|
${HEADER})
|
2021-07-16 11:14:21 +02:00
|
|
|
|
2021-12-18 13:24:03 +01:00
|
|
|
if(${SCREENPLAY_STEAM})
|
|
|
|
if(APPLE)
|
2021-12-31 13:32:37 +01:00
|
|
|
file(MAKE_DIRECTORY ${WORKSHOP_PLUGIN_DIR})
|
|
|
|
file(MAKE_DIRECTORY ${MACOS_FRAMEWORKS_DIR})
|
2021-07-25 12:26:55 +02:00
|
|
|
|
2021-12-31 13:32:37 +01:00
|
|
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/steam_appid.txt ${CMAKE_BINARY_DIR}/bin/ScreenPlay.app/Contents/MacOS/ COPYONLY)
|
|
|
|
configure_file(${STEAM_BIN} ${WORKSHOP_PLUGIN_DIR} COPYONLY)
|
2021-12-18 13:24:03 +01:00
|
|
|
|
2021-12-31 13:32:37 +01:00
|
|
|
set_target_properties(${PROJECT_NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY
|
|
|
|
${CMAKE_BINARY_DIR}/bin/ScreenPlay.app/Contents/MacOS/Workshop)
|
2021-12-18 13:24:03 +01:00
|
|
|
else()
|
2021-08-14 12:59:43 +02:00
|
|
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/steam_appid.txt ${CMAKE_BINARY_DIR}/bin/steam_appid.txt COPYONLY)
|
2021-11-12 15:26:24 +01:00
|
|
|
configure_file(${STEAM_BIN} ${CMAKE_BINARY_DIR}/bin/ COPYONLY)
|
2021-08-14 12:59:43 +02:00
|
|
|
endif()
|
2021-07-16 11:36:02 +02:00
|
|
|
endif()
|
2021-11-12 15:26:24 +01:00
|
|
|
|
2022-04-04 18:06:43 +02:00
|
|
|
#if(${SCREENPLAY_TESTS})
|
|
|
|
# qt_add_executable(tst_ScreenPlayWorkshop src/TestMain.cpp)
|
|
|
|
# target_link_libraries(tst_ScreenPlayWorkshop PRIVATE Qt6::Quick ${PROJECT_NAME}plugin)
|
|
|
|
# target_compile_definitions(tst_ScreenPlayWorkshop PRIVATE $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:QT_QML_DEBUG>)
|
|
|
|
#endif()
|