diff --git a/CMakeLists.txt b/CMakeLists.txt index 8d9addeb58..46e7f2b75c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -288,7 +288,7 @@ else() endif() if(X11_FOUND) -check_lib(XRANDR Xrandr) + check_lib(XRANDR Xrandr) endif() if(XRANDR_FOUND) add_definitions(-DHAVE_XRANDR=1) @@ -358,23 +358,27 @@ include_directories(Source/Core/VideoUICommon/Src) add_subdirectory(Externals/Bochs_disasm) include_directories(Externals/Bochs_disasm) -check_lib(LZO lzo2 lzo/lzo1x.h QUIET) +if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + check_lib(LZO lzo2 lzo/lzo1x.h QUIET) +endif() if(LZO_FOUND) message("Using shared lzo") else() - message("Shared lzo not found, falling back to the static library") + message("Using static lzo from Externals") add_subdirectory(Externals/LZO) include_directories(Externals/LZO) set(LZO lzo2) endif() -include(FindSDL OPTIONAL) +if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + include(FindSDL OPTIONAL) +endif() if(SDL_FOUND) message("Using shared SDL") include_directories(${SDL_INCLUDE_DIR}) else(SDL_FOUND) # TODO: Use the prebuilt one on Windows - message("Shared SDL not found, falling back to the static library") + message("Using static SDL from Externals") include_directories(Externals/SDL Externals/SDL/include) add_subdirectory(Externals/SDL) endif(SDL_FOUND) @@ -382,20 +386,24 @@ endif(SDL_FOUND) set(SFML_FIND_VERSION TRUE) set(SFML_FIND_VERSION_MAJOR 1) set(SFML_FIND_VERSION_MINOR 5) -include(FindSFML OPTIONAL) +if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + include(FindSFML OPTIONAL) +endif() if(SFML_FOUND AND NOT SFML_VERSION_MAJOR) # SFML 1.x doesn't define SFML_VERSION_MAJOR message("Using shared SFML") else() - message("Shared SFML < 2.0 not found, falling back to the static library") + message("Using static SFML ${SFML_FIND_VERSION_MAJOR}.${SFML_FIND_VERSION_MINOR} from Externals") add_subdirectory(Externals/SFML) include_directories(Externals/SFML/include) endif() -check_lib(SOIL SOIL SOIL/SOIL.h QUIET) +if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + check_lib(SOIL SOIL SOIL/SOIL.h QUIET) +endif() if(SOIL_FOUND) message("Using shared SOIL") else() - message("Shared SOIL not found, falling back to the static library") + message("Using static SOIL from Externals") add_subdirectory(Externals/SOIL) include_directories(Externals/SOIL) endif() @@ -419,16 +427,20 @@ if(WIN32) find_library(GLEW glew32s PATHS Externals/GLew) include_directories(Externals/GLew/include) else() - check_lib(GLEW GLEW GL/glew.h) + if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + check_lib(GLEW GLEW GL/glew.h) + endif() if(NOT GLEW_FOUND) - message("Shared GLEW not found, falling back to the static library") + message("Using static GLEW from Externals") add_subdirectory(Externals/GLew) include_directories(Externals/GLew/include) endif(NOT GLEW_FOUND) - check_lib(CG Cg Cg/cg.h) + if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + check_lib(CG Cg Cg/cg.h) + endif() if(NOT CG_FOUND) - message("Shared Cg not found, falling back to the static library") + message("Using static Cg from Externals") include_directories(Externals) endif(NOT CG_FOUND) check_lib(CGGL CgGL Cg/cgGL.h) @@ -444,8 +456,10 @@ endif() option(DISABLE_WX "Disable wxWidgets (use CLI interface)" OFF) if(NOT DISABLE_WX) - include(FindwxWidgets OPTIONAL) - FIND_PACKAGE(wxWidgets COMPONENTS core aui adv) + if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + include(FindwxWidgets OPTIONAL) + FIND_PACKAGE(wxWidgets COMPONENTS core aui adv) + endif() if(wxWidgets_FOUND) EXECUTE_PROCESS( @@ -491,7 +505,7 @@ if(NOT DISABLE_WX) if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") message(FATAL_ERROR "wxWidgets not found. It is required to build the GUI") endif() - message("Shared wxWidgets not found, falling back to the static library") + message("Using static wxWidgets from Externals") if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") add_definitions(-D__WXOSX_COCOA__) include_directories(Externals/wxWidgets3)