Skip to content

Commit

Permalink
pthread-win32 for windows builds
Browse files Browse the repository at this point in the history
  • Loading branch information
serivesmejia committed Oct 8, 2024
1 parent 4e620a2 commit efb8160
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 28 deletions.
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[submodule "src/main/cpp/apriltag"]
path = apriltag
url = https://github.com/AprilRobotics/apriltag/
[submodule "pthread-win32"]
path = pthread-win32
url = https://github.com/GerHobbelt/pthread-win32
[submodule "apriltag"]
path = apriltag
url = https://github.com/AprilRobotics/apriltag/
21 changes: 12 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,15 @@ endif()

string(TOLOWER ${ARCH} ARCH)

if(WIN32)
add_subdirectory(pthread-win32/)
endif()

if("${ARCH}" STREQUAL "x86_64")
set(ARCH "amd64")
endif()

if(WIN32)
# Add the pthread-win32 subdirectory
add_subdirectory(pthread-win32)
endif()

message(STATUS "Target architecture: ${ARCH}")

message(STATUS $ENV{JAVA_HOME})
Expand Down Expand Up @@ -77,12 +78,14 @@ add_library( # Specifies the name of the library.

set_target_properties(apriltag PROPERTIES OUTPUT_NAME "apriltag_${ARCH}")

if(WIN32)
target_include_directories(apriltag PUBLIC pthread-win32)
endif()

include_directories(
apriltag
apriltag/common
${JNI_INCLUDE_DIRS}
)
)

# If on Windows, link pthread to apriltag
if(WIN32)
# Choose one of the pthread-win32 libraries depending on your use case:
target_link_libraries(apriltag pthreadVC3) # Or pthreadVSE3 or pthreadVCE3 depending on your build
endif()
Empty file modified gradlew
100755 → 100644
Empty file.
Binary file modified lib/apriltag_amd64.dll
Binary file not shown.
16 changes: 0 additions & 16 deletions target_arch_detect.c

This file was deleted.

0 comments on commit efb8160

Please sign in to comment.