Skip to content

Commit

Permalink
Some cmake improvements for skypeweb (#457)
Browse files Browse the repository at this point in the history
* Don't hardcode 'pkg-config'

* Install theme file too

* Add sanity checks in case manual pkg-config calls fail
  • Loading branch information
hasufell authored and EionRobb committed Jul 13, 2016
1 parent 0cdc91f commit d93d970
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions skypeweb/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,32 @@ link_directories(


#install(TARGETS ${PROJECT_NAME} DESTINATION ${LIB_INSTALL_DIR})
exec_program("pkg-config --variable=plugindir purple 2>/dev/null"
OUTPUT_VARIABLE LIB_INSTALL_DIR)
exec_program("${PKG_CONFIG_EXECUTABLE} --variable=plugindir purple 2>/dev/null"
OUTPUT_VARIABLE LIB_INSTALL_DIR
RETURN_VALUE PURPLE_PLUGINDIR_RET)

if (NOT PURPLE_PLUGINDIR_RET EQUAL 0)
message( FATAL_ERROR "${PKG_CONFIG_EXECUTABLE} --variable=plugindir purple -- returned a non-null error code")
endif()

install(TARGETS ${PROJECT_NAME} DESTINATION ${LIB_INSTALL_DIR})

exec_program("pkg-config --variable=datadir purple 2>/dev/null"
OUTPUT_VARIABLE PURPLE_DATADIR)
exec_program("${PKG_CONFIG_EXECUTABLE} --variable=datadir purple 2>/dev/null"
OUTPUT_VARIABLE PURPLE_DATADIR
RETURN_VALUE PURPLE_DATADIR_RET)

if (NOT PURPLE_DATADIR_RET EQUAL 0)
message( FATAL_ERROR "${PKG_CONFIG_EXECUTABLE} --variable=datadir purple -- returned a non-null error code")
endif()

install(DIRECTORY "icons/"
DESTINATION "${PURPLE_DATADIR}/pixmaps/pidgin/protocols/"
)

install(FILES "theme"
DESTINATION "${PURPLE_DATADIR}/pixmaps/pidgin/emotes/skype/"
)

# package settings
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Skype protocol plug-in for libpurple")
set(CPACK_PACKAGE_VENDOR "Eionrobb")
Expand Down

0 comments on commit d93d970

Please sign in to comment.