-
Notifications
You must be signed in to change notification settings - Fork 12
/
CMakeLists.txt
39 lines (30 loc) · 1.5 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
cmake_minimum_required(VERSION 3.5)
project(MayaIntersectionMarker VERSION 0.0.1)
add_definitions(-DPROJECT_VERSION="${PROJECT_VERSION}")
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
SET(MAYA_VERSION 2023 CACHE STRING "Maya version number")
SET(MODULE_NAME ${PROJECT_NAME} CACHE STRING "Name of the module")
file(GLOB_RECURSE SOURCE_FILES "src/*.*")
FIND_PACKAGE(Maya REQUIRED)
FIND_PACKAGE(OpenMP REQUIRED)
FIND_PACKAGE(embree 4.0 REQUIRED)
message(STATUS "MAYA_INCLUDE_DIR: ${MAYA_INCLUDE_DIR}")
message(STATUS "OPENGL_INCLUDE_DIRS: ${OPENGL_INCLUDE_DIRS}")
message(STATUS "GLUT_INCLUDE_DIRS: ${GLUT_INCLUDE_DIRS}")
message(STATUS "GLM_DIR: ${GLM_DIR}")
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT ${PROJECT_NAME})
include_directories(${MAYA_INCLUDE_DIR} maya lib ${OPENGL_INCLUDE_DIRS} ${GLUT_INCLUDE_DIRS} ${GLM_DIR})
link_directories(${MAYA_LIBRARY_DIR})
add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES})
target_link_libraries(${PROJECT_NAME} PRIVATE ${MAYA_LIBRARIES} ${OPENGL_LIBRARIES})
if(OpenMP_CXX_FOUND)
target_link_libraries(${PROJECT_NAME} PRIVATE OpenMP::OpenMP_CXX)
endif()
target_link_libraries(${PROJECT_NAME} PRIVATE embree)
get_property(dirs TARGET ${PROJECT_NAME} PROPERTY INCLUDE_DIRECTORIES)
foreach(dir ${dirs})
message(STATUS "dir='${dir}'")
endforeach()
MAYA_PLUGIN(${PROJECT_NAME})
install(TARGETS ${PROJECT_NAME} ${MAYA_TARGET_TYPE} DESTINATION ${MODULE_NAME}/plug-ins/win64/${MAYA_VERSION})