-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
62 lines (50 loc) · 1.34 KB
/
CMakeLists.txt
File metadata and controls
62 lines (50 loc) · 1.34 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
cmake_minimum_required(VERSION 3.17)
set(PLATFORM "win" CACHE STRING "Platform")
set(ARCH "x64" CACHE STRING "Arch")
message(STATUS "PLATFORM: ${PLATFORM}")
message(STATUS "ARCH: ${ARCH}")
# Projet name
project(ZeDMD_ext DESCRIPTION "Python cross-platform library for communicating with ZeDMD.")
set(PYBIND11_FINDPYTHON ON)
find_package(pybind11 REQUIRED)
set(WIN64 "")
set(LIBWIN "")
if(PLATFORM STREQUAL "win")
if(ARCH STREQUAL "x86")
add_compile_definitions(WIN32)
elseif(ARCH STREQUAL "x64")
set(WIN64 "64")
endif()
set(LIBWIN "lib")
elseif(PLATFORM STREQUAL "macos")
if (ARCH STREQUAL "arm64")
set(CMAKE_SYSTEM_PROCESSOR arm64)
set(CMAKE_OSX_ARCHITECTURES arm64)
elseif(ARCH STREQUAL "x64")
set(CMAKE_SYSTEM_PROCESSOR x86_64)
set(CMAKE_OSX_ARCHITECTURES x86_64)
endif()
endif()
include_directories(
extern/libzedmd/src
)
add_library(extending MODULE extending.cpp)
target_link_directories(extending PRIVATE
extern/libzedmd/build
extern/libzedmd/third-party/build-libs/${PLATFORM}/${ARCH}
)
target_link_libraries(extending PRIVATE
pybind11::module
zedmd${WIN64}
${LIBWIN}serialport${WIN64}
)
if(PLATFORM STREQUAL "win")
set_target_properties(extending PROPERTIES
PREFIX ""
SUFFIX ".pyd"
)
else()
set_target_properties(extending PROPERTIES
PREFIX ""
)
endif()