Created
December 30, 2015 16:31
-
-
Save syldrathecat/ed438ea95692fd349d7f to your computer and use it in GitHub Desktop.
fchat-pidgin cmake script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 2.6) | |
project(fchat-pidgin C) | |
include(FindPkgConfig) | |
option(FCHAT_PURPLE_ONLY "Compile without pidgin-specific extensions." OFF) | |
pkg_check_modules(GLIB REQUIRED glib-2.0) | |
pkg_check_modules(JSON_GLIB REQUIRED json-glib-1.0) | |
pkg_check_modules(PIDGIN REQUIRED pidgin) | |
pkg_check_modules(PURPLE REQUIRED purple) | |
set(LIBPURPLE_CFLAGS "-DPURPLE_PLUGINS -DENABLE_NLS -DHAVE_ZLIB") | |
set(FCHAT_PIDGIN_INCLUDE_DIRS ${LIBPURPLE_INCLUDE_DIRS} ${GLIB_INCLUDE_DIRS} ${JSON_GLIB_INCLUDE_DIRS}) | |
set(FCHAT_PIDGIN_LIBRARIES ${LIBPURPLE_LIBRARIES} ${GLIB_LIBRARIES} ${JSON_GLIB_LIBRARIES}) | |
set(FCHAT_PIDGIN_SOURCE_FILES | |
f-list.c | |
f-list.h | |
f-list_admin.c | |
f-list_admin.h | |
f-list_autobuddy.c | |
f-list_autobuddy.h | |
f-list_bbcode.c | |
f-list_bbcode.h | |
f-list_callbacks.c | |
f-list_callbacks.h | |
f-list_channels.c | |
f-list_channels.h | |
f-list_commands.c | |
f-list_commands.h | |
f-list_connection.c | |
f-list_connection.h | |
f-list_friends.c | |
f-list_friends.h | |
f-list_icon.c | |
f-list_icon.h | |
f-list_ignore.c | |
f-list_ignore.h | |
f-list_json.c | |
f-list_json.h | |
f-list_kinks.c | |
f-list_kinks.h | |
f-list_profile.c | |
f-list_profile.h | |
f-list_report.c | |
f-list_report.h | |
f-list_rtb.c | |
f-list_rtb.h | |
f-list_status.c | |
f-list_status.h | |
f-list_util.c | |
f-list_util.h | |
) | |
if(FCHAT_PURPLE_ONLY) | |
add_definitions(-DFCHAT_PURPLE_ONLY) | |
list(APPEND FCHAT_PIDGIN_INCLUDE_DIRS ${PURPLE_INCLUDE_DIRS}) | |
list(APPEND FCHAT_PIDGIN_LIBRARIES ${PURPLE_LIBRARIES}) | |
else() | |
list(APPEND FCHAT_PIDGIN_SOURCE_FILES f-list_pidgin.c f-list_pidgin.h) | |
list(APPEND FCHAT_PIDGIN_INCLUDE_DIRS ${PIDGIN_INCLUDE_DIRS}) | |
list(APPEND FCHAT_PIDGIN_LIBRARIES ${PIDGIN_LIBRARIES}) | |
endif() | |
exec_program( | |
"git" | |
${CMAKE_CURRENT_SOURCE_DIR} | |
ARGS "describe --dirty --always --tags" | |
OUTPUT_VARIABLE GIT_VERSION) | |
add_definitions(-DGIT_VERSION="${GIT_VERSION}") | |
add_library(flist SHARED | |
${FCHAT_PIDGIN_SOURCE_FILES} | |
) | |
if (NOT WIN32) | |
set_target_properties(flist PROPERTIES | |
PREFIX "" | |
) | |
endif() | |
target_include_directories(flist SYSTEM PRIVATE ${FCHAT_PIDGIN_INCLUDE_DIRS}) | |
target_link_libraries(flist ${FCHAT_PIDGIN_LIBRARIES}) | |
install(TARGETS flist LIBRARY DESTINATION /usr/lib/purple-2/) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment