From 688b1e537ead4752dfcff83b13912b38cd478c91 Mon Sep 17 00:00:00 2001 From: comex Date: Wed, 19 Nov 2014 14:51:25 -0500 Subject: [PATCH 1/2] rename CopyDataIntoBundle target name to avoid wx/qt conflict --- Source/Core/DolphinQt/CMakeLists.txt | 2 +- Source/Core/DolphinWX/CMakeLists.txt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Core/DolphinQt/CMakeLists.txt b/Source/Core/DolphinQt/CMakeLists.txt index 48fd1cfa06..15e1d65aeb 100644 --- a/Source/Core/DolphinQt/CMakeLists.txt +++ b/Source/Core/DolphinQt/CMakeLists.txt @@ -83,7 +83,7 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") COMMAND ln -nfs ${CMAKE_SOURCE_DIR}/Data/Sys ${BUNDLE_PATH}/Contents/Resources/Sys VERBATIM ) - add_custom_target(CopyDataIntoBundle ALL + add_custom_target(CopyDataIntoBundleQt ALL DEPENDS ${BUNDLE_PATH}/Contents/Resources/Sys ) endif() diff --git a/Source/Core/DolphinWX/CMakeLists.txt b/Source/Core/DolphinWX/CMakeLists.txt index 945cb49164..dda499e8ea 100644 --- a/Source/Core/DolphinWX/CMakeLists.txt +++ b/Source/Core/DolphinWX/CMakeLists.txt @@ -181,7 +181,7 @@ elseif(wxWidgets_FOUND) COMMAND ln -nfs ${CMAKE_SOURCE_DIR}/Data/Sys ${BUNDLE_PATH}/Contents/Resources/Sys VERBATIM ) - add_custom_target(CopyDataIntoBundle ALL + add_custom_target(CopyDataIntoBundleWx ALL DEPENDS ${BUNDLE_PATH}/Contents/Resources/Sys ) endif() @@ -219,7 +219,7 @@ elseif(wxWidgets_FOUND) ${CMAKE_SOURCE_DIR}/Data/Sys VERBATIM ) - add_custom_target(CopyTranslationsIntoBundle ALL + add_custom_target(CopyTranslationsIntoBundleWx ALL DEPENDS ${BUNDLE_PATH}/Contents/Resources/en.lproj ) endif() From ba4a763410b223d2caf8374d67a6f72a0bfadda4 Mon Sep 17 00:00:00 2001 From: comex Date: Wed, 19 Nov 2014 19:55:52 -0500 Subject: [PATCH 2/2] Move library aggregation into common CMakeLists.txt; add missing libs to DolphinQt. Fixes DolphinQt build (on OS X, anyway) when libav is enabled. --- CMakeLists.txt | 33 ++++++++++++++++++++ Source/Core/DolphinQt/CMakeLists.txt | 12 +------- Source/Core/DolphinWX/CMakeLists.txt | 45 ++++++---------------------- 3 files changed, 43 insertions(+), 47 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 08dce87c62..518c0b59db 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,6 +48,8 @@ endif() project(dolphin-emu) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/CMakeTests) set(DOLPHIN_IS_STABLE FALSE) +# Libraries to link +set(LIBS) # Set up paths if((${CMAKE_SYSTEM_NAME} MATCHES "Darwin")) @@ -411,6 +413,7 @@ if(NOT ANDROID) set(HAS_LLVM 1) include_directories(${LLVM_INCLUDE_DIRS}) + list(APPEND LIBS ${LLVM_LIBRARIES}) message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}") endif() @@ -456,6 +459,10 @@ if(NOT ANDROID) endif() if(ENCODE_FRAMEDUMPS) check_libav() + if(LIBAV_FOUND) + LIST(APPEND LIBS ${LIBAV_LIBRARIES}) + endif() + endif() set(CMAKE_REQUIRED_LIBRARIES portaudio) @@ -535,6 +542,7 @@ else() include_directories(Externals/LZO) set(LZO lzo2) endif() +list(APPEND LIBS ${LZO}) if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND NOT ANDROID) check_lib(PNG png png.h QUIET) @@ -619,6 +627,7 @@ if(USE_UPNP) include_directories(Externals/miniupnpc/src) endif() add_definitions(-DUSE_UPNP) + list(APPEND LIBS miniupnpc) endif() if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND NOT ANDROID) @@ -649,6 +658,12 @@ if (ANDROID) message("Using static iconv from Externals") include_directories(Externals/libiconv-1.14/include) 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() if(ENABLE_QT) @@ -695,6 +710,7 @@ if(NOT DISABLE_WX AND NOT ANDROID) include(FindGTK2) if(GTK2_FOUND) include_directories(${GTK2_INCLUDE_DIRS}) + list(APPEND LIBS ${GTK2_LIBRARIES}) else() message(FATAL_ERROR "GTK is required to build the WX UI. Please install the GTK development libraries.") endif() @@ -733,6 +749,23 @@ if(NOT DISABLE_WX AND NOT ANDROID) add_definitions(-DHAVE_WX=1) 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 diff --git a/Source/Core/DolphinQt/CMakeLists.txt b/Source/Core/DolphinQt/CMakeLists.txt index 15e1d65aeb..cce40889d9 100644 --- a/Source/Core/DolphinQt/CMakeLists.txt +++ b/Source/Core/DolphinQt/CMakeLists.txt @@ -23,19 +23,9 @@ set(UIS SystemInfo.ui ) -set(LIBS core uicommon) +list(APPEND LIBS core uicommon) 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) else() set(DOLPHINQT_BINARY dolphin-emu-qt) diff --git a/Source/Core/DolphinWX/CMakeLists.txt b/Source/Core/DolphinWX/CMakeLists.txt index dda499e8ea..7d70e0692b 100644 --- a/Source/Core/DolphinWX/CMakeLists.txt +++ b/Source/Core/DolphinWX/CMakeLists.txt @@ -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 ARCodeAddEdit.cpp AboutDolphin.cpp @@ -65,24 +50,21 @@ set(GUI_SRCS set(WXLIBS ${wxWidgets_LIBRARIES} dl) +list(APPEND LIBS core uicommon) + +if(ANDROID) + list(APPEND LIBS png) +endif() + + set(ANDROID_SRCS Android/ButtonManager.cpp MainAndroid.cpp) set(NOGUI_SRCS MainNoGUI.cpp) 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) - list(APPEND LIBS + list(APPEND WXLIBS ${APPSERV_LIBRARY} ${COCOA_LIBRARY} ) @@ -94,11 +76,6 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") MACOSX_PACKAGE_LOCATION Resources) endif() -if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD" OR - ${CMAKE_SYSTEM_NAME} MATCHES "NetBSD") - set(LIBS ${LIBS} usbhid) -endif() - if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") set(DOLPHIN_EXE_BASE Dolphin) else() @@ -107,10 +84,6 @@ endif() set(DOLPHIN_EXE ${DOLPHIN_EXE_BASE}) -if(USE_UPNP) - set(LIBS ${LIBS} miniupnpc) -endif() - include(FindGettext) if(GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE AND wxWidgets_FOUND) file(GLOB LINGUAS ${CMAKE_SOURCE_DIR}/Languages/po/*.po) @@ -145,7 +118,7 @@ if(ANDROID) set(CPACK_PACKAGE_EXECUTABLES ${CPACK_PACKAGE_EXECUTABLES} ${DOLPHIN_EXE}) elseif(wxWidgets_FOUND) 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") include(BundleUtilities) set(BUNDLE_PATH ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${DOLPHIN_EXE}.app)