Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect correct link targets #128

Open
susnux opened this issue Mar 22, 2021 · 0 comments
Open

Detect correct link targets #128

susnux opened this issue Mar 22, 2021 · 0 comments

Comments

@susnux
Copy link

susnux commented Mar 22, 2021

On Linux sometime the correct libraries are not found and used for the build.
E.g. pthread is undefined (undefined reference), using this will fix that issue:

diff -Nur --no-dereference artoolkitx-1.0.6.1/Source/ARX/ARVideo/CMakeLists.txt new/Source/ARX/ARVideo/CMakeLists.txt
--- artoolkitx-1.0.6.1/Source/ARX/ARVideo/CMakeLists.txt        2020-04-03 06:58:55.000000000 +0200
+++ new/Source/ARX/ARVideo/CMakeLists.txt       2021-03-22 06:55:16.176193800 +0100
@@ -40,24 +40,26 @@
 
 if (USE_CPARAM_SEARCH)
     find_package(CURL REQUIRED)
+    find_package(ZLIB REQUIRED)
     if (NOT ARX_TARGET_PLATFORM_LINUX)
         set(LIBS ${LIBS}
             ${CURL_LIBRARIES}
-            z
+            ${ZLIB_LIBRARIES}
         )
     else()
+       find_package(OpenSSL REQUIRED) 
         set(LIBS ${LIBS}
             ${CURL_LIBRARIES}
-            z
-            crypto
-            ssl
+            ${ZLIB_LIBRARIES}
+            ${OPENSSL_LIBRARIES}
         )
     endif()
     message(${CURL_LIBRARIES})
     # On all platforms except Android, we link to sqlite's library. On Android, we compile include sqlite as source.
     if (NOT ARX_TARGET_PLATFORM_ANDROID)
+       find_package(SQLite3 REQUIRED)
         set(LIBS ${LIBS}
-            sqlite3
+            ${SQLite3_LIBRARIES}
         )
     endif()
     if (ARX_TARGET_PLATFORM_IOS OR ARX_TARGET_PLATFORM_MACOS)
@@ -99,6 +101,7 @@
 if(ARX_TARGET_PLATFORM_LINUX)
     add_subdirectory("Video4Linux2")
     set(DEFINES ${DEFINES} "ARVIDEO_INPUT_DEFAULT_V4L2")
+    set(LIBS ${LIBS} pthread)
     add_subdirectory("libdc1394")
     add_subdirectory("GStreamer")
 endif()

fix-cmake-find-deps.patch.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant