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

Changing the build system to CMake #520

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ config.log
config.status
configure
debian
include
INSTALL
libtool
libtool.m4
Expand All @@ -21,3 +20,5 @@ Makefile
Makefile.in
pidgin
win32-install-dir
.idea
cmake-build-debug
69 changes: 0 additions & 69 deletions .travis.yml

This file was deleted.

Binary file removed .travis/key
Binary file not shown.
57 changes: 0 additions & 57 deletions .travis/obs.sh

This file was deleted.

13 changes: 0 additions & 13 deletions .travis/win32-build.sh

This file was deleted.

11 changes: 0 additions & 11 deletions .travis/win32-deploy.sh

This file was deleted.

24 changes: 0 additions & 24 deletions .travis/win32-install.sh

This file was deleted.

106 changes: 106 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
cmake_minimum_required(VERSION 3.20)
project(purple_facebook)

set(CMAKE_CXX_STANDARD 14)

set(PLUGIN_VERSION 0.9.6)
set(PACKAGE_NAME purple-facebook)
set(PACKAGE_TARNAME purple-facebook)
set(PACKAGE_VERSION ${PLUGIN_VERSION})
set(PACKAGE_STRING "purple-facebook\ $(PLUGIN_VERSION)")
set(PACKAGE_BUGREPORT https://github.com/dequis/purple-facebook/issues)
set(PACKAGE_URL https://github.com/dequis/purple-facebook)
set(PACKAGE purple-facebook)
set(VERSION ${PLUGIN_VERSION})


include_directories(include)
include_directories(${CMAKE_SOURCE_DIR})
include_directories(facebook)

find_package(PkgConfig REQUIRED)
#get glib
pkg_search_module(GLIB REQUIRED glib-2.0)
include_directories(${GLIB_INCLUDE_DIRS})
link_directories(${GLIB_LIBRARY_DIRS})
#get gobject
pkg_search_module(GIO REQUIRED gio-2.0)
include_directories(${GIO_INCLUDE_DIRS})
link_directories(${GIO_LIBRARY_DIRS})
#get gio
pkg_search_module(GOBJECT REQUIRED gobject-2.0)
include_directories(${GOBJECT_INCLUDE_DIRS})
link_directories(${GOBJECT_LIBRARY_DIRS})
#get json-glib
pkg_search_module(JSON-GLIB REQUIRED json-glib-1.0)
include_directories(${JSON-GLIB_INCLUDE_DIRS})
link_directories(${JSON-GLIB_LIBRARY_DIRS})
#get purple
pkg_search_module(PURPLE REQUIRED purple)
include_directories(${PURPLE_INCLUDE_DIRS})
link_directories(${PURPLE_LIBRARY_DIRS})
#get zlib
pkg_search_module(ZLIB REQUIRED zlib)
include_directories(${ZLIB_INCLUDE_DIRS})
link_directories(${ZLIB_LIBRARY_DIRS})

#check glib-genmarshal
find_program(GLIB_MARSHALLER glib-genmarshal)
if(NOT GLIB_MARSHALLER)
message(FATAL_ERROR "gen-marshal not found!")
endif()

set(MARSHAL_H ${CMAKE_SOURCE_DIR}/facebook/marshal.h)
set(MARSHAL_C ${CMAKE_SOURCE_DIR}/facebook/marshal.c)

add_custom_command(
OUTPUT ${MARSHAL_H}
COMMAND glib-genmarshal --prefix=fb_marshal --header ${CMAKE_SOURCE_DIR}/facebook/marshaller.list >> ${MARSHAL_H}
COMMENT "Generating marshal.h"
)

add_custom_command(
OUTPUT ${MARSHAL_C}
COMMAND glib-genmarshal --prefix=fb_marshal --body ${CMAKE_SOURCE_DIR}/facebook/marshaller.list >> ${MARSHAL_C}
COMMENT "Generating marshal.c"
)


add_library(facebook SHARED
${MARSHAL_H}
${MARSHAL_C}
facebook/api.c
facebook/data.c
facebook/facebook.c
facebook/http.c
facebook/id.h
facebook/json.c
facebook/mqtt.c
facebook/thrift.c
facebook/util.c
purple2compat/http.c
purple2compat/purple-socket.c
)

add_definitions(${GLIB_CFLAGS_OTHER}
${JSON-GLIB_CFLAGS_OTHER}
${PURPLE_CFLAGS_OTHER}
${ZLIB_CFLAGS_OTHER}
)

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DPURPLE_PLUGINS -include purple-compat.h")

add_definitions(-DPACKAGE_VERSION=\"${PACKAGE_VERSION}\")
add_definitions(-DPACKAGE_URL=\"${PACKAGE_URL}\")

target_link_libraries(facebook
${GLIB_LIBRARIES}
${JSON-GLIB_LIBRARIES}
${GIO_LIBRARIES}
${GOBJECT_LIBRARIES}
${PURPLE_LIBRARIES}
${ZLIB_LIBRARIES})

if(WIN32)
target_link_libraries(facebook ws2_32)
endif()
25 changes: 0 additions & 25 deletions MANIFEST_PIDGIN

This file was deleted.

12 changes: 0 additions & 12 deletions MANIFEST_VOIDS

This file was deleted.

17 changes: 0 additions & 17 deletions Makefile.am

This file was deleted.

Loading