Skip to content

Commit

Permalink
local changes
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthijsBurgh committed Feb 20, 2024
1 parent 8ccf552 commit 0331083
Showing 1 changed file with 26 additions and 8 deletions.
34 changes: 26 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ cmake_policy(SET CMP0135 NEW)
## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED)
#find_package(catkin REQUIRED)

## System dependencies are found with CMake's conventions
# find_package(Boost REQUIRED COMPONENTS system)
Expand Down Expand Up @@ -38,6 +38,20 @@ message(WARNING "CMAKE_INSTALL_LIBDIR: ${CMAKE_INSTALL_LIBDIR}")
message(WARNING "CMAKE_INSTALL_NAME_DIR: ${CMAKE_INSTALL_NAME_DIR}")
message(WARNING "CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}")

# Create target
set(TARGET libtorch)
add_library(${TARGET} SHARED IMPORTED)
#target_sources(
# ${TARGET}
# PUBLIC
# ${CMAKE_CURRENT_BINARY_DIR}/botan_all.h
# PRIVATE
# ${CMAKE_CURRENT_BINARY_DIR}/botan_all.cpp
#)
target_include_directories(${TARGET} PUBLIC INTERFACE
$<BUILD_INTERFACE:${libtorch_SOURCE_DIR}/include>
)

#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TORCH_CXX_FLAGS}")

#get_cmake_property(_variableNames VARIABLES)
Expand All @@ -61,13 +75,13 @@ message(WARNING "CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}")
# CATKIN_DEPENDS other_catkin_pkg
# DEPENDS TORCH
#)
#find_package(catkin QUIET)
#if(catkin_FOUND)
# catkin_package(
# SKIP_CMAKE_CONFIG_GENERATION
# SKIP_PKG_CONFIG_GENERATION
# )
#endif()
find_package(catkin QUIET)
if(catkin_FOUND)
catkin_package(
SKIP_CMAKE_CONFIG_GENERATION
SKIP_PKG_CONFIG_GENERATION
)
endif()

###########
## Build ##
Expand Down Expand Up @@ -163,6 +177,10 @@ include_directories(
# DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
#)

install(IMPORTED_RUNTIME_ARTIFACTS ${TARGET}
LIBRARY
)

install(DIRECTORY ${libtorch_SOURCE_DIR}/include/
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/torch_vendor
)
Expand Down

0 comments on commit 0331083

Please sign in to comment.