Fix for CMake/system libSGM issue: consistent path
Our copy of libGSM, and a system-wide version have different include suffixes, so adjust the FindGsm.cmake so that the returned include-path is consistent with our internal version. See discussion in:https://sourceforge.net/p/flightgear/codetickets/2368/
This commit is contained in:
parent
1f6b43c38f
commit
22bad9db33
2 changed files with 7 additions and 9 deletions
2
3rdparty/iaxclient/lib/CMakeLists.txt
vendored
2
3rdparty/iaxclient/lib/CMakeLists.txt
vendored
|
@ -55,7 +55,7 @@ if (SYSTEM_GSM)
|
||||||
find_package(Gsm)
|
find_package(Gsm)
|
||||||
endif(SYSTEM_GSM)
|
endif(SYSTEM_GSM)
|
||||||
|
|
||||||
if (GSM_FOUND)
|
if (SYSTEM_GSM AND GSM_FOUND)
|
||||||
message(STATUS "Using GSM includes at: ${GSM_INCLUDE_DIR}")
|
message(STATUS "Using GSM includes at: ${GSM_INCLUDE_DIR}")
|
||||||
message(STATUS "Using GSM libraries: ${GSM_LIBRARIES}")
|
message(STATUS "Using GSM libraries: ${GSM_LIBRARIES}")
|
||||||
target_include_directories(iaxclient_lib PRIVATE ${GSM_INCLUDE_DIR})
|
target_include_directories(iaxclient_lib PRIVATE ${GSM_INCLUDE_DIR})
|
||||||
|
|
|
@ -19,19 +19,15 @@ if (GSM_LIBRARIES AND GSM_INCLUDE_DIRS)
|
||||||
# in cache already
|
# in cache already
|
||||||
set(GSM_FOUND TRUE)
|
set(GSM_FOUND TRUE)
|
||||||
else (GSM_LIBRARIES AND GSM_INCLUDE_DIRS)
|
else (GSM_LIBRARIES AND GSM_INCLUDE_DIRS)
|
||||||
# use pkg-config to get the directories and then use these values
|
|
||||||
# in the FIND_PATH() and FIND_LIBRARY() calls
|
|
||||||
#include(UsePkgConfig)
|
|
||||||
|
|
||||||
#FIXME pkgconfig does not work: return a carriage return that makes compilation failed
|
|
||||||
#pkgconfig(speex _GsmIncDir _GsmLinkDir _GsmLinkFlags _GsmCflags)
|
|
||||||
|
|
||||||
#set(GSM_DEFINITIONS ${_GsmCflags})
|
|
||||||
set(GSM_DEFINITIONS "")
|
set(GSM_DEFINITIONS "")
|
||||||
|
|
||||||
|
# gsm.h might be at $prefix/include/gsm/gsm.h, but our internal
|
||||||
|
# version is at inc/gsm.h, so we need to include that as a PATH_SUFFIX
|
||||||
|
# otherwise we get into a mess.
|
||||||
|
# see: https://sourceforge.net/p/flightgear/codetickets/2368/
|
||||||
find_path(GSM_INCLUDE_DIR
|
find_path(GSM_INCLUDE_DIR
|
||||||
NAMES
|
NAMES
|
||||||
gsm/gsm.h
|
|
||||||
gsm.h
|
gsm.h
|
||||||
PATHS
|
PATHS
|
||||||
${_GsmIncDir}
|
${_GsmIncDir}
|
||||||
|
@ -39,6 +35,8 @@ else (GSM_LIBRARIES AND GSM_INCLUDE_DIRS)
|
||||||
/usr/local/include
|
/usr/local/include
|
||||||
/opt/local/include
|
/opt/local/include
|
||||||
/sw/include
|
/sw/include
|
||||||
|
PATH_SUFFIXES
|
||||||
|
gsm
|
||||||
)
|
)
|
||||||
|
|
||||||
find_library(GSM_LIBRARY
|
find_library(GSM_LIBRARY
|
||||||
|
|
Loading…
Add table
Reference in a new issue