-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
56 lines (43 loc) · 1.67 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
cmake_minimum_required(VERSION 3.0)
project(HoudiniBifrost CXX)
add_definitions(-Wno-comment)
# HOUDINI
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake/modules/FindHoudini)
find_package(Houdini)
include_directories(${HOUDINI_INCLUDE})
link_directories(${HOUDINI_LIBRARIES})
# MAYA
if(NOT DEFINED MAYA_DIR)
message(FATAL_ERROR "MAYA_DIR cmake variable is not set.")
endif()
message(STATUS "Maya path:" ${MAYA_DIR})
find_path(MAYA_MGLOBAL MGlobal.h HINTS ${MAYA_DIR}/include/maya)
if(${MAYA_MGLOBAL} STREQUAL "MAYA_MGLOBAL-NOTFOUND")
message(FATAL_ERROR "MGlobal.h header has not been found in ${MAYA_DIR}/include/maya")
endif()
message(STATUS "Maya MGlobal.h: " ${MAYA_MGLOBAL})
include_directories(${MAYA_DIR}/include)
link_directories(${MAYA_DIR}/lib)
set(BIFROST_DIR ${MAYA_DIR}/plug-ins/bifrost)
# BIFROST
if(NOT DEFINED BIFROST_DIR)
message(FATAL_ERROR "BIFROST_DIR cmake variable is not set.")
endif()
message(STATUS "Bifrost: " ${BIFROST_DIR})
# Bifrsot header test
if(NOT EXISTS ${BIFROST_DIR}/include/modules/aminomath/api/aminomath/mat.h)
message(FATAL_ERROR "mat.h not found")
endif()
# Add Bifrost dirs
include_directories(${BIFROST_DIR}/include/modules)
link_directories(${BIFROST_DIR}/lib)
execute_process(COMMAND ls ${BIFROST_DIR}/include/modules/ OUTPUT_VARIABLE BIFROST_MODULES)
string(REPLACE "\n" ";" BIFROST_MODULES ${BIFROST_MODULES})
foreach(module ${BIFROST_MODULES})
include_directories(${BIFROST_DIR}/include/modules/${module}/api/)
endforeach()
# RPath dirs
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
set(CMAKE_INSTALL_RPATH ${BIFROST_DIR}/lib ${HOUDINI_DIR}/dsolib ${MAYA_DIR}/lib)
# Add src
add_subdirectory(src)