mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-12-26 04:11:18 +00:00
Add Linux support to CMake
This commit is contained in:
parent
3f170769da
commit
dad0ad59c1
1 changed files with 17 additions and 11 deletions
|
@ -1,8 +1,6 @@
|
||||||
#
|
#
|
||||||
# Simple CMakeLists for Sonic Robo Blast 2
|
# Simple CMakeLists for Sonic Robo Blast 2
|
||||||
#
|
#
|
||||||
# Tweaked for FreeBSD, but should be extendable to support other systems
|
|
||||||
#
|
|
||||||
PROJECT(SRB2)
|
PROJECT(SRB2)
|
||||||
|
|
||||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
|
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
|
||||||
|
@ -19,9 +17,8 @@ FIND_PACKAGE(PNG)
|
||||||
#
|
#
|
||||||
|
|
||||||
# not added defines:
|
# not added defines:
|
||||||
# -DUSEASM - unportable assembler not needed
|
|
||||||
# -DHAVE_PNG - does not build (incorrect use of PNG_EXPORT etc.)
|
# -DHAVE_PNG - does not build (incorrect use of PNG_EXPORT etc.)
|
||||||
ADD_DEFINITIONS(-DDIRECTFULLSCREEN -DSDL -DHAVE_MIXER -DNOHW -DHW3SOUND -DHAVE_BLUA)
|
ADD_DEFINITIONS(-DDIRECTFULLSCREEN -DSDL -DHAVE_MIXER -DNOHW -DHW3SOUND -DHAVE_BLUA -DNOASM)
|
||||||
|
|
||||||
SET(SDL_DIR sdl) # may be set to SDL2 optionally
|
SET(SDL_DIR sdl) # may be set to SDL2 optionally
|
||||||
|
|
||||||
|
@ -145,15 +142,24 @@ SET(COMMON_SRCS
|
||||||
#
|
#
|
||||||
# Platform-specific stuff
|
# Platform-specific stuff
|
||||||
#
|
#
|
||||||
|
|
||||||
|
MACRO(EXTRALIB NAME)
|
||||||
|
FIND_LIBRARY(${NAME}_LIBRARY NAMES ${NAME})
|
||||||
|
IF(${NAME}_LIBRARY)
|
||||||
|
MESSAGE(STATUS "Found lib${NAME}: ${${NAME}_LIBRARY}")
|
||||||
|
SET(EXTRA_LIBRARIES ${EXTRA_LIBRARIES} ${${NAME}_LIBRARY})
|
||||||
|
ELSE(${NAME}_LIBRARY)
|
||||||
|
MESSAGE(FATAL_ERROR "Could not find lib${NAME}!")
|
||||||
|
ENDIF(${NAME}_LIBRARY)
|
||||||
|
ENDMACRO(EXTRALIB)
|
||||||
|
|
||||||
IF(${CMAKE_SYSTEM} MATCHES "FreeBSD")
|
IF(${CMAKE_SYSTEM} MATCHES "FreeBSD")
|
||||||
FIND_LIBRARY(KVM_LIBRARY NAMES kvm)
|
|
||||||
IF(KVM_LIBRARY)
|
|
||||||
MESSAGE(STATUS "Found libkvm: ${KVM_LIBRARY}")
|
|
||||||
SET(EXTRA_LIBRARIES ${EXTRA_LIBRARIES} ${KVM_LIBRARY})
|
|
||||||
ELSE(KVM_LIBRARY)
|
|
||||||
MESSAGE(FATAL_ERROR "Could not find libkvm!")
|
|
||||||
ENDIF(KVM_LIBRARY)
|
|
||||||
ADD_DEFINITIONS(-DUNIXCOMMON -DLINUX -DFREEBSD)
|
ADD_DEFINITIONS(-DUNIXCOMMON -DLINUX -DFREEBSD)
|
||||||
|
EXTRALIB(kvm)
|
||||||
|
ELSEIF(${CMAKE_SYSTEM} MATCHES "Linux")
|
||||||
|
ADD_DEFINITIONS(-DUNIXCOMMON -DLINUX)
|
||||||
|
EXTRALIB(m)
|
||||||
|
EXTRALIB(rt)
|
||||||
ELSE(${CMAKE_SYSTEM} MATCHES "FreeBSD")
|
ELSE(${CMAKE_SYSTEM} MATCHES "FreeBSD")
|
||||||
ADD_DEFINITIONS(-DUNIXCOMMON -DLINUX)
|
ADD_DEFINITIONS(-DUNIXCOMMON -DLINUX)
|
||||||
MESSAGE(WARNING "No specific settings for you system, it may be not supported!")
|
MESSAGE(WARNING "No specific settings for you system, it may be not supported!")
|
||||||
|
|
Loading…
Reference in a new issue