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:
Glenn Rice 2010-11-10 01:59:53 +00:00
parent 7dd7bd2b03
commit 7b34def0fc
8 changed files with 23 additions and 26 deletions

View file

@ -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

View file

@ -4,3 +4,6 @@ set(SRCS clrun/clrun.c
clrun/genclgl.c)
add_library(clrun STATIC ${SRCS})
if(UNIX)
add_definitions(-fPIC)
endif(UNIX)

View file

@ -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;

View file

@ -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

View file

@ -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()

View file

@ -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})

View file

@ -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})

View file

@ -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})