diff --git a/.gitmodules b/.gitmodules index 5f8bc8e..24e7fee 100644 --- a/.gitmodules +++ b/.gitmodules @@ -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/ diff --git a/CMakeLists.txt b/CMakeLists.txt index 1c5f524..e1360b5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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}) @@ -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} -) \ No newline at end of file +) + +# 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() \ No newline at end of file diff --git a/gradlew b/gradlew old mode 100755 new mode 100644 diff --git a/lib/apriltag_amd64.dll b/lib/apriltag_amd64.dll index 640bfaa..a5e5f64 100644 Binary files a/lib/apriltag_amd64.dll and b/lib/apriltag_amd64.dll differ diff --git a/target_arch_detect.c b/target_arch_detect.c deleted file mode 100644 index 1638f3a..0000000 --- a/target_arch_detect.c +++ /dev/null @@ -1,16 +0,0 @@ - - int main() { - #if defined(_M_ARM) - return 2; - #elif defined(_M_ARM64) - return 3; - #elif defined(_M_AMD64) - return 4; - #elif defined(_M_X64) - return 5; - #elif defined(_M_IX86) - return 6; - #else - return 0; - #endif -}