forked from serguei-k/maya-math-nodes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
80 lines (64 loc) · 2.4 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# Copyright (c) 2018-2021 Serguei Kalentchouk et al. All rights reserved.
# Use of this source code is governed by an MIT license that can be found in the LICENSE file.
# Define project
cmake_minimum_required(VERSION 3.3)
project(maya-math-nodes VERSION 1.6.0)
include(CMakePrintHelpers)
# Set project version macro
add_definitions(-DPROJECT_VERSION="${PROJECT_VERSION}")
# Set default Maya version
set(MAYA_VERSION 2023)
# Set node name prefix macro
set(NODE_NAME_PREFIX "math_")
add_definitions(-DNODE_NAME_PREFIX="${NODE_NAME_PREFIX}")
# Set compile flags
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
if(WIN32)
add_compile_options(/wd4068 /EHsc)
endif()
include_directories("${CMAKE_SOURCE_DIR}/../../../../shared/resources/maya/2023/devkit/include")
link_directories("${CMAKE_SOURCE_DIR}/../../../../shared/resources/maya/2023/devkit/lib")
# Create target
add_library(mayaMathNodes SHARED
src/Absolute.h
src/Add.h
src/Array.h
src/Condition.h
src/Clamp.h
src/Debug.h
src/Distance.h
src/Divide.h
src/Convert.h
src/Interpolate.h
src/Inverse.h
src/MinMax.h
src/Multiply.h
src/Negate.h
src/Plugin.cpp
src/Power.h
src/Round.h
src/Trig.h
src/Twist.h
src/Subtract.h
src/Utils.h
src/VectorOps.h)
TARGET_LINK_LIBRARIES(mayaMathNodes Foundation.lib OpenMaya.lib OpenMayaAnim.lib OpenMayaUI.lib OpenMayaRender.lib)
SET_TARGET_PROPERTIES(mayaMathNodes PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/plug-ins/${MAYA_VERSION}")
SET_TARGET_PROPERTIES(mayaMathNodes PROPERTIES OUTPUT_NAME mayaMathNodes)
SET_TARGET_PROPERTIES(mayaMathNodes PROPERTIES SUFFIX ".mll")
SET_TARGET_PROPERTIES(mayaMathNodes PROPERTIES CLEAN_DIRECT_OUTPUT 1)
SET_TARGET_PROPERTIES(mayaMathNodes PROPERTIES LINK_FLAGS "/export:initializePlugin /export:uninitializePlugin")
# Set installation directory
if(NOT DEFINED INSTALL_DIR)
set(INSTALL_DIR ${CMAKE_SOURCE_DIR}/dist)
endif()
configure_file(MayaMathNodes.mod.in MayaMathNodes.mod)
install(TARGETS mayaMathNodes
LIBRARY DESTINATION ${INSTALL_DIR}/MayaMathNodes/plug-ins/${MAYA_VERSION}
RUNTIME DESTINATION ${INSTALL_DIR}/MayaMathNodes/plug-ins/${MAYA_VERSION})
install(DIRECTORY python/maya_math_nodes
DESTINATION ${INSTALL_DIR}/MayaMathNodes/scripts
PATTERN "*.pyc" EXCLUDE
PATTERN ".*" EXCLUDE)
install(FILES ${CMAKE_BINARY_DIR}/MayaMathNodes.mod DESTINATION ${INSTALL_DIR})