Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,19 @@ find_package(Log4cplus REQUIRED)
find_package(Python COMPONENTS Interpreter Development)
find_package(TBB REQUIRED)

# Houdini's macOS Python framework records its install name as @rpath/Python,
# even when CMake finds it through the libpython compatibility path. Embed the
# framework root so Python extension modules can be loaded by build-time tools.
if(APPLE AND TARGET Python::Python)
get_target_property(_python_library Python::Python IMPORTED_LOCATION_RELEASE)
if(NOT _python_library)
get_target_property(_python_library Python::Python IMPORTED_LOCATION)
endif()
if(_python_library MATCHES "^(.+\\.framework)/")
set(_python_framework_rpath "${CMAKE_MATCH_1}")
endif()
endif()

find_program(LUA_BIN_LUAC
NAMES luac
HINTS $ENV{LUA_DIR}/bin)
Expand All @@ -71,8 +84,11 @@ find_program(LUA_BIN_LUA
HINTS $ENV{LUA_DIR}/bin)

# Set the RPATH for binaries in the install tree
set(CMAKE_BUILD_RPATH ${COMPILER_LIBRARY_DIR})
set(CMAKE_BUILD_RPATH ${COMPILER_LIBRARY_DIR} ${_python_framework_rpath})
set(CMAKE_INSTALL_RPATH ${GLOBAL_INSTALL_RPATH})
if(_python_framework_rpath)
list(APPEND CMAKE_INSTALL_RPATH ${_python_framework_rpath})
endif()
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)

# if OPT_LEVEL is set use its value to override the CMAKE_BUILD_TYPE because the
Expand Down Expand Up @@ -158,4 +174,3 @@ install(
DESTINATION
${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}-${PROJECT_VERSION}
)

1 change: 0 additions & 1 deletion cmake/SceneRdl2CompileOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ function(SceneRdl2_cxx_compile_options target)
elseif (CMAKE_CXX_COMPILER_ID STREQUAL AppleClang)
target_compile_options(${target}
PUBLIC
-Wno-gnu-alignof-expression
)
elseif (CMAKE_CXX_COMPILER_ID STREQUAL Intel)
target_compile_options(${target}
Expand Down
2 changes: 1 addition & 1 deletion lib/scene/rdl2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ add_executable(rdl2_ispc_util)
target_sources(rdl2_ispc_util PRIVATE rdl2_ispc_util/rdl2_ispc_util.cc)
target_link_libraries(rdl2_ispc_util PRIVATE scene_rdl2_tmp)
if (IsDarwinPlatform)
add_custom_command(TARGET rdl2_ispc_util POST_BUILD COMMAND /usr/bin/codesign -s - -f -o linker-signed */rdl2_ispc_util)
add_custom_command(TARGET rdl2_ispc_util POST_BUILD COMMAND /usr/bin/codesign -s - -f -o linker-signed $<TARGET_FILE:rdl2_ispc_util>)
endif()

# Set standard compile/link options
Expand Down