Added missing cmake_modules
This commit is contained in:
parent
04c0598d97
commit
cedb604c60
3 changed files with 75 additions and 0 deletions
16
cmake_modules/eventConfig.cmake
Normal file
16
cmake_modules/eventConfig.cmake
Normal file
|
@ -0,0 +1,16 @@
|
|||
FIND_PATH(EVENT_INCLUDE_DIRS libev/event.h)
|
||||
|
||||
SET(EVENT_NAMES ${EVENT_NAMES} ev libev)
|
||||
FIND_LIBRARY(EVENT_LIBRARIES NAMES ${EVENT_NAMES} PATH)
|
||||
|
||||
IF(EVENT_INCLUDE_DIRS AND EVENT_LIBRARIES)
|
||||
SET(HAVE_EVENT TRUE)
|
||||
file(APPEND src/transport_config.h "#define WITH_LIBEVENT 1\n")
|
||||
ELSE(EVENT_INCLUDE_DIRS AND EVENT_LIBRARIES)
|
||||
SET (EVENT_INCLUDE_DIRS "")
|
||||
SET (EVENT_LIBRARIES "")
|
||||
ENDIF(EVENT_INCLUDE_DIRS AND EVENT_LIBRARIES)
|
||||
|
||||
IF(HAVE_EVENT)
|
||||
MESSAGE(STATUS "Found Event: ${EVENT_LIBRARIES}")
|
||||
ENDIF(HAVE_EVENT)
|
49
cmake_modules/glibConfig.cmake
Normal file
49
cmake_modules/glibConfig.cmake
Normal file
|
@ -0,0 +1,49 @@
|
|||
set(GLIB2_LIBRARIES "GLIB2_LIBRARIES-NOTFOUND")
|
||||
|
||||
if(GLIB2_INCLUDE_DIR AND GLIB2_LIBRARIES)
|
||||
# Already in cache, be silent
|
||||
set(GLIB2_FIND_QUIETLY TRUE)
|
||||
endif(GLIB2_INCLUDE_DIR AND GLIB2_LIBRARIES)
|
||||
|
||||
if (NOT WIN32)
|
||||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(PKG_GLIB REQUIRED glib-2.0)
|
||||
endif(NOT WIN32)
|
||||
|
||||
find_path(GLIB2_MAIN_INCLUDE_DIR glib.h
|
||||
PATH_SUFFIXES glib-2.0
|
||||
PATHS ${PKG_GLIB_INCLUDE_DIRS} )
|
||||
|
||||
# search the glibconfig.h include dir under the same root where the library is found
|
||||
find_library(GLIB2_LIBRARIES
|
||||
NAMES glib-2.0
|
||||
PATHS ${PKG_GLIB_LIBRARY_DIRS} )
|
||||
|
||||
find_library(GLIB2_THREAD
|
||||
NAMES gthread-2.0
|
||||
PATHS ${PKG_GLIB_LIBRARY_DIRS} )
|
||||
|
||||
find_path(GLIB2_INTERNAL_INCLUDE_DIR glibconfig.h
|
||||
PATH_SUFFIXES glib-2.0/include
|
||||
PATHS ${PKG_GLIB_INCLUDE_DIRS} ${PKG_GLIB_LIBRARIES} ${CMAKE_SYSTEM_LIBRARY_PATH})
|
||||
|
||||
if(GLIB2_THREAD)
|
||||
set(GLIB2_LIBRARIES ${GLIB2_LIBRARIES} ${GLIB2_THREAD})
|
||||
else(GLIB2_THREAD)
|
||||
message( FATAL_ERROR "Could NOT find gthread-2.0" )
|
||||
endif(GLIB2_THREAD)
|
||||
|
||||
|
||||
set(GLIB2_INCLUDE_DIR ${GLIB2_MAIN_INCLUDE_DIR})
|
||||
|
||||
# not sure if this include dir is optional or required
|
||||
# for now it is optional
|
||||
if(GLIB2_INTERNAL_INCLUDE_DIR)
|
||||
set(GLIB2_INCLUDE_DIR ${GLIB2_INCLUDE_DIR} ${GLIB2_INTERNAL_INCLUDE_DIR})
|
||||
set(GLIB2_FOUND TRUE)
|
||||
endif(GLIB2_INTERNAL_INCLUDE_DIR)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(GLIB2 DEFAULT_MSG GLIB2_LIBRARIES GLIB2_MAIN_INCLUDE_DIR)
|
||||
|
||||
mark_as_advanced(GLIB2_INCLUDE_DIR GLIB2_LIBRARIES)
|
10
cmake_modules/purpleConfig.cmake
Normal file
10
cmake_modules/purpleConfig.cmake
Normal file
|
@ -0,0 +1,10 @@
|
|||
FIND_LIBRARY(PURPLE_LIBRARY NAMES purple)
|
||||
FIND_PATH(PURPLE_INCLUDE_DIR NAMES "purple.h" PATH_SUFFIXES libpurple )
|
||||
|
||||
|
||||
if( PURPLE_LIBRARY AND PURPLE_INCLUDE_DIR )
|
||||
message( STATUS "Found libpurple: ${PURPLE_LIBRARY}, ${PURPLE_INCLUDE_DIR}")
|
||||
set( PURPLE_FOUND 1 )
|
||||
else( PURPLE_LIBRARY AND PURPLE_INCLUDE_DIR )
|
||||
message( FATAL_ERROR "Could NOT find libpurple" )
|
||||
endif( PURPLE_LIBRARY AND PURPLE_INCLUDE_DIR )
|
Loading…
Add table
Reference in a new issue