-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'pkgconfig' into develop
- Loading branch information
Showing
24 changed files
with
301 additions
and
239 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,5 +40,6 @@ install_manifest.txt | |
toxcore/tox* | ||
sys/** | ||
|
||
|
||
# generated by CMake | ||
src/cocoa/Info.plist | ||
src/utox.1 |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# - Try to find FilterAudio | ||
# Once done this will define | ||
# LIBFILTERAUDIO_FOUND - System has FilterAudio | ||
# LIBFILTERAUDIO_INCLUDE_DIRS - The FilterAudio include directories | ||
# LIBFILTERAUDIO_LIBRARIES - The libraries needed to use FilterAudio | ||
# LIBFILTERAUDIO_DEFINITIONS - Compiler switches required for using FilterAudio | ||
|
||
find_package(PkgConfig) | ||
|
||
pkg_check_modules(PKG_LIBFILTERAUDIO QUIET libfilteraudio) | ||
set(LIBFILTERAUDIO_DEFINITIONS ${PKG_LIBFILTERAUDIO_CFLAGS_OTHER}) | ||
|
||
find_path(LIBFILTERAUDIO_INCLUDE_DIR filter_audio.h HINTS | ||
${PKG_LIBFILTERAUDIO_INCLUDEDIR} | ||
${PKG_LIBFILTERAUDIO_INCLUDE_DIRS} | ||
${CMAKE_SOURCE_DIR}/libs/windows-x64/include | ||
) | ||
|
||
find_library(LIBFILTERAUDIO_LIBRARY NAMES filteraudio HINTS | ||
${PKG_LIBFILTERAUDIO_LIBDIR} | ||
${PKG_LIBFILTERAUDIO_LIBRARY_DIRS} | ||
${CMAKE_SOURCE_DIR}/libs/windows-x64/lib | ||
) | ||
|
||
include(FindPackageHandleStandardArgs) | ||
# handle the QUIETLY and REQUIRED arguments and set LIBFILTERAUDIO_FOUND to TRUE | ||
# if all listed variables are TRUE | ||
find_package_handle_standard_args( | ||
libfilteraudio | ||
DEFAULT_MSG | ||
LIBFILTERAUDIO_LIBRARY | ||
LIBFILTERAUDIO_INCLUDE_DIR | ||
) | ||
|
||
mark_as_advanced(LIBFILTERAUDIO_INCLUDE_DIR LIBFILTERAUDIO_LIBRARY) | ||
|
||
set(LIBFILTERAUDIO_LIBRARIES ${LIBFILTERAUDIO_LIBRARY}) | ||
set(LIBFILTERAUDIO_INCLUDE_DIRS ${LIBFILTERAUDIO_INCLUDE_DIR}) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# - Try to find opus | ||
# Once done this will define | ||
# LIBOPUS_FOUND - System has opus | ||
# LIBOPUS_INCLUDE_DIRS - The opus include directories | ||
# LIBOPUS_LIBRARIES - The libraries needed to use opus | ||
# LIBOPUS_DEFINITIONS - Compiler switches required for using opus | ||
|
||
find_package(PkgConfig) | ||
|
||
pkg_check_modules(PKG_LIBOPUS QUIET libopus) | ||
set(LIBOPUS_DEFINITIONS ${PKG_LIBOPUS_CFLAGS_OTHER}) | ||
|
||
find_path(LIBOPUS_INCLUDE_DIR opus/opus.h HINTS | ||
${PKG_LIBOPUS_INCLUDEDIR} | ||
${PKG_LIBOPUS_INCLUDE_DIRS} | ||
${CMAKE_SOURCE_DIR}/libs/windows-x64/include | ||
) | ||
|
||
find_library(LIBOPUS_LIBRARY NAMES opus HINTS | ||
${PKG_LIBOPUS_LIBDIR} | ||
${PKG_LIBOPUS_LIBRARY_DIRS} | ||
${CMAKE_SOURCE_DIR}/libs/windows-x64/lib | ||
) | ||
|
||
include(FindPackageHandleStandardArgs) | ||
# handle the QUIETLY and REQUIRED arguments and set LIBOPUS_FOUND to TRUE | ||
# if all listed variables are TRUE | ||
find_package_handle_standard_args( | ||
libopus | ||
DEFAULT_MSG | ||
LIBOPUS_LIBRARY | ||
LIBOPUS_INCLUDE_DIR | ||
) | ||
|
||
mark_as_advanced(LIBOPUS_INCLUDE_DIR LIBOPUS_LIBRARY) | ||
|
||
set(LIBOPUS_LIBRARIES ${LIBOPUS_LIBRARY}) | ||
set(LIBOPUS_INCLUDE_DIRS ${LIBOPUS_INCLUDE_DIR}) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# - Try to find sodium | ||
# Once done this will define | ||
# LIBSODIUM_FOUND - System has sodium | ||
# LIBSODIUM_INCLUDE_DIRS - The sodium include directories | ||
# LIBSODIUM_LIBRARIES - The libraries needed to use sodium | ||
# LIBSODIUM_DEFINITIONS - Compiler switches required for using sodium | ||
|
||
find_package(PkgConfig) | ||
|
||
pkg_check_modules(PKG_LIBSODIUM QUIET libsodium) | ||
set(LIBSODIUM_DEFINITIONS ${PKG_LIBSODIUM_CFLAGS_OTHER}) | ||
|
||
find_path(LIBSODIUM_INCLUDE_DIR sodium.h HINTS | ||
${PKG_LIBSODIUM_INCLUDEDIR} | ||
${PKG_LIBSODIUM_INCLUDE_DIRS} | ||
${CMAKE_SOURCE_DIR}/libs/windows-x64/include | ||
) | ||
|
||
find_library(LIBSODIUM_LIBRARY NAMES sodium HINTS | ||
${PKG_LIBSODIUM_LIBDIR} | ||
${PKG_LIBSODIUM_LIBRARY_DIRS} | ||
${CMAKE_SOURCE_DIR}/libs/windows-x64/lib | ||
) | ||
|
||
include(FindPackageHandleStandardArgs) | ||
# handle the QUIETLY and REQUIRED arguments and set LIBSODIUM_FOUND to TRUE | ||
# if all listed variables are TRUE | ||
find_package_handle_standard_args( | ||
libsodium | ||
DEFAULT_MSG | ||
LIBSODIUM_LIBRARY | ||
LIBSODIUM_INCLUDE_DIR | ||
) | ||
|
||
mark_as_advanced(LIBSODIUM_INCLUDE_DIR LIBSODIUM_LIBRARY) | ||
|
||
set(LIBSODIUM_LIBRARIES ${LIBSODIUM_LIBRARY}) | ||
set(LIBSODIUM_INCLUDE_DIRS ${LIBSODIUM_INCLUDE_DIR}) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# - Try to find Tox | ||
# Once done this will define | ||
# LIBTOX_FOUND - System has Tox | ||
# LIBTOX_INCLUDE_DIRS - The Tox include directories | ||
# LIBTOX_LIBRARY_DIRS - The Tox lib directories | ||
# LIBTOX_LIBRARIES - The libraries needed to use Tox | ||
# LIBTOX_DEFINITIONS - Compiler switches required for using Tox | ||
# | ||
# COMPONENTS | ||
# toxencryptsave | ||
# toxav | ||
# toxdns | ||
# toxcore | ||
# toxgroup | ||
# toxmessenger | ||
# toxfriends | ||
# toxdht | ||
# toxnetcrypto | ||
# toxcrypto | ||
# toxnetwork | ||
|
||
find_package(PkgConfig) | ||
|
||
if(libtox_FIND_COMPONENTS) | ||
set(_TOX_COMPNENTS ${libtox_FIND_COMPONENTS}) | ||
else() | ||
set(_TOX_COMPNENTS toxencryptsave toxdns toxav toxcore) # default components | ||
endif() | ||
|
||
pkg_check_modules(_PKG_TOX QUIET libtoxcore) | ||
set(LIBTOX_DEFINITIONS ${_PKG_TOX_CFLAGS_OTHER}) | ||
|
||
find_path(LIBTOX_INCLUDE_DIR tox/tox.h HINTS | ||
${_PKG_TOX_INCLUDEDIR} | ||
${_PKG_TOX_INCLUDE_DIRS} | ||
${CMAKE_SOURCE_DIR}/libs/windows-x64/include | ||
) | ||
|
||
# required components | ||
foreach(_COMPNENT ${_TOX_COMPNENTS}) | ||
find_library(_TEMP NAMES ${_COMPNENT} HINTS | ||
${_PKG_TOX_LIBDIR} | ||
${_PKG_TOX_LIBRARY_DIRS} | ||
${CMAKE_SOURCE_DIR}/libs/windows-x64/lib | ||
) | ||
list(APPEND LIBTOX_LIBRARIES ${_TEMP}) | ||
unset(_TEMP CACHE) | ||
endforeach() | ||
|
||
include(FindPackageHandleStandardArgs) | ||
# handle the QUIETLY and REQUIRED arguments and set LIBTOX_FOUND to TRUE | ||
# if all listed variables are TRUE | ||
find_package_handle_standard_args( | ||
libtox | ||
DEFAULT_MSG | ||
LIBTOX_LIBRARIES | ||
LIBTOX_INCLUDE_DIR | ||
) | ||
|
||
mark_as_advanced(_TOX_COMPNENTS _PKG_TOX LIBTOX_INCLUDE_DIR) | ||
|
||
set(LIBTOX_INCLUDE_DIRS ${LIBTOX_INCLUDE_DIR}) | ||
set(LIBTOX_LIBRARY_DIRS ${_PKG_TOX_LIBRARY_DIRS}) | ||
set(LIBTOX_LIBRARY_DIR ${_PKG_TOX_LIBDIR}) | ||
|
||
unset(_TOX_COMPNENTS) | ||
unset(_COMPNENT) | ||
unset(_PKG_TOX) | ||
unset(_TEMP) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# These variables are needed to generate the Info.plist | ||
set(EXECUTABLE_NAME utox) | ||
set(APPLE_ICON utox.icns) | ||
set(APPLE_MENU MainMenu) | ||
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.6) | ||
|
||
# Xcode needs these to find libs | ||
include_directories(/usr/local/include) | ||
link_directories(/usr/local/lib) | ||
|
||
# Make apple icon | ||
add_custom_command(OUTPUT ${APPLE_ICON} | ||
COMMAND iconutil --convert icns ${uTox_SOURCE_DIR}/src/cocoa/utox.iconset -o ${APPLE_ICON} | ||
DEPENDS ${uTox_SOURCE_DIR}/src/cocoa/utox.iconset | ||
) | ||
|
||
# Make apple menu | ||
add_custom_command(OUTPUT ${APPLE_MENU}.nib | ||
COMMAND ibtool --errors --warnings --notices --output-format human-readable-text | ||
--compile ${APPLE_MENU}.nib ${uTox_SOURCE_DIR}/src/cocoa/MainMenu.xib | ||
DEPENDS ${uTox_SOURCE_DIR}/src/cocoa/MainMenu.xib | ||
) | ||
|
||
# Copy files | ||
set_source_files_properties(${APPLE_ICON} ${APPLE_MENU}.nib PROPERTIES | ||
MACOSX_PACKAGE_LOCATION "Resources") | ||
|
||
set(APPLE_FILES | ||
${APPLE_ICON} | ||
${APPLE_MENU}.nib | ||
) | ||
|
||
if(UTOX_STATIC OR TOXCORE_STATIC) | ||
set(CMAKE_FIND_LIBRARY_SUFFIXES .a .dylib) | ||
endif() | ||
|
||
# create DMG | ||
set(CPACK_GENERATOR "DragNDrop") | ||
set(CPACK_PACKAGE_FILE_NAME "uTox ${PROJECT_VERSION}") | ||
|
Oops, something went wrong.