diff --git a/CMakeLists.txt b/CMakeLists.txt index d535e82f14..3baec3b2c4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,6 +11,7 @@ set(bindir ${CMAKE_INSTALL_PREFIX}/bin CACHE PATH "bindir") set(libdir ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX} CACHE PATH "libdir") set(plugindir ${libdir}/dolphin-emu CACHE PATH "plugindir") set(datadir ${CMAKE_INSTALL_PREFIX}/share/dolphin-emu CACHE PATH "datadir") +set(DESTDIR ${DESTDIR} CACHE STRING "Leave blank unless building packages") # Set up paths set(userdir ".dolphin-emu" CACHE STRING "User directory") @@ -289,19 +290,12 @@ if(WIN32) include_directories(Externals/GLew/include) endif() -find_library(OPENCL OpenCL) -find_path(OPENCL_INCLUDE CL/cl.h) -if(OPENCL AND OPENCL_INCLUDE) - message("OpenCL found") - include_directories(${OPENCL_INCLUDE}) -else() - message("OpenCL not found, using CLRun instead") +if(NOT APPLE) include_directories(Externals/CLRun/include) add_subdirectory(Externals/CLRun) -endif(OPENCL AND OPENCL_INCLUDE) -if(NOT APPLE) + add_definitions(-DUSE_CLRUN) add_definitions(-DHAVE_OPENCL=1) -endif() +endif(NOT APPLE) set(DISABLE_WX FALSE CACHE BOOL "Disable wxWidgets (use CLI interface)") if(NOT DISABLE_WX) @@ -347,9 +341,9 @@ add_subdirectory(Source) ######################################## # Install shared data files # -install(DIRECTORY Data/User/ DESTINATION ${datadir}/user PATTERN .svn EXCLUDE) -install(DIRECTORY Data/Sys/ DESTINATION ${datadir}/sys PATTERN .svn EXCLUDE) -install(FILES Data/license.txt DESTINATION ${datadir}) +install(DIRECTORY Data/User/ DESTINATION ${DESTDIR}${datadir}/user PATTERN .svn EXCLUDE) +install(DIRECTORY Data/Sys/ DESTINATION ${DESTDIR}${datadir}/sys PATTERN .svn EXCLUDE) +install(FILES Data/license.txt DESTINATION ${DESTDIR}${datadir}) # packaging information include(CPack) @@ -361,7 +355,7 @@ set(CPACK_PACKAGE_VERSION_MINOR "0") if(DOLPHIN_IS_STABLE) set(CPACK_PACKAGE_VERSION_PATCH "0") else() - set(CPACK_PACKAGE_VERSION_PATCH ${DOLPHIN_WC_REV}) + set(CPACK_PACKAGE_VERSION_PATCH ${DOLPHIN_WC_REVISION}) endif() # TODO: CPACK_PACKAGE_DESCRIPTION_FILE diff --git a/Externals/CLRun/CMakeLists.txt b/Externals/CLRun/CMakeLists.txt index 454a7703a7..7228fb86d2 100644 --- a/Externals/CLRun/CMakeLists.txt +++ b/Externals/CLRun/CMakeLists.txt @@ -4,3 +4,6 @@ set(SRCS clrun/clrun.c clrun/genclgl.c) add_library(clrun STATIC ${SRCS}) +if(UNIX) + add_definitions(-fPIC) +endif(UNIX) diff --git a/Source/Core/Common/Src/OpenCL.cpp b/Source/Core/Common/Src/OpenCL.cpp index f196fb5ed4..451d43ab48 100644 --- a/Source/Core/Common/Src/OpenCL.cpp +++ b/Source/Core/Common/Src/OpenCL.cpp @@ -21,7 +21,7 @@ #include "Common.h" #include "Timer.h" -#ifdef _WIN32 +#if defined(_WIN32) || defined(USE_CLRUN) #include "clrun.h" #endif @@ -46,7 +46,7 @@ bool Initialize() return false; int err; // error code returned from api calls -#ifdef _WIN32 +#if defined(_WIN32) || defined(USE_CLRUN) clrInit(); if(!clrHasOpenCL()) return false; diff --git a/Source/Core/Common/Src/OpenCL.h b/Source/Core/Common/Src/OpenCL.h index fd9a74c12f..e94579a41f 100644 --- a/Source/Core/Common/Src/OpenCL.h +++ b/Source/Core/Common/Src/OpenCL.h @@ -22,7 +22,7 @@ // OpenCL on Windows is linked through the CLRun library // It provides the headers and all the imports -#ifdef _WIN32 +#if defined(_WIN32) || defined(USE_CLRUN) #define HAVE_OPENCL 1 #endif diff --git a/Source/Core/DolphinWX/CMakeLists.txt b/Source/Core/DolphinWX/CMakeLists.txt index 56a3bbc501..ea1a0fffe4 100644 --- a/Source/Core/DolphinWX/CMakeLists.txt +++ b/Source/Core/DolphinWX/CMakeLists.txt @@ -77,9 +77,9 @@ if(wxWidgets_FOUND) add_library(memcard STATIC ${MEMCARDSRCS}) add_executable(${EXEGUI} ${SRCS}) target_link_libraries(${EXEGUI} ${LIBS} ${WXLIBS}) - install(TARGETS ${EXEGUI} RUNTIME DESTINATION ${bindir}) + install(TARGETS ${EXEGUI} RUNTIME DESTINATION ${DESTDIR}${bindir}) else() add_executable(${EXENOGUI} ${SRCS}) target_link_libraries(${EXENOGUI} ${LIBS}) - install(TARGETS ${EXENOGUI} RUNTIME DESTINATION ${bindir}) + install(TARGETS ${EXENOGUI} RUNTIME DESTINATION ${DESTDIR}${bindir}) endif() diff --git a/Source/Plugins/Plugin_DSP_HLE/CMakeLists.txt b/Source/Plugins/Plugin_DSP_HLE/CMakeLists.txt index 5c6e36a0fb..d8cda08dbf 100644 --- a/Source/Plugins/Plugin_DSP_HLE/CMakeLists.txt +++ b/Source/Plugins/Plugin_DSP_HLE/CMakeLists.txt @@ -23,5 +23,5 @@ endif(wxWidgets_FOUND) add_library(Plugin_DSP_HLE SHARED ${SRCS}) target_link_libraries(Plugin_DSP_HLE common audiocommon) install(TARGETS Plugin_DSP_HLE - LIBRARY DESTINATION ${plugindir} - RUNTIME DESTINATION ${plugindir}) + LIBRARY DESTINATION ${DESTDIR}${plugindir} + RUNTIME DESTINATION ${DESTDIR}${plugindir}) diff --git a/Source/Plugins/Plugin_DSP_LLE/CMakeLists.txt b/Source/Plugins/Plugin_DSP_LLE/CMakeLists.txt index aa2843020a..16805d10bb 100644 --- a/Source/Plugins/Plugin_DSP_LLE/CMakeLists.txt +++ b/Source/Plugins/Plugin_DSP_LLE/CMakeLists.txt @@ -21,6 +21,6 @@ endif(wxWidgets_FOUND) add_library(Plugin_DSP_LLE SHARED ${SRCS}) target_link_libraries(Plugin_DSP_LLE ${LIBS}) install(TARGETS Plugin_DSP_LLE - LIBRARY DESTINATION ${plugindir} - RUNTIME DESTINATION ${plugindir}) + LIBRARY DESTINATION ${DESTDIR}${plugindir} + RUNTIME DESTINATION ${DESTDIR}${plugindir}) diff --git a/Source/Plugins/Plugin_VideoOGL/CMakeLists.txt b/Source/Plugins/Plugin_VideoOGL/CMakeLists.txt index 33d4fafc59..71126a8e06 100644 --- a/Source/Plugins/Plugin_VideoOGL/CMakeLists.txt +++ b/Source/Plugins/Plugin_VideoOGL/CMakeLists.txt @@ -31,11 +31,11 @@ if(APPLE AND NOT wxWidgets_FOUND) elseif(WIN32) set(SRCS ${SRCS} Src/OS/Win32.cpp) elseif(NOT APPLE) - set(LIBS ${LIBS} OpenCL) + set(LIBS ${LIBS} clrun) endif() add_library(Plugin_VideoOGL SHARED ${SRCS}) target_link_libraries(Plugin_VideoOGL ${LIBS}) install(TARGETS Plugin_VideoOGL - LIBRARY DESTINATION ${plugindir} - RUNTIME DESTINATION ${plugindir}) + LIBRARY DESTINATION ${DESTDIR}${plugindir} + RUNTIME DESTINATION ${DESTDIR}${plugindir})