-
Notifications
You must be signed in to change notification settings - Fork 6
/
CMakeLists.txt
69 lines (49 loc) · 1.58 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
cmake_minimum_required(VERSION 2.8)
set(CMAKE_SUPPRESS_REGENERATION "1")
project(MayaMeshTools)
set(CMAKE_DEBUG_POSTFIX "_d")
include_directories(${PROJECT_SOURCE_DIR})
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
if(WIN32)
add_definitions(-DNT_PLUGIN)
endif()
if(UNIX)
add_definitions(-DREQUIRE_IOSTREAM)
add_compile_options(-fPIC -m64)
set(PLUGIN_SUFFIX ".so")
set(CMAKE_SHARED_LIBRARY_SUFFIX ".so")
set(SUFFIX ".so")
set(STD_INCLUDES "." ".." "/usr/X11R6/include" "/usr/include" "/usr/include/CC")
include_directories(${STD_INCLUDES})
add_definitions(-DLINUX)
endif()
subdirs(
extern/mzd
)
add_library(MayaMeshTools SHARED
src/FileSystem.h
src/PluginMain.cpp
src/MeshLoader.cpp
src/MeshLoader.h
)
find_package(Maya)
if (MAYA_FOUND)
include_directories(${MAYA_INCLUDE_DIR})
target_link_libraries (MayaMeshTools ${MAYA_LIBRARIES})
endif ()
if(WIN32)
target_link_libraries(MayaMeshTools opengl32.lib glu32.lib mzd)
else()
target_link_libraries(MayaMeshTools GL GLU mzd)
endif()
add_dependencies(MayaMeshTools mzd)
include_directories(${CMAKE_SOURCE_DIR}/extern/mzd)
include_directories(${CMAKE_SOURCE_DIR}/extern/happly)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
#set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin")
#set(LIBRARY_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/lib)
MAYA_PLUGIN(MayaMeshTools)
add_custom_command(TARGET MayaMeshTools PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_SOURCE_DIR}/scripts $<TARGET_FILE_DIR:MayaMeshTools>/scripts)