blob: 9c90314c96d7343428f8ec9d65d3b448867d0d0e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
cmake_minimum_required(VERSION 3.16)
if(NOT TARGET mo2::uibase)
find_package(mo2-uibase CONFIG REQUIRED)
endif()
add_library(runner SHARED
error.h
pythonrunner.cpp
pythonrunner.h
pythonutils.h
pythonutils.cpp
)
mo2_configure_target(runner
NO_SOURCES
WARNINGS 4
EXTERNAL_WARNINGS 4
AUTOMOC ON
TRANSLATIONS OFF
)
mo2_default_source_group()
target_link_libraries(runner PUBLIC mo2::uibase PRIVATE pybind11::embed pybind11::qt)
target_include_directories(runner PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_compile_definitions(runner PRIVATE RUNNER_BUILD)
if(NOT MSVC)
target_compile_options(runner PRIVATE -Wno-attributes)
endif()
if(NOT WIN32 AND Python_SHARED_LIBRARY)
get_filename_component(_pylib_name "${Python_SHARED_LIBRARY}" NAME)
target_compile_definitions(runner PRIVATE
MO2_PYTHON_SHARED_LIBRARY="${_pylib_name}")
endif()
# proxy will install runner
# force runner to build mobase
add_dependencies(runner mobase)
|