File: CMakeLists.txt

package info (click to toggle)
pytorch 1.13.1%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 139,252 kB
  • sloc: cpp: 1,100,274; python: 706,454; ansic: 83,052; asm: 7,618; java: 3,273; sh: 2,841; javascript: 612; makefile: 323; xml: 269; ruby: 185; yacc: 144; objc: 68; lex: 44
file content (27 lines) | stat: -rw-r--r-- 828 bytes parent folder | download | duplicates (3)
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
if(NOT LIBSHM_INSTALL_LIB_SUBDIR)
  set(LIBSHM_INSTALL_BIN_SUBDIR "bin" CACHE PATH "libshm install binary directory")
  set(LIBSHM_INSTALL_LIB_SUBDIR "lib" CACHE PATH "libshm install library directory")
endif()

add_library(shm SHARED core.cpp)

target_compile_definitions(shm PRIVATE
  "_CRT_SECURE_NO_DEPRECATE=1"
  "SHM_EXPORTS"
)

target_include_directories(shm PRIVATE
  ${CMAKE_BINARY_DIR}/aten/src # provides "ATen/TypeExtendedInterface.h" to ATen.h
  ${TORCH_ROOT}/torch/lib # provides "libshm/libshm.h"
  ${CMAKE_CURRENT_SOURCE_DIR}
  )

target_link_libraries(shm torch c10)


install(TARGETS shm DESTINATION "${LIBSHM_INSTALL_LIB_SUBDIR}")
install(FILES libshm.h DESTINATION "include")

if(MSVC AND BUILD_SHARED_LIBS)
  install(FILES $<TARGET_PDB_FILE:shm> DESTINATION "${LIBSHM_INSTALL_LIB_SUBDIR}" OPTIONAL)
endif()