forked from perseusrigging/perseus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
58 lines (45 loc) · 1.41 KB
/
CMakeLists.txt
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
cmake_minimum_required(VERSION 3.22)
project(perseus VERSION 1.0.1)
set(MAYA_LOCATION $ENV{MAYA_LOCATION})
set(MAYA_VERSION $ENV{REZ_MAYA_VERSION})
file(GLOB SOURCES perseus/source/*.cpp)
add_library(perseus MODULE ${SOURCES})
if(WIN32)
set(PLUGIN_SUFFIX .mll)
elseif(APPLE)
set(PLUGIN_SUFFIX .bundle)
else()
set(PLUGIN_SUFFIX .so)
endif()
if(APPLE)
set(MAYA_INCLUDE_DIR ${MAYA_LOCATION}/../../include)
set(MAYA_LIBRARY_DIR ${MAYA_LOCATION}/MacOS)
# maya 2024 supports arm64
target_compile_options(perseus PRIVATE -Wno-ignored-attributes)
set_target_properties(perseus PROPERTIES
CXX_STANDARD 14
COMPILE_FLAGS "-arch x86_64"
LINK_FLAGS "-arch x86_64")
else()
set(MAYA_INCLUDE_DIR ${MAYA_LOCATION}/include)
set(MAYA_LIBRARY_DIR ${MAYA_LOCATION}/lib)
endif()
set_target_properties(perseus PROPERTIES
PREFIX ""
SUFFIX ${PLUGIN_SUFFIX}
C_VISIBILITY_PRESET hidden
CXX_VISIBILITY_PRESET hidden
VISIBILITY_INLINES_HIDDEN YES
POSITION_INDEPENDENT_CODE ON)
target_include_directories(perseus PRIVATE
"perseus/source"
"${MAYA_INCLUDE_DIR}")
target_link_directories(perseus PRIVATE
"${MAYA_LIBRARY_DIR}")
target_link_libraries(perseus PRIVATE
Foundation
OpenMaya
OpenMayaAnim)
install(TARGETS perseus DESTINATION plug-ins)
file(GLOB MELSCRIPTS perseus/modules/perseus/scripts/*.mel)
install(FILES ${MELSCRIPTS} DESTINATION scripts)