-
Notifications
You must be signed in to change notification settings - Fork 59
/
Copy pathCMakeLists.txt
51 lines (41 loc) · 2.12 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
set(SRC
main.cpp)
if (LINUX)
string(APPEND CMAKE_SHARED_LINKER_FLAGS " -Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/plugin.map -Wl,--exclude-libs=ALL")
endif ()
set(PROC_NAME "${USD_PROCEDURAL_NAME}_proc")
add_library(${PROC_NAME} SHARED ${SRC})
target_link_libraries(${PROC_NAME} PRIVATE translator)
target_include_directories(${PROC_NAME} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../translator/reader")
target_include_directories(${PROC_NAME} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../translator/writer")
set_target_properties(${PROC_NAME} PROPERTIES PREFIX "")
target_compile_definitions(${PROC_NAME} PRIVATE USD_PROCEDURAL_NAME=${USD_PROCEDURAL_NAME})
if (EXISTS "${ARNOLD_INCLUDE_DIR}/ai_scene_format.h" AND BUILD_PROC_SCENE_FORMAT)
target_compile_definitions(${PROC_NAME} PRIVATE ARNOLD_HAS_SCENE_FORMAT_API)
endif ()
if (APPLE OR LINUX)
target_link_libraries(${PROC_NAME} PRIVATE dl)
endif ()
# Hiding exported symbols
if (LINUX)
target_compile_options(${PROC_NAME} PRIVATE -fvisibility=hidden)
elseif (APPLE)
if (${ARNOLD_VERSION} VERSION_GREATER_EQUAL "6.0.3.0")
if (USD_STATIC_BUILD)
string(APPEND CMAKE_SHARED_LINKER_FLAGS " -Xlinker -S -Xlinker -x -Xlinker -exported_symbols_list -Xlinker ${CMAKE_CURRENT_SOURCE_DIR}/macos_export_list")
else ()
string(APPEND CMAKE_SHARED_LINKER_FLAGS " -Xlinker -S -Xlinker -x -Xlinker -exported_symbols_list -Xlinker ${CMAKE_CURRENT_SOURCE_DIR}/macos_export_list_shared")
endif ()
else ()
string(APPEND CMAKE_SHARED_LINKER_FLAGS " -Xlinker -S -Xlinker -x -Xlinker -exported_symbols_list -Xlinker ${CMAKE_CURRENT_SOURCE_DIR}/macos_export_list_no_scene")
endif ()
endif ()
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${SRC} ${HDR})
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/../common PREFIX common FILES ${COMMON_SRC} ${COMMON_HDR})
install(TARGETS ${PROC_NAME}
DESTINATION "${PREFIX_PROCEDURAL}")
if (USD_STATIC_BUILD)
# When linking statically we need to install the plugInfos for the included files.
install(DIRECTORY "${USD_LIBRARY_DIR}/usd"
DESTINATION "${PREFIX_PROCEDURAL}")
endif ()