cmake: Setup FreeBSD

This commit is contained in:
Jonathan Li 2016-05-01 10:14:44 +01:00
parent f95c38f632
commit e23b6e3484
4 changed files with 17 additions and 7 deletions

View File

@ -293,7 +293,7 @@ set(AGGRESSIVE_WARNING "-Wstrict-aliasing -Wstrict-overflow=2 ")
if (USE_CLANG) if (USE_CLANG)
# -Wno-deprecated-register: glib issue... # -Wno-deprecated-register: glib issue...
set(DEFAULT_WARNINGS "${DEFAULT_WARNINGS} -Wno-deprecated-register -Wno-c++14-extensions") set(DEFAULT_WARNINGS "${DEFAULT_WARNINGS} -Wno-deprecated-register -Wno-c++14-extensions")
if (NOT APPLE) if (Linux)
set(COMMON_FLAG "${COMMON_FLAG} -no-integrated-as") set(COMMON_FLAG "${COMMON_FLAG} -no-integrated-as")
endif() endif()
set(DBG "-g -fno-omit-frame-pointer") set(DBG "-g -fno-omit-frame-pointer")

View File

@ -7,15 +7,20 @@ if(LIBC_LIBRARIES)
set(LIBC_FIND_QUIETLY TRUE) set(LIBC_FIND_QUIETLY TRUE)
endif(LIBC_LIBRARIES) endif(LIBC_LIBRARIES)
find_library(libdl NAMES dl)
find_library(libm NAMES m) find_library(libm NAMES m)
# OSX doesn't have rt. On Linux timer and aio dependency. # OSX doesn't have rt. On Linux timer and aio dependency.
if(APPLE) if(APPLE)
find_library(libdl NAMES dl)
set(LIBC_LIBRARIES ${librt} ${libdl} ${libm}) set(LIBC_LIBRARIES ${librt} ${libdl} ${libm})
else() elseif(Linux)
find_library(libdl NAMES dl)
find_library(librt NAMES rt) find_library(librt NAMES rt)
set(LIBC_LIBRARIES ${librt} ${libdl} ${libm}) set(LIBC_LIBRARIES ${librt} ${libdl} ${libm})
else()
# FreeBSD doesn't have libdl
find_library(librt NAMES rt)
set(LIBC_LIBRARIES ${librt} ${libm})
endif() endif()
# handle the QUIETLY and REQUIRED arguments and set LIBC_FOUND to TRUE if # handle the QUIETLY and REQUIRED arguments and set LIBC_FOUND to TRUE if

View File

@ -2,7 +2,9 @@
# Search all libraries on the system # Search all libraries on the system
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
## Use cmake package to find module ## Use cmake package to find module
find_package(ALSA) if (Linux)
find_package(ALSA)
endif()
find_package(Gettext) # translation tool find_package(Gettext) # translation tool
if(EXISTS ${PROJECT_SOURCE_DIR}/.git) if(EXISTS ${PROJECT_SOURCE_DIR}/.git)
find_package(Git) find_package(Git)
@ -50,6 +52,9 @@ if(CMAKE_CROSSCOMPILING)
endif() endif()
endif() endif()
else() else()
if (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
set(wxWidgets_CONFIG_EXECUTABLE "/usr/local/bin/wxgtk2u-3.0-config")
endif()
if(EXISTS "/usr/bin/wx-config-3.0") if(EXISTS "/usr/bin/wx-config-3.0")
set(wxWidgets_CONFIG_EXECUTABLE "/usr/bin/wx-config-3.0") set(wxWidgets_CONFIG_EXECUTABLE "/usr/bin/wx-config-3.0")
endif() endif()

View File

@ -218,7 +218,7 @@ endif()
#--------------------------------------- #---------------------------------------
# Not ready to be packaged # Not ready to be packaged
if(EXTRA_PLUGINS OR NOT PACKAGE_MODE) if(EXTRA_PLUGINS OR NOT PACKAGE_MODE)
if(GTKn_FOUND AND X11_FOUND) if(Linux AND GTKn_FOUND AND X11_FOUND)
set(LilyPad TRUE) set(LilyPad TRUE)
endif() endif()
endif() endif()
@ -257,8 +257,8 @@ endif()
# -SDL # -SDL
# -common_libs # -common_libs
#--------------------------------------- #---------------------------------------
if((APPLE AND PORTAUDIO_FOUND AND SOUNDTOUCH_FOUND AND SDLn_FOUND AND common_libs) if((PORTAUDIO_FOUND AND SOUNDTOUCH_FOUND AND SDLn_FOUND AND common_libs)
OR (Linux AND ALSA_FOUND AND PORTAUDIO_FOUND AND SOUNDTOUCH_FOUND AND SDLn_FOUND AND common_libs)) AND ((Linux AND ALSA_FOUND) OR (UNIX AND NOT Linux)))
set(spu2-x TRUE) set(spu2-x TRUE)
elseif(NOT EXISTS "${CMAKE_SOURCE_DIR}/plugins/spu2-x") elseif(NOT EXISTS "${CMAKE_SOURCE_DIR}/plugins/spu2-x")
set(spu2-x FALSE) set(spu2-x FALSE)