Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
vision
Commits
52b39ecc
"git@developer.sourcefind.cn:change/sglang.git" did not exist on "740c46a1520207d5369a39ff25da97eeceef6ec4"
Unverified
Commit
52b39ecc
authored
Feb 14, 2020
by
bmanga
Committed by
GitHub
Feb 14, 2020
Browse files
Replace pybind11 with cmake's Python3 package (#1850)
parent
2d1bf7cb
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
CMakeLists.txt
CMakeLists.txt
+2
-2
cmake/TorchVisionConfig.cmake.in
cmake/TorchVisionConfig.cmake.in
+3
-3
No files found.
CMakeLists.txt
View file @
52b39ecc
...
@@ -10,8 +10,8 @@ if(WITH_CUDA)
...
@@ -10,8 +10,8 @@ if(WITH_CUDA)
add_definitions
(
-D__CUDA_NO_HALF_OPERATORS__
)
add_definitions
(
-D__CUDA_NO_HALF_OPERATORS__
)
endif
()
endif
()
find_package
(
Python3 COMPONENTS Development
)
find_package
(
Torch REQUIRED
)
find_package
(
Torch REQUIRED
)
find_package
(
pybind11 REQUIRED
)
file
(
GLOB HEADERS torchvision/csrc/*.h
)
file
(
GLOB HEADERS torchvision/csrc/*.h
)
file
(
GLOB OPERATOR_SOURCES torchvision/csrc/cpu/*.h torchvision/csrc/cpu/*.cpp
)
file
(
GLOB OPERATOR_SOURCES torchvision/csrc/cpu/*.h torchvision/csrc/cpu/*.cpp
)
...
@@ -22,7 +22,7 @@ file(GLOB MODELS_HEADERS torchvision/csrc/models/*.h)
...
@@ -22,7 +22,7 @@ file(GLOB MODELS_HEADERS torchvision/csrc/models/*.h)
file
(
GLOB MODELS_SOURCES torchvision/csrc/models/*.h torchvision/csrc/models/*.cpp
)
file
(
GLOB MODELS_SOURCES torchvision/csrc/models/*.h torchvision/csrc/models/*.cpp
)
add_library
(
${
PROJECT_NAME
}
SHARED
${
MODELS_SOURCES
}
${
OPERATOR_SOURCES
}
)
add_library
(
${
PROJECT_NAME
}
SHARED
${
MODELS_SOURCES
}
${
OPERATOR_SOURCES
}
)
target_link_libraries
(
${
PROJECT_NAME
}
PRIVATE
${
TORCH_LIBRARIES
}
pybind11::pybind11
)
target_link_libraries
(
${
PROJECT_NAME
}
PRIVATE
${
TORCH_LIBRARIES
}
Python3::Python
)
set_target_properties
(
${
PROJECT_NAME
}
PROPERTIES EXPORT_NAME TorchVision
)
set_target_properties
(
${
PROJECT_NAME
}
PROPERTIES EXPORT_NAME TorchVision
)
target_include_directories
(
${
PROJECT_NAME
}
INTERFACE
target_include_directories
(
${
PROJECT_NAME
}
INTERFACE
...
...
cmake/TorchVisionConfig.cmake.in
View file @
52b39ecc
...
@@ -28,10 +28,10 @@ include("${CMAKE_CURRENT_LIST_DIR}/${PN}Targets.cmake")
...
@@ -28,10 +28,10 @@ include("${CMAKE_CURRENT_LIST_DIR}/${PN}Targets.cmake")
if(NOT TARGET torch_library)
if(NOT TARGET torch_library)
find_package(Torch REQUIRED)
find_package(Torch REQUIRED)
endif()
endif()
if(NOT TARGET
pybind11::pybind11
)
if(NOT TARGET
Python3::Python
)
find_package(
pybind11 REQUIRED
)
find_package(
Python3 COMPONENTS Development
)
endif()
endif()
target_link_libraries(TorchVision::TorchVision INTERFACE ${TORCH_LIBRARIES}
pybind11::pybind11
)
target_link_libraries(TorchVision::TorchVision INTERFACE ${TORCH_LIBRARIES}
Python3::Python
)
if(@WITH_CUDA@)
if(@WITH_CUDA@)
target_compile_definitions(TorchVision::TorchVision INTERFACE WITH_CUDA)
target_compile_definitions(TorchVision::TorchVision INTERFACE WITH_CUDA)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment