Skip to content

Commit

Permalink
Merge pull request #1 from uilianries/apriltag-311
Browse files Browse the repository at this point in the history
Force C99
  • Loading branch information
ericriff authored Dec 5, 2019
2 parents f91434a + 08a17fe commit f7fdde4
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 4 deletions.
4 changes: 1 addition & 3 deletions recipes/apriltag/all/conandata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,5 @@ sources:
sha256: "7349e1fcc8b2979230b46c0d62ccf2ba2bbd611d87ef80cfd37ffe74425f5efb"
patches:
"3.1.1":
- patch_file: "patches/use-current-source-dir.patch"
base_path: "source_subfolder"
- patch_file: "patches/remove-hardcoded-shared.patch"
- patch_file: "patches/fix-cmake.patch"
base_path: "source_subfolder"
2 changes: 1 addition & 1 deletion recipes/apriltag/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class apriltagConan(ConanFile):
default_options = {'shared': False, "fPIC": True}
generators = "cmake"
topics = ("conan", "apriltag", "robotics")
exports_sources = ["CMakeLists.txt", "*.patch"]
exports_sources = ["CMakeLists.txt", "patches/*"]
_source_subfolder = "source_subfolder"
_cmake = None

Expand Down
32 changes: 32 additions & 0 deletions recipes/apriltag/all/patches/fix-cmake.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b97f24e..ff4af67 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -10,7 +10,8 @@ aux_source_directory(. APRILTAG_SRCS)
set(CMAKE_BUILD_TYPE Release)

# Library
-add_library(${PROJECT_NAME} SHARED ${APRILTAG_SRCS} ${COMMON_SRC})
+add_library(${PROJECT_NAME} ${APRILTAG_SRCS} ${COMMON_SRC})
+set_target_properties(${PROJECT_NAME} PROPERTIES C_STANDARD 99)
if (MSVC)
# FindThreads will not find pthread.h with MSVC
# winmm is necessary for __imp_timeGetTime
@@ -34,7 +35,7 @@ set_target_properties(${PROJECT_NAME} PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_INSTALL_LIBDIR}
)

-file(GLOB TAG_FILES ${CMAKE_SOURCE_DIR}/tag*.c)
+file(GLOB TAG_FILES ${CMAKE_CURRENT_SOURCE_DIR}/tag*.c)
set_source_files_properties(SOURCE ${TAG_FILES} PROPERTIES COMPILE_FLAGS -O0)

# install library
@@ -44,7 +45,7 @@ install(TARGETS ${PROJECT_NAME} EXPORT apriltag
)

# install header file hierarchy
-file(GLOB_RECURSE HEADER_FILES RELATIVE ${CMAKE_SOURCE_DIR} *.h)
+file(GLOB_RECURSE HEADER_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.h)
foreach(HEADER ${HEADER_FILES})
string(REGEX MATCH "(.*)[/\\]" DIR ${HEADER})
install(FILES ${HEADER} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}/${DIR})

0 comments on commit f7fdde4

Please sign in to comment.