Skip to content

Commit

Permalink
fix runtime libs (#8924)
Browse files Browse the repository at this point in the history
  • Loading branch information
cenit authored Oct 22, 2024
1 parent d17ec15 commit 19dde2f
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ option(VCPKG_USE_OPENCV2 "Use legacy OpenCV 2" OFF)
option(VCPKG_USE_OPENCV3 "Use legacy OpenCV 3" OFF)
option(VCPKG_USE_OPENCV4 "Use OpenCV 4" ON)
option(USE_NSIS "Use NSIS as a CPack backend on Windows" ON)
option(SKIP_INSTALL_RUNTIME_LIBS "Do not install runtime libs" OFF)

if(DEFINED ENV{VCPKG_DEFAULT_TRIPLET})
message(STATUS "Setting default vcpkg target triplet to $ENV{VCPKG_DEFAULT_TRIPLET}")
Expand Down Expand Up @@ -67,11 +68,7 @@ if(ENABLE_OPENCV)
endif()
endif()

if(NOT CMAKE_HOST_SYSTEM_PROCESSOR AND NOT WIN32)
execute_process(COMMAND "uname" "-m" OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()

if(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "x86")
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^x86" OR CMAKE_SYSTEM_PROCESSOR MATCHES "^AMD64")
set(IS_X86 TRUE)
else()
set(IS_X86 FALSE)
Expand Down Expand Up @@ -672,13 +669,14 @@ if(ENABLE_CSHARP_WRAPPER)
add_subdirectory(src/csharp)
endif()

set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP TRUE)
include(InstallRequiredSystemLibraries)

install(
if (NOT SKIP_INSTALL_RUNTIME_LIBS)
set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP TRUE)
include(InstallRequiredSystemLibraries)
install(
PROGRAMS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS}
DESTINATION ${INSTALL_BIN_DIR}
)
)
endif()

if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/vcpkg.json)
file(READ ${CMAKE_CURRENT_SOURCE_DIR}/vcpkg.json VCPKG_JSON_STRING)
Expand Down

0 comments on commit 19dde2f

Please sign in to comment.