Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion recipes/gtsam/all/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ cmake_minimum_required(VERSION 3.15)
project(cmake_wrapper)

include(conanbuildinfo.cmake)
conan_basic_setup()
conan_basic_setup(KEEP_RPATHS)

add_subdirectory("source_subfolder")
16 changes: 10 additions & 6 deletions recipes/gtsam/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
sources:
"4.0.2":
url: "https://github.com/borglab/gtsam/archive/4.0.2.tar.gz"
sha256: "8770a440f1af98c3f0d9d4dffd568de2d4c21b245e7231e987e26bc236aeb5aa"
"4.0.3":
url: "https://github.com/borglab/gtsam/archive/4.0.3.tar.gz"
sha256: "eaa561749edf7a2d402981828253e28aed6c717dae35738301c5ab23e2595f25"
"4.0.2":
url: "https://github.com/borglab/gtsam/archive/4.0.2.tar.gz"
sha256: "8770a440f1af98c3f0d9d4dffd568de2d4c21b245e7231e987e26bc236aeb5aa"
patches:
"4.0.3":
- patch_file: "patches/0001-conan-4.0.3.patch"
base_path: "source_subfolder"
- patch_file: "patches/0002-macos-rpath-4.0.3.patch"
base_path: "source_subfolder"
"4.0.2":
- patch_file: "patches/conan-4.0.2.patch"
- patch_file: "patches/0001-conan-4.0.2.patch"
base_path: "source_subfolder"
"4.0.3":
- patch_file: "patches/conan-4.0.3.patch"
- patch_file: "patches/0002-macos-rpath-4.0.2.patch"
base_path: "source_subfolder"
341 changes: 204 additions & 137 deletions recipes/gtsam/all/conanfile.py

Large diffs are not rendered by default.

34 changes: 34 additions & 0 deletions recipes/gtsam/all/patches/0002-macos-rpath-4.0.2.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,7 +4,6 @@ cmake_minimum_required(VERSION 3.0)
# new feature to Cmake Version > 2.8.12
# Mac ONLY. Define Relative Path on Mac OS
if(NOT DEFINED CMAKE_MACOSX_RPATH)
- set(CMAKE_MACOSX_RPATH 0)
endif()

# Set the version number for the library
--- a/gtsam/CMakeLists.txt
+++ b/gtsam/CMakeLists.txt
@@ -177,9 +177,6 @@ if(WIN32) # Add 'lib' prefix to static library to avoid filename collision with
endif()

if (APPLE AND BUILD_SHARED_LIBS)
- set_target_properties(gtsam PROPERTIES
- INSTALL_NAME_DIR
- "${CMAKE_INSTALL_PREFIX}/lib")
endif()

install(
--- a/gtsam/3rdparty/metis/libmetis/CMakeLists.txt
+++ b/gtsam/3rdparty/metis/libmetis/CMakeLists.txt
@@ -16,9 +16,6 @@ if(WIN32)
endif()

if (APPLE)
- set_target_properties(metis PROPERTIES
- INSTALL_NAME_DIR
- "${CMAKE_INSTALL_PREFIX}/lib")
endif()

install(TARGETS metis EXPORT GTSAM-exports LIBRARY DESTINATION lib ARCHIVE DESTINATION lib RUNTIME DESTINATION bin)
30 changes: 30 additions & 0 deletions recipes/gtsam/all/patches/0002-macos-rpath-4.0.3.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,7 +4,6 @@ cmake_minimum_required(VERSION 3.0)
# new feature to Cmake Version > 2.8.12
# Mac ONLY. Define Relative Path on Mac OS
if(NOT DEFINED CMAKE_MACOSX_RPATH)
- set(CMAKE_MACOSX_RPATH 0)
endif()

# Set the version number for the library
@@ -347,7 +346,6 @@ endif()

if (APPLE AND BUILD_SHARED_LIBS)
# Set the default install directory on macOS
- set(CMAKE_INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib")
endif()

###############################################################################
--- a/gtsam/3rdparty/metis/libmetis/CMakeLists.txt
+++ b/gtsam/3rdparty/metis/libmetis/CMakeLists.txt
@@ -16,9 +16,6 @@ if(WIN32)
endif()

if (APPLE)
- set_target_properties(metis-gtsam PROPERTIES
- INSTALL_NAME_DIR
- "${CMAKE_INSTALL_PREFIX}/lib")
endif()

install(TARGETS metis-gtsam EXPORT GTSAM-exports
10 changes: 5 additions & 5 deletions recipes/gtsam/all/test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
cmake_minimum_required(VERSION 3.0)
cmake_minimum_required(VERSION 3.1)
project(test_package)

include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()
conan_basic_setup(TARGETS)

add_executable(${PROJECT_NAME} test_package.cpp)
find_package(GTSAM REQUIRED CONFIG)

find_package(GTSAM REQUIRED)
target_link_libraries(${PROJECT_NAME} GTSAM::gtsam)
add_executable(${PROJECT_NAME} test_package.cpp)
target_link_libraries(${PROJECT_NAME} gtsam)
set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11)
11 changes: 6 additions & 5 deletions recipes/gtsam/all/test_package/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import os
from conans import ConanFile, CMake, tools
import os


class gtsamTestConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "cmake", "cmake_find_package"
class TestPackageConan(ConanFile):
settings = "os", "arch", "compiler", "build_type"
generators = "cmake", "cmake_find_package_multi"

def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()

def test(self):
if not tools.cross_building(self.settings):
if not tools.cross_building(self):
bin_path = os.path.join("bin", "test_package")
self.run(bin_path, run_environment=True)
4 changes: 2 additions & 2 deletions recipes/gtsam/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
versions:
"4.0.2":
folder: all
"4.0.3":
folder: all
"4.0.2":
folder: all