Open HaoZeke opened 9 years ago
Unfortunately not yet. The libpurple API ended up being much more obtuse than I expected.
I can't get this to compile at all actually.
KELBDKOEPB002:libpurple-snapchat bkoepke$ cmake CMakeLists.txt && make -- Configuring done -- Generating done -- Build files have been written to: /Users/bkoepke/src/libpurple-snapchat [100%] Built target snapchat KELBDKOEPB002:libpurple-snapchat bkoepke$ gcc --version Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn) Target: x86_64-apple-darwin14.4.0 Thread model: posix KELBDKOEPB002:libpurple-snapchat bkoepke$
Works for me on FreeBSD/Linux as well. Not sure about windows.
I keep getting the following, trying to compile on Ubuntu 15.04
Linking C executable snapchat
CMakeFiles/snapchat.dir/snapchat_sha256.c.o: In function snapchat_sha256': snapchat_sha256.c:(.text+0x22): undefined reference to
SHA256_Init'
snapchat_sha256.c:(.text+0x44): undefined reference to SHA256_Update' snapchat_sha256.c:(.text+0x65): undefined reference to
SHA256_Final'
CMakeFiles/snapchat.dir/snapchat_util.c.o: In function int_to_str': snapchat_util.c:(.text+0xa3): undefined reference to
ceil'
collect2: error: ld returned 1 exit status
Following patch should fix the build issue:
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e7a2242..239f037 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,17 +1,17 @@
cmake_minimum_required(VERSION 2.8)
-set(MATH_LINK_FLAGS
- "-lm")
-set(SSL_LINK_FLAGS
- "-lssl -lcrypto")
-set(CMAKE_EXE_LINKER_FLAGS
- "${CMAKE_EXE_LINKER_FLAGS} ${SSL_LINK_FLAGS} ${MATH_LINK_FLAGS}")
+FIND_PACKAGE(OpenSSL REQUIRED)
+
+include_directories(OPENSSL_INCLUDE_DIR)
+link_directories( ${OPENSSL_LIBRARIES})
+
+add_definitions()
set(snapchat_SRCS
snapchat.c
snapchat_sha256.c
snapchat_util.c)
-add_executable(snapchat ${snapchat_SRCS})
+add_executable(snapchat ${snapchat_SRCS})
-target_link_libraries(snapchat)
+target_link_libraries(snapchat m crypto)
Added your cmake patch.
Is there any implementation of this to be used with pidgin? cmake . make produces a snapchat file. make install has no target...