mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-24 23:11:14 +01:00
A couple of changes to the cmake build system.
First: Added a DESTDIR option for package building. Second: Change the OpenCL setup. On both linux and windows use CLRun. I completely removed the option here. If CLRun works on MacOSX this should be done there as well, and this change implemented in the scons build also. Then we could remove the HAVE_OPENCL and the new USE_CLRUN definitions. Then we will finally have the dynamic detection of opencl set up cross platform. On a side note, it doesn't seem that the program loaded from TextureDecoder.cl compiles or runs. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6366 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
7dd7bd2b03
commit
7b34def0fc
@ -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(libdir ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX} CACHE PATH "libdir")
|
||||||
set(plugindir ${libdir}/dolphin-emu CACHE PATH "plugindir")
|
set(plugindir ${libdir}/dolphin-emu CACHE PATH "plugindir")
|
||||||
set(datadir ${CMAKE_INSTALL_PREFIX}/share/dolphin-emu CACHE PATH "datadir")
|
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 up paths
|
||||||
set(userdir ".dolphin-emu" CACHE STRING "User directory")
|
set(userdir ".dolphin-emu" CACHE STRING "User directory")
|
||||||
@ -289,19 +290,12 @@ if(WIN32)
|
|||||||
include_directories(Externals/GLew/include)
|
include_directories(Externals/GLew/include)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
find_library(OPENCL OpenCL)
|
if(NOT APPLE)
|
||||||
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")
|
|
||||||
include_directories(Externals/CLRun/include)
|
include_directories(Externals/CLRun/include)
|
||||||
add_subdirectory(Externals/CLRun)
|
add_subdirectory(Externals/CLRun)
|
||||||
endif(OPENCL AND OPENCL_INCLUDE)
|
add_definitions(-DUSE_CLRUN)
|
||||||
if(NOT APPLE)
|
|
||||||
add_definitions(-DHAVE_OPENCL=1)
|
add_definitions(-DHAVE_OPENCL=1)
|
||||||
endif()
|
endif(NOT APPLE)
|
||||||
|
|
||||||
set(DISABLE_WX FALSE CACHE BOOL "Disable wxWidgets (use CLI interface)")
|
set(DISABLE_WX FALSE CACHE BOOL "Disable wxWidgets (use CLI interface)")
|
||||||
if(NOT DISABLE_WX)
|
if(NOT DISABLE_WX)
|
||||||
@ -347,9 +341,9 @@ add_subdirectory(Source)
|
|||||||
########################################
|
########################################
|
||||||
# Install shared data files
|
# Install shared data files
|
||||||
#
|
#
|
||||||
install(DIRECTORY Data/User/ DESTINATION ${datadir}/user PATTERN .svn EXCLUDE)
|
install(DIRECTORY Data/User/ DESTINATION ${DESTDIR}${datadir}/user PATTERN .svn EXCLUDE)
|
||||||
install(DIRECTORY Data/Sys/ DESTINATION ${datadir}/sys PATTERN .svn EXCLUDE)
|
install(DIRECTORY Data/Sys/ DESTINATION ${DESTDIR}${datadir}/sys PATTERN .svn EXCLUDE)
|
||||||
install(FILES Data/license.txt DESTINATION ${datadir})
|
install(FILES Data/license.txt DESTINATION ${DESTDIR}${datadir})
|
||||||
|
|
||||||
# packaging information
|
# packaging information
|
||||||
include(CPack)
|
include(CPack)
|
||||||
@ -361,7 +355,7 @@ set(CPACK_PACKAGE_VERSION_MINOR "0")
|
|||||||
if(DOLPHIN_IS_STABLE)
|
if(DOLPHIN_IS_STABLE)
|
||||||
set(CPACK_PACKAGE_VERSION_PATCH "0")
|
set(CPACK_PACKAGE_VERSION_PATCH "0")
|
||||||
else()
|
else()
|
||||||
set(CPACK_PACKAGE_VERSION_PATCH ${DOLPHIN_WC_REV})
|
set(CPACK_PACKAGE_VERSION_PATCH ${DOLPHIN_WC_REVISION})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# TODO: CPACK_PACKAGE_DESCRIPTION_FILE
|
# TODO: CPACK_PACKAGE_DESCRIPTION_FILE
|
||||||
|
3
Externals/CLRun/CMakeLists.txt
vendored
3
Externals/CLRun/CMakeLists.txt
vendored
@ -4,3 +4,6 @@ set(SRCS clrun/clrun.c
|
|||||||
clrun/genclgl.c)
|
clrun/genclgl.c)
|
||||||
|
|
||||||
add_library(clrun STATIC ${SRCS})
|
add_library(clrun STATIC ${SRCS})
|
||||||
|
if(UNIX)
|
||||||
|
add_definitions(-fPIC)
|
||||||
|
endif(UNIX)
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
#include "Common.h"
|
#include "Common.h"
|
||||||
#include "Timer.h"
|
#include "Timer.h"
|
||||||
|
|
||||||
#ifdef _WIN32
|
#if defined(_WIN32) || defined(USE_CLRUN)
|
||||||
#include "clrun.h"
|
#include "clrun.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -46,7 +46,7 @@ bool Initialize()
|
|||||||
return false;
|
return false;
|
||||||
int err; // error code returned from api calls
|
int err; // error code returned from api calls
|
||||||
|
|
||||||
#ifdef _WIN32
|
#if defined(_WIN32) || defined(USE_CLRUN)
|
||||||
clrInit();
|
clrInit();
|
||||||
if(!clrHasOpenCL())
|
if(!clrHasOpenCL())
|
||||||
return false;
|
return false;
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
// OpenCL on Windows is linked through the CLRun library
|
// OpenCL on Windows is linked through the CLRun library
|
||||||
// It provides the headers and all the imports
|
// It provides the headers and all the imports
|
||||||
#ifdef _WIN32
|
#if defined(_WIN32) || defined(USE_CLRUN)
|
||||||
#define HAVE_OPENCL 1
|
#define HAVE_OPENCL 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -77,9 +77,9 @@ if(wxWidgets_FOUND)
|
|||||||
add_library(memcard STATIC ${MEMCARDSRCS})
|
add_library(memcard STATIC ${MEMCARDSRCS})
|
||||||
add_executable(${EXEGUI} ${SRCS})
|
add_executable(${EXEGUI} ${SRCS})
|
||||||
target_link_libraries(${EXEGUI} ${LIBS} ${WXLIBS})
|
target_link_libraries(${EXEGUI} ${LIBS} ${WXLIBS})
|
||||||
install(TARGETS ${EXEGUI} RUNTIME DESTINATION ${bindir})
|
install(TARGETS ${EXEGUI} RUNTIME DESTINATION ${DESTDIR}${bindir})
|
||||||
else()
|
else()
|
||||||
add_executable(${EXENOGUI} ${SRCS})
|
add_executable(${EXENOGUI} ${SRCS})
|
||||||
target_link_libraries(${EXENOGUI} ${LIBS})
|
target_link_libraries(${EXENOGUI} ${LIBS})
|
||||||
install(TARGETS ${EXENOGUI} RUNTIME DESTINATION ${bindir})
|
install(TARGETS ${EXENOGUI} RUNTIME DESTINATION ${DESTDIR}${bindir})
|
||||||
endif()
|
endif()
|
||||||
|
@ -23,5 +23,5 @@ endif(wxWidgets_FOUND)
|
|||||||
add_library(Plugin_DSP_HLE SHARED ${SRCS})
|
add_library(Plugin_DSP_HLE SHARED ${SRCS})
|
||||||
target_link_libraries(Plugin_DSP_HLE common audiocommon)
|
target_link_libraries(Plugin_DSP_HLE common audiocommon)
|
||||||
install(TARGETS Plugin_DSP_HLE
|
install(TARGETS Plugin_DSP_HLE
|
||||||
LIBRARY DESTINATION ${plugindir}
|
LIBRARY DESTINATION ${DESTDIR}${plugindir}
|
||||||
RUNTIME DESTINATION ${plugindir})
|
RUNTIME DESTINATION ${DESTDIR}${plugindir})
|
||||||
|
@ -21,6 +21,6 @@ endif(wxWidgets_FOUND)
|
|||||||
add_library(Plugin_DSP_LLE SHARED ${SRCS})
|
add_library(Plugin_DSP_LLE SHARED ${SRCS})
|
||||||
target_link_libraries(Plugin_DSP_LLE ${LIBS})
|
target_link_libraries(Plugin_DSP_LLE ${LIBS})
|
||||||
install(TARGETS Plugin_DSP_LLE
|
install(TARGETS Plugin_DSP_LLE
|
||||||
LIBRARY DESTINATION ${plugindir}
|
LIBRARY DESTINATION ${DESTDIR}${plugindir}
|
||||||
RUNTIME DESTINATION ${plugindir})
|
RUNTIME DESTINATION ${DESTDIR}${plugindir})
|
||||||
|
|
||||||
|
@ -31,11 +31,11 @@ if(APPLE AND NOT wxWidgets_FOUND)
|
|||||||
elseif(WIN32)
|
elseif(WIN32)
|
||||||
set(SRCS ${SRCS} Src/OS/Win32.cpp)
|
set(SRCS ${SRCS} Src/OS/Win32.cpp)
|
||||||
elseif(NOT APPLE)
|
elseif(NOT APPLE)
|
||||||
set(LIBS ${LIBS} OpenCL)
|
set(LIBS ${LIBS} clrun)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_library(Plugin_VideoOGL SHARED ${SRCS})
|
add_library(Plugin_VideoOGL SHARED ${SRCS})
|
||||||
target_link_libraries(Plugin_VideoOGL ${LIBS})
|
target_link_libraries(Plugin_VideoOGL ${LIBS})
|
||||||
install(TARGETS Plugin_VideoOGL
|
install(TARGETS Plugin_VideoOGL
|
||||||
LIBRARY DESTINATION ${plugindir}
|
LIBRARY DESTINATION ${DESTDIR}${plugindir}
|
||||||
RUNTIME DESTINATION ${plugindir})
|
RUNTIME DESTINATION ${DESTDIR}${plugindir})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user