forked from bareya/hdcycles_for_houdini
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
82 lines (64 loc) · 3.08 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
81
82
cmake_minimum_required(VERSION 3.18)
project(HdCyclesForHoudini NONE)
include(ExternalProject)
list(APPEND CONFIGURE_FLAGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER})
list(APPEND CONFIGURE_FLAGS -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER})
list(APPEND CONFIGURE_FLAGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE})
list(APPEND CONFIGURE_FLAGS -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=ON)
list(APPEND CONFIGURE_FLAGS -DCMAKE_POSITION_INDEPENDENT_CODE=ON)
list(APPEND CONFIGURE_FLAGS -DCMAKE_CXX_STANDARD=14)
list(APPEND CONFIGURE_FLAGS -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX})
list(APPEND CONFIGURE_FLAGS -DCMAKE_CXX_FLAGS="-D_GLIBCXX_USE_CXX11_ABI=0")
list(APPEND CONFIGURE_FLAGS -DCMAKE_PREFIX_PATH=${CMAKE_INSTALL_PREFIX}/lib/cmake)
# gflags
list(APPEND GFLAGS_CONFIGURE_FLAGS ${CONFIGURE_FLAGS})
ExternalProject_Add(gflags
GIT_REPOSITORY https://github.com/gflags/gflags.git
GIT_SHALLOW TRUE
CONFIGURE_COMMAND ${CMAKE_COMMAND} <SOURCE_DIR> ${GFLAGS_CONFIGURE_FLAGS}
BUILD_COMMAND ${CMAKE_COMMAND} -E echo ""
INSTALL_COMMAND ${CMAKE_COMMAND} --build . -j --target install
)
# glog
list(APPEND GLOG_CONFIGURE_FLAGS ${CONFIGURE_FLAGS})
ExternalProject_Add(glog
GIT_REPOSITORY https://github.com/google/glog.git
GIT_SHALLOW TRUE
CONFIGURE_COMMAND ${CMAKE_COMMAND} <SOURCE_DIR> ${GLOG_CONFIGURE_FLAGS}
BUILD_COMMAND ${CMAKE_COMMAND} -E echo ""
INSTALL_COMMAND ${CMAKE_COMMAND} --build . -j --target install
DEPENDS gflags
)
# cycles
list(APPEND CYCLES_CONFIGURE_FLAGS ${CONFIGURE_FLAGS})
list(APPEND CYCLES_CONFIGURE_FLAGS -DBUILD_WITH_REZ=OFF)
list(APPEND CYCLES_CONFIGURE_FLAGS -DWITH_CYCLES_OSL=OFF)
list(APPEND CYCLES_CONFIGURE_FLAGS -DWITH_NETWORK=OFF)
list(APPEND CYCLES_CONFIGURE_FLAGS -DWITH_CYCLES_OPENIMAGEDENOISE=OFF)
list(APPEND CYCLES_CONFIGURE_FLAGS -DHOUDINI_ROOT:FILEPATH=/opt/hfs18.5)
# inject houdini to cycles
list(APPEND CYCLES_CONFIGURE_FLAGS -DCMAKE_PROJECT_INCLUDE:FILEPATH=${CMAKE_SOURCE_DIR}/inject_cycles.cmake)
message(STATUS "cycles cmake flags:" ${CYCLES_CONFIGURE_FLAGS})
ExternalProject_Add(cycles
GIT_REPOSITORY https://github.com/tangent-opensource/cycles.git
GIT_TAG cmake_exported_libraries
GIT_SHALLOW TRUE
PATCH_COMMAND patch <SOURCE_DIR>/src/kernel/kernel_types.h < ${CMAKE_SOURCE_DIR}/rtc_namespace.patch
COMMAND patch <SOURCE_DIR>/third_party/cuew/CMakeLists.txt < ${CMAKE_SOURCE_DIR}/extern_cuew.patch
CONFIGURE_COMMAND ${CMAKE_COMMAND} <SOURCE_DIR> ${CYCLES_CONFIGURE_FLAGS}
BUILD_COMMAND ${CMAKE_COMMAND} -E echo ""
INSTALL_COMMAND ${CMAKE_COMMAND} --build . -j --target install
DEPENDS glog
)
# hd cycles
list(APPEND HD_CYCLES_CONFIGURE_FLAGS ${CONFIGURE_FLAGS})
list(APPEND HD_CYCLES_CONFIGURE_FLAGS -DUSE_HOUDINI_USD=TRUE -DHOUDINI_ROOT=/opt/hfs18.5)
ExternalProject_Add(hdcycles
GIT_REPOSITORY [email protected]:tangent-opensource/hdcycles.git
GIT_TAG modern_cmake
GIT_SHALLOW TRUE
CONFIGURE_COMMAND ${CMAKE_COMMAND} <SOURCE_DIR> ${HD_CYCLES_CONFIGURE_FLAGS}
BUILD_COMMAND ${CMAKE_COMMAND} -E echo ""
INSTALL_COMMAND ${CMAKE_COMMAND} --build . -j --target install
DEPENDS cycles
)