Skip to content
Snippets Groups Projects
Commit 0e72f7aa authored by Thomas Müller's avatar Thomas Müller
Browse files

CMake: fix Debug build on MSVC

When building with MSVC, generator expressions are required to utilize the correct DLSS library files -- else the build fails
parent 71c2503d
No related branches found
No related tags found
No related merge requests found
......@@ -104,11 +104,7 @@ if (NGP_BUILD_WITH_GUI)
list(APPEND NGP_INCLUDE_DIRECTORIES "dependencies/dlss/include")
if (MSVC)
list(APPEND NGP_LINK_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/dlss/lib/Windows_x86_64/x86_64")
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
list(APPEND NGP_LIBRARIES nvsdk_ngx_d_dbg)
else()
list(APPEND NGP_LIBRARIES nvsdk_ngx_d)
endif()
list(APPEND NGP_LIBRARIES "$<IF:$<CONFIG:Debug>,nvsdk_ngx_d_dbg,nvsdk_ngx_d>")
else()
list(APPEND NGP_LINK_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/dlss/lib/Linux_x86_64")
list(APPEND NGP_LIBRARIES nvsdk_ngx)
......@@ -306,11 +302,7 @@ target_link_libraries(instant-ngp PRIVATE ngp)
# Copy DLSS shared libraries
if (NGP_VULKAN)
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
set(NGX_BUILD_DIR "dev")
else()
set(NGX_BUILD_DIR "rel")
endif()
set(NGX_BUILD_DIR "$<IF:$<CONFIG:Debug>,dev,rel>")
if (MSVC)
add_custom_command(TARGET instant-ngp POST_BUILD
......@@ -318,9 +310,8 @@ if (NGP_VULKAN)
COMMAND_EXPAND_LISTS
)
else()
file(GLOB DLSS_SOS "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/dlss/lib/Linux_x86_64/${NGX_BUILD_DIR}/libnvidia-ngx-dlss.so.*")
add_custom_command(TARGET instant-ngp POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${DLSS_SOS} $<TARGET_FILE_DIR:instant-ngp>
COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/dlss/lib/Linux_x86_64/${NGX_BUILD_DIR}/libnvidia-ngx-dlss.so.*" $<TARGET_FILE_DIR:instant-ngp>
COMMAND_EXPAND_LISTS
)
endif()
......
......@@ -421,7 +421,7 @@ if __name__ == "__main__":
predictor = DefaultPredictor(cfg)
for frame in out['frames']:
img = cv2.imread(frame['file_path'])
img = cv2.imread(frame['file_path'])
outputs = predictor(img)
output_mask = np.zeros((img.shape[0], img.shape[1]))
......@@ -429,7 +429,7 @@ if __name__ == "__main__":
if outputs['instances'][i].pred_classes.cpu().numpy()[0] in mask_ids:
pred_mask = outputs['instances'][i].pred_masks.cpu().numpy()[0]
output_mask = np.logical_or(output_mask, pred_mask)
rgb_path = Path(frame['file_path'])
mask_name = str(rgb_path.parents[0] / Path('dynamic_mask_' + rgb_path.name.replace('.jpg', '.png')))
cv2.imwrite(mask_name, (output_mask*255).astype(np.uint8))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment