Merge pull request #1576 from comex/osx-qt-build-fixes
OS X Qt build fixes
This commit is contained in:
commit
aa452f4fe8
|
@ -48,6 +48,8 @@ endif()
|
||||||
project(dolphin-emu)
|
project(dolphin-emu)
|
||||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/CMakeTests)
|
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/CMakeTests)
|
||||||
set(DOLPHIN_IS_STABLE FALSE)
|
set(DOLPHIN_IS_STABLE FALSE)
|
||||||
|
# Libraries to link
|
||||||
|
set(LIBS)
|
||||||
|
|
||||||
# Set up paths
|
# Set up paths
|
||||||
if((${CMAKE_SYSTEM_NAME} MATCHES "Darwin"))
|
if((${CMAKE_SYSTEM_NAME} MATCHES "Darwin"))
|
||||||
|
@ -411,6 +413,7 @@ if(NOT ANDROID)
|
||||||
set(HAS_LLVM 1)
|
set(HAS_LLVM 1)
|
||||||
|
|
||||||
include_directories(${LLVM_INCLUDE_DIRS})
|
include_directories(${LLVM_INCLUDE_DIRS})
|
||||||
|
list(APPEND LIBS ${LLVM_LIBRARIES})
|
||||||
|
|
||||||
message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
|
message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
|
||||||
endif()
|
endif()
|
||||||
|
@ -456,6 +459,10 @@ if(NOT ANDROID)
|
||||||
endif()
|
endif()
|
||||||
if(ENCODE_FRAMEDUMPS)
|
if(ENCODE_FRAMEDUMPS)
|
||||||
check_libav()
|
check_libav()
|
||||||
|
if(LIBAV_FOUND)
|
||||||
|
LIST(APPEND LIBS ${LIBAV_LIBRARIES})
|
||||||
|
endif()
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(CMAKE_REQUIRED_LIBRARIES portaudio)
|
set(CMAKE_REQUIRED_LIBRARIES portaudio)
|
||||||
|
@ -535,6 +542,7 @@ else()
|
||||||
include_directories(Externals/LZO)
|
include_directories(Externals/LZO)
|
||||||
set(LZO lzo2)
|
set(LZO lzo2)
|
||||||
endif()
|
endif()
|
||||||
|
list(APPEND LIBS ${LZO})
|
||||||
|
|
||||||
if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND NOT ANDROID)
|
if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND NOT ANDROID)
|
||||||
check_lib(PNG png png.h QUIET)
|
check_lib(PNG png png.h QUIET)
|
||||||
|
@ -619,6 +627,7 @@ if(USE_UPNP)
|
||||||
include_directories(Externals/miniupnpc/src)
|
include_directories(Externals/miniupnpc/src)
|
||||||
endif()
|
endif()
|
||||||
add_definitions(-DUSE_UPNP)
|
add_definitions(-DUSE_UPNP)
|
||||||
|
list(APPEND LIBS miniupnpc)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND NOT ANDROID)
|
if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND NOT ANDROID)
|
||||||
|
@ -649,6 +658,12 @@ if (ANDROID)
|
||||||
message("Using static iconv from Externals")
|
message("Using static iconv from Externals")
|
||||||
include_directories(Externals/libiconv-1.14/include)
|
include_directories(Externals/libiconv-1.14/include)
|
||||||
add_subdirectory(Externals/libiconv-1.14)
|
add_subdirectory(Externals/libiconv-1.14)
|
||||||
|
list(APPEND LIBS iconv)
|
||||||
|
else()
|
||||||
|
find_library(ICONV_LIBRARIES NAMES iconv libiconv libiconv-2 c)
|
||||||
|
find_path(ICONV_INCLUDE_DIR NAMES iconv.h)
|
||||||
|
list(APPEND LIBS ${ICONV_LIBRARIES})
|
||||||
|
mark_as_advanced(ICONV_INCLUDE_DIR ICONV_LIBRARIES)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ENABLE_QT)
|
if(ENABLE_QT)
|
||||||
|
@ -695,6 +710,7 @@ if(NOT DISABLE_WX AND NOT ANDROID)
|
||||||
include(FindGTK2)
|
include(FindGTK2)
|
||||||
if(GTK2_FOUND)
|
if(GTK2_FOUND)
|
||||||
include_directories(${GTK2_INCLUDE_DIRS})
|
include_directories(${GTK2_INCLUDE_DIRS})
|
||||||
|
list(APPEND LIBS ${GTK2_LIBRARIES})
|
||||||
else()
|
else()
|
||||||
message(FATAL_ERROR "GTK is required to build the WX UI. Please install the GTK development libraries.")
|
message(FATAL_ERROR "GTK is required to build the WX UI. Please install the GTK development libraries.")
|
||||||
endif()
|
endif()
|
||||||
|
@ -733,6 +749,23 @@ if(NOT DISABLE_WX AND NOT ANDROID)
|
||||||
add_definitions(-DHAVE_WX=1)
|
add_definitions(-DHAVE_WX=1)
|
||||||
endif(NOT DISABLE_WX AND NOT ANDROID)
|
endif(NOT DISABLE_WX AND NOT ANDROID)
|
||||||
|
|
||||||
|
if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD" OR
|
||||||
|
${CMAKE_SYSTEM_NAME} MATCHES "NetBSD")
|
||||||
|
set(LIBS ${LIBS} usbhid)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||||
|
# Link against OS X system frameworks.
|
||||||
|
list(APPEND LIBS
|
||||||
|
${APPKIT_LIBRARY}
|
||||||
|
${AU_LIBRARY}
|
||||||
|
${COREAUDIO_LIBRARY}
|
||||||
|
${COREFUND_LIBRARY}
|
||||||
|
${CORESERV_LIBRARY}
|
||||||
|
${IOK_LIBRARY}
|
||||||
|
${FORCEFEEDBACK}
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
########################################
|
########################################
|
||||||
# Pre-build events: Define configuration variables and write SCM info header
|
# Pre-build events: Define configuration variables and write SCM info header
|
||||||
|
|
|
@ -23,19 +23,9 @@ set(UIS
|
||||||
SystemInfo.ui
|
SystemInfo.ui
|
||||||
)
|
)
|
||||||
|
|
||||||
set(LIBS core uicommon)
|
list(APPEND LIBS core uicommon)
|
||||||
|
|
||||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||||
# Link against OS X system frameworks.
|
|
||||||
list(APPEND LIBS
|
|
||||||
${APPKIT_LIBRARY}
|
|
||||||
${AU_LIBRARY}
|
|
||||||
${COREAUDIO_LIBRARY}
|
|
||||||
${COREFUND_LIBRARY}
|
|
||||||
${CORESERV_LIBRARY}
|
|
||||||
${IOK_LIBRARY}
|
|
||||||
${FORCEFEEDBACK}
|
|
||||||
)
|
|
||||||
set(DOLPHINQT_BINARY DolphinQt)
|
set(DOLPHINQT_BINARY DolphinQt)
|
||||||
else()
|
else()
|
||||||
set(DOLPHINQT_BINARY dolphin-emu-qt)
|
set(DOLPHINQT_BINARY dolphin-emu-qt)
|
||||||
|
@ -83,7 +73,7 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||||
COMMAND ln -nfs ${CMAKE_SOURCE_DIR}/Data/Sys ${BUNDLE_PATH}/Contents/Resources/Sys
|
COMMAND ln -nfs ${CMAKE_SOURCE_DIR}/Data/Sys ${BUNDLE_PATH}/Contents/Resources/Sys
|
||||||
VERBATIM
|
VERBATIM
|
||||||
)
|
)
|
||||||
add_custom_target(CopyDataIntoBundle ALL
|
add_custom_target(CopyDataIntoBundleQt ALL
|
||||||
DEPENDS ${BUNDLE_PATH}/Contents/Resources/Sys
|
DEPENDS ${BUNDLE_PATH}/Contents/Resources/Sys
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -1,18 +1,3 @@
|
||||||
set(LIBS core
|
|
||||||
uicommon
|
|
||||||
${LZO}
|
|
||||||
${GTK2_LIBRARIES})
|
|
||||||
|
|
||||||
if(NOT ANDROID)
|
|
||||||
link_directories(${CMAKE_PREFIX_PATH}/lib)
|
|
||||||
else()
|
|
||||||
set(LIBS ${LIBS} png iconv)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(LIBAV_FOUND)
|
|
||||||
set(LIBS ${LIBS} ${LIBAV_LIBRARIES})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(GUI_SRCS
|
set(GUI_SRCS
|
||||||
ARCodeAddEdit.cpp
|
ARCodeAddEdit.cpp
|
||||||
AboutDolphin.cpp
|
AboutDolphin.cpp
|
||||||
|
@ -65,24 +50,21 @@ set(GUI_SRCS
|
||||||
|
|
||||||
set(WXLIBS ${wxWidgets_LIBRARIES} dl)
|
set(WXLIBS ${wxWidgets_LIBRARIES} dl)
|
||||||
|
|
||||||
|
list(APPEND LIBS core uicommon)
|
||||||
|
|
||||||
|
if(ANDROID)
|
||||||
|
list(APPEND LIBS png)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
set(ANDROID_SRCS Android/ButtonManager.cpp
|
set(ANDROID_SRCS Android/ButtonManager.cpp
|
||||||
MainAndroid.cpp)
|
MainAndroid.cpp)
|
||||||
|
|
||||||
set(NOGUI_SRCS MainNoGUI.cpp)
|
set(NOGUI_SRCS MainNoGUI.cpp)
|
||||||
|
|
||||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||||
# Link against OS X system frameworks.
|
|
||||||
list(APPEND LIBS
|
|
||||||
${APPKIT_LIBRARY}
|
|
||||||
${AU_LIBRARY}
|
|
||||||
${COREAUDIO_LIBRARY}
|
|
||||||
${COREFUND_LIBRARY}
|
|
||||||
${CORESERV_LIBRARY}
|
|
||||||
${IOK_LIBRARY}
|
|
||||||
${FORCEFEEDBACK}
|
|
||||||
)
|
|
||||||
if(wxWidgets_FOUND)
|
if(wxWidgets_FOUND)
|
||||||
list(APPEND LIBS
|
list(APPEND WXLIBS
|
||||||
${APPSERV_LIBRARY}
|
${APPSERV_LIBRARY}
|
||||||
${COCOA_LIBRARY}
|
${COCOA_LIBRARY}
|
||||||
)
|
)
|
||||||
|
@ -94,11 +76,6 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||||
MACOSX_PACKAGE_LOCATION Resources)
|
MACOSX_PACKAGE_LOCATION Resources)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD" OR
|
|
||||||
${CMAKE_SYSTEM_NAME} MATCHES "NetBSD")
|
|
||||||
set(LIBS ${LIBS} usbhid)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||||
set(DOLPHIN_EXE_BASE Dolphin)
|
set(DOLPHIN_EXE_BASE Dolphin)
|
||||||
else()
|
else()
|
||||||
|
@ -107,10 +84,6 @@ endif()
|
||||||
|
|
||||||
set(DOLPHIN_EXE ${DOLPHIN_EXE_BASE})
|
set(DOLPHIN_EXE ${DOLPHIN_EXE_BASE})
|
||||||
|
|
||||||
if(USE_UPNP)
|
|
||||||
set(LIBS ${LIBS} miniupnpc)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
include(FindGettext)
|
include(FindGettext)
|
||||||
if(GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE AND wxWidgets_FOUND)
|
if(GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE AND wxWidgets_FOUND)
|
||||||
file(GLOB LINGUAS ${CMAKE_SOURCE_DIR}/Languages/po/*.po)
|
file(GLOB LINGUAS ${CMAKE_SOURCE_DIR}/Languages/po/*.po)
|
||||||
|
@ -145,7 +118,7 @@ if(ANDROID)
|
||||||
set(CPACK_PACKAGE_EXECUTABLES ${CPACK_PACKAGE_EXECUTABLES} ${DOLPHIN_EXE})
|
set(CPACK_PACKAGE_EXECUTABLES ${CPACK_PACKAGE_EXECUTABLES} ${DOLPHIN_EXE})
|
||||||
elseif(wxWidgets_FOUND)
|
elseif(wxWidgets_FOUND)
|
||||||
add_executable(${DOLPHIN_EXE} ${SRCS} ${GUI_SRCS})
|
add_executable(${DOLPHIN_EXE} ${SRCS} ${GUI_SRCS})
|
||||||
target_link_libraries(${DOLPHIN_EXE} ${LIBS} ${WXLIBS} ${LLVM_LIBRARIES})
|
target_link_libraries(${DOLPHIN_EXE} ${LIBS} ${WXLIBS})
|
||||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||||
include(BundleUtilities)
|
include(BundleUtilities)
|
||||||
set(BUNDLE_PATH ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${DOLPHIN_EXE}.app)
|
set(BUNDLE_PATH ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${DOLPHIN_EXE}.app)
|
||||||
|
@ -181,7 +154,7 @@ elseif(wxWidgets_FOUND)
|
||||||
COMMAND ln -nfs ${CMAKE_SOURCE_DIR}/Data/Sys ${BUNDLE_PATH}/Contents/Resources/Sys
|
COMMAND ln -nfs ${CMAKE_SOURCE_DIR}/Data/Sys ${BUNDLE_PATH}/Contents/Resources/Sys
|
||||||
VERBATIM
|
VERBATIM
|
||||||
)
|
)
|
||||||
add_custom_target(CopyDataIntoBundle ALL
|
add_custom_target(CopyDataIntoBundleWx ALL
|
||||||
DEPENDS ${BUNDLE_PATH}/Contents/Resources/Sys
|
DEPENDS ${BUNDLE_PATH}/Contents/Resources/Sys
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
@ -219,7 +192,7 @@ elseif(wxWidgets_FOUND)
|
||||||
${CMAKE_SOURCE_DIR}/Data/Sys
|
${CMAKE_SOURCE_DIR}/Data/Sys
|
||||||
VERBATIM
|
VERBATIM
|
||||||
)
|
)
|
||||||
add_custom_target(CopyTranslationsIntoBundle ALL
|
add_custom_target(CopyTranslationsIntoBundleWx ALL
|
||||||
DEPENDS ${BUNDLE_PATH}/Contents/Resources/en.lproj
|
DEPENDS ${BUNDLE_PATH}/Contents/Resources/en.lproj
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
Loading…
Reference in New Issue