Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,21 @@ INSTALL(FILES
)

IF(FORGE_FOUND AND NOT USE_SYSTEM_FORGE)
INSTALL(DIRECTORY "${PROJECT_BINARY_DIR}/third_party/forge/lib/" DESTINATION "${AF_INSTALL_LIB_DIR}"
COMPONENT libraries
OPTION(INSTALL_FORGE_DEV "Install Forge Header and Share Files with ArrayFire" OFF)
INSTALL(DIRECTORY "${PROJECT_BINARY_DIR}/third_party/forge/lib/"
DESTINATION "${AF_INSTALL_LIB_DIR}"
COMPONENT libraries
)
IF(${INSTALL_FORGE_DEV})
INSTALL(DIRECTORY "${PROJECT_BINARY_DIR}/third_party/forge/include/"
DESTINATION "${AF_INSTALL_INC_DIR}"
COMPONENT headers
)
INSTALL(DIRECTORY "${PROJECT_BINARY_DIR}/third_party/forge/share/Forge/"
DESTINATION "${AF_INSTALL_DATA_DIR}/../Forge"
COMPONENT share
)
ENDIF(${INSTALL_FORGE_DEV})
ENDIF(FORGE_FOUND AND NOT USE_SYSTEM_FORGE)

## configuration to be used from the binary directory directly
Expand Down
1 change: 1 addition & 0 deletions CMakeModules/build_forge.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ ExternalProject_Add(
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
-DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
-DBUILD_EXAMPLES:BOOL=OFF
-DBUILD_DOCUMENTATION:BOOL=${BUILD_DOCS}
-DUSE_SYSTEM_GLBINDING:BOOL=TRUE
-Dglbinding_DIR:STRING=${glbinding_DIR}
-DGLFW_ROOT_DIR:STRING=${GLFW_ROOT_DIR}
Expand Down
121 changes: 113 additions & 8 deletions CMakeModules/osx_install/OSXInstaller.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ SET(OSX_INSTALL_SOURCE ${PROJECT_SOURCE_DIR}/CMakeModules/osx_install)
################################################################################
SET(OSX_TEMP "${PROJECT_BINARY_DIR}/osx_install_files")

# Common files - libforge, ArrayFireConfig*.cmake
FILE(GLOB COMMONLIB "${CMAKE_INSTALL_PREFIX}/${AF_INSTALL_LIB_DIR}/libforge*.dylib")
# Common files - ArrayFireConfig*.cmake
FILE(GLOB COMMONCMAKE "${CMAKE_INSTALL_PREFIX}/${AF_INSTALL_CMAKE_DIR}/ArrayFireConfig*.cmake")

ADD_CUSTOM_TARGET(OSX_INSTALL_SETUP_COMMON)
Expand Down Expand Up @@ -53,7 +52,9 @@ OSX_INSTALL_SETUP(Unified af)
# Headers
ADD_CUSTOM_TARGET(OSX_INSTALL_SETUP_INCLUDE
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_INSTALL_PREFIX}/include "${OSX_TEMP}/include"
${CMAKE_INSTALL_PREFIX}/include/af "${OSX_TEMP}/include/af"
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_INSTALL_PREFIX}/include/arrayfire.h "${OSX_TEMP}/include/arrayfire.h"
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
COMMENT "Copying header files to temporary OSX Install Dir"
)
Expand All @@ -73,6 +74,58 @@ ADD_CUSTOM_TARGET(OSX_INSTALL_SETUP_DOC
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
COMMENT "Copying documentation files to temporary OSX Install Dir"
)

IF(BUILD_GRAPHICS)
MAKE_DIRECTORY("${OSX_TEMP}/Forge")

# Forge Library
FILE(GLOB FORGE_LIB "${CMAKE_INSTALL_PREFIX}/${AF_INSTALL_LIB_DIR}/libforge*.dylib")
ADD_CUSTOM_TARGET(OSX_INSTALL_SETUP_FORGE_LIB)
FOREACH(SRC ${FORGE_LIB})
FILE(RELATIVE_PATH SRC_REL ${CMAKE_INSTALL_PREFIX} ${SRC})
ADD_CUSTOM_COMMAND(TARGET OSX_INSTALL_SETUP_FORGE_LIB PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
${SRC} "${OSX_TEMP}/Forge/${SRC_REL}"
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
COMMENT "Copying libforge files to temporary OSX Install Dir"
)
ENDFOREACH()

# Forge Headers
ADD_CUSTOM_TARGET(OSX_INSTALL_SETUP_FORGE_INCLUDE
COMMAND ${CMAKE_COMMAND} -E copy_directory
"${CMAKE_INSTALL_PREFIX}/include/fg" "${OSX_TEMP}/Forge/include/fg"
COMMAND ${CMAKE_COMMAND} -E copy
"${CMAKE_INSTALL_PREFIX}/include/forge.h" "${OSX_TEMP}/Forge/include/forge.h"
COMMAND ${CMAKE_COMMAND} -E copy
"${CMAKE_INSTALL_PREFIX}/include/ComputeCopy.h" "${OSX_TEMP}/Forge/include/ComputeCopy.h"
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
COMMENT "Copying examples files to temporary OSX Install Dir"
)
# Forge Examples
ADD_CUSTOM_TARGET(OSX_INSTALL_SETUP_FORGE_EXAMPLES
COMMAND ${CMAKE_COMMAND} -E copy_directory
"${CMAKE_INSTALL_PREFIX}/share/Forge/examples" "${OSX_TEMP}/Forge/examples"
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
COMMENT "Copying examples files to temporary OSX Install Dir"
)

# Documentation
ADD_CUSTOM_TARGET(OSX_INSTALL_SETUP_FORGE_DOC
COMMAND ${CMAKE_COMMAND} -E copy_directory
"${CMAKE_INSTALL_PREFIX}/share/Forge/doc" "${OSX_TEMP}/Forge/doc"
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
COMMENT "Copying documentation files to temporary OSX Install Dir"
)

# Forge CMake
ADD_CUSTOM_TARGET(OSX_INSTALL_SETUP_FORGE_CMAKE
COMMAND ${CMAKE_COMMAND} -E copy_directory
"${CMAKE_INSTALL_PREFIX}/share/Forge/cmake" "${OSX_TEMP}/Forge/cmake"
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
COMMENT "Copying documentation files to temporary OSX Install Dir"
)
ENDIF(BUILD_GRAPHICS)
################################################################################

FUNCTION(PKG_BUILD)
Expand Down Expand Up @@ -105,7 +158,12 @@ ENDFUNCTION(PKG_BUILD)

FUNCTION(PRODUCT_BUILD)
CMAKE_PARSE_ARGUMENTS(ARGS "" "" "DEPENDS" ${ARGN})
SET(DISTRIBUTION_FILE "${OSX_INSTALL_SOURCE}/distribution.dist")
IF(BUILD_GRAPHICS)
SET(DISTRIBUTION_FILE "${OSX_INSTALL_SOURCE}/distribution.dist")
ELSE(BUILD_GRAPHICS)
SET(DISTRIBUTION_FILE "${OSX_INSTALL_SOURCE}/distribution-no-gl.dist")
ENDIF(BUILD_GRAPHICS)

SET(DISTRIBUTION_FILE_OUT "${CMAKE_CURRENT_BINARY_DIR}/distribution.dist.out")

SET(WELCOME_FILE "${OSX_INSTALL_SOURCE}/welcome.html")
Expand Down Expand Up @@ -140,7 +198,6 @@ PKG_BUILD( PKG_NAME ArrayFireCPU
DEPENDS OSX_INSTALL_SETUP_CPU
TARGETS cpu_package
INSTALL_LOCATION /usr/local
SCRIPT_DIR ${OSX_INSTALL_SOURCE}/cpu_scripts
IDENTIFIER com.arrayfire.pkg.arrayfire.cpu.lib
PATH_TO_FILES ${OSX_TEMP}/CPU
FILTERS opencl cuda unified)
Expand All @@ -149,7 +206,6 @@ PKG_BUILD( PKG_NAME ArrayFireCUDA
DEPENDS OSX_INSTALL_SETUP_CUDA
TARGETS cuda_package
INSTALL_LOCATION /usr/local
SCRIPT_DIR ${OSX_INSTALL_SOURCE}/cuda_scripts
IDENTIFIER com.arrayfire.pkg.arrayfire.cuda.lib
PATH_TO_FILES ${OSX_TEMP}/CUDA
FILTERS cpu opencl unified)
Expand All @@ -158,7 +214,6 @@ PKG_BUILD( PKG_NAME ArrayFireOPENCL
DEPENDS OSX_INSTALL_SETUP_OpenCL
TARGETS opencl_package
INSTALL_LOCATION /usr/local
SCRIPT_DIR ${OSX_INSTALL_SOURCE}/opencl_scripts
IDENTIFIER com.arrayfire.pkg.arrayfire.opencl.lib
PATH_TO_FILES ${OSX_TEMP}/OpenCL
FILTERS cpu cuda unified)
Expand Down Expand Up @@ -202,5 +257,55 @@ PKG_BUILD( PKG_NAME ArrayFireDoc
PATH_TO_FILES ${OSX_TEMP}/doc
FILTERS cmake)

PRODUCT_BUILD(DEPENDS ${cpu_package} ${cuda_package} ${opencl_package} ${unified_package} ${common_package} ${header_package} ${examples_package} ${doc_package})
IF(BUILD_GRAPHICS)
PKG_BUILD( PKG_NAME ForgeLibrary
DEPENDS OSX_INSTALL_SETUP_FORGE_LIB
TARGETS forge_lib_package
INSTALL_LOCATION /usr/local/
SCRIPT_DIR ${OSX_INSTALL_SOURCE}/forge_scripts
IDENTIFIER com.arrayfire.pkg.forge.lib
PATH_TO_FILES ${OSX_TEMP}/Forge)

PKG_BUILD( PKG_NAME ForgeHeaders
DEPENDS OSX_INSTALL_SETUP_FORGE_INCLUDE
TARGETS forge_header_package
INSTALL_LOCATION /usr/local/include
IDENTIFIER com.arrayfire.pkg.forge.inc
PATH_TO_FILES ${OSX_TEMP}/Forge/include)

PKG_BUILD( PKG_NAME ForgeExamples
DEPENDS OSX_INSTALL_SETUP_FORGE_EXAMPLES
TARGETS forge_examples_package
INSTALL_LOCATION /usr/local/share/Forge/examples
IDENTIFIER com.arrayfire.pkg.forge.examples
PATH_TO_FILES ${OSX_TEMP}/Forge/examples
)

PKG_BUILD( PKG_NAME ForgeDoc
DEPENDS OSX_INSTALL_SETUP_FORGE_DOC
TARGETS forge_doc_package
INSTALL_LOCATION /usr/local/share/Forge/doc
IDENTIFIER com.arrayfire.pkg.forge.doc
PATH_TO_FILES ${OSX_TEMP}/Forge/doc
)

PKG_BUILD( PKG_NAME ForgeCMake
DEPENDS OSX_INSTALL_SETUP_FORGE_CMAKE
TARGETS forge_cmake_package
INSTALL_LOCATION /usr/local/share/Forge/cmake
IDENTIFIER com.arrayfire.pkg.forge.cmake
PATH_TO_FILES ${OSX_TEMP}/Forge/cmake
)
ENDIF(BUILD_GRAPHICS)

IF(BUILD_GRAPHICS)
PRODUCT_BUILD(DEPENDS ${cpu_package} ${cuda_package} ${opencl_package} ${unified_package}
${common_package} ${header_package} ${examples_package} ${doc_package}
${forge_lib_package} ${forge_header_package} ${forge_examples_package} ${forge_doc_package} ${forge_cmake_package}
)
ELSE(BUILD_GRAPHICS)
PRODUCT_BUILD(DEPENDS ${cpu_package} ${cuda_package} ${opencl_package} ${unified_package}
${common_package} ${header_package} ${examples_package} ${doc_package}
)
ENDIF(BUILD_GRAPHICS)

35 changes: 0 additions & 35 deletions CMakeModules/osx_install/cpu_scripts/postinstall

This file was deleted.

78 changes: 78 additions & 0 deletions CMakeModules/osx_install/distribution-no-gl.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<installer-gui-script minSpecVersion="1">
<title>${AF_TITLE}</title>
<welcome file="${WELCOME_FILE_OUT}" />
<readme file="${README_FILE_OUT}" mime-type="test/html" />
<license file="${PROJECT_SOURCE_DIR}/LICENSE" mime-type="test/plain" />
<script>
function CheckBackendSelected() {
return choices.opencl_lib.selected ||
choices.cuda_lib.selected ||
choices.cpu_lib.selected;
}
</script>

<pkg-ref id="com.arrayfire.arrayfire.cpu.lib" version="${AF_VERSION}" onConclusion="none">ArrayFireCPU.pkg</pkg-ref>
<pkg-ref id="com.arrayfire.arrayfire.cuda.lib" version="${AF_VERSION}" onConclusion="none">ArrayFireCUDA.pkg</pkg-ref>
<pkg-ref id="com.arrayfire.arrayfire.opencl.lib" version="${AF_VERSION}" onConclusion="none">ArrayFireOPENCL.pkg</pkg-ref>
<pkg-ref id="com.arrayfire.arrayfire.unified.lib" version="${AF_VERSION}" onConclusion="none">ArrayFireUNIFIED.pkg</pkg-ref>
<pkg-ref id="com.arrayfire.arrayfire.inc" version="${AF_VERSION}" onConclusion="none">ArrayFireHeaders.pkg</pkg-ref>
<pkg-ref id="com.arrayfire.arrayfire.examples" version="${AF_VERSION}" onConclusion="none">ArrayFireExamples.pkg</pkg-ref>
<pkg-ref id="com.arrayfire.arrayfire.doc" version="${AF_VERSION}" onConclusion="none">ArrayFireDoc.pkg</pkg-ref>
<pkg-ref id="com.arrayfire.arrayfire.libcommon" version="${AF_VERSION}" onConclusion="none">ArrayFireCommon.pkg</pkg-ref>
<options customize="always" require-scripts="false"/>
<choices-outline>
<line choice="libs">
<line choice="cpu_lib"/>
<line choice="cuda_lib"/>
<line choice="opencl_lib"/>
<line choice="com.arrayfire.arrayfire.unified.lib"/>
<line choice="com.arrayfire.arrayfire.libcommon"/>
</line>
<line choice="com.arrayfire.arrayfire.inc"/>
<line choice="com.arrayfire.arrayfire.examples"/>
<line choice="com.arrayfire.arrayfire.doc"/>
</choices-outline>
<choice id="libs" title="ArrayFire Libraries" visible="true" />
<choice title="CPU Libraries"
description="ArrayFire targeting CPUs. Also installs the corresponding CMake config files."
id="cpu_lib" visible="true" enabled="true">
<pkg-ref id="com.arrayfire.arrayfire.cpu.lib"/>
</choice>
<choice title="CUDA Libraries"
description="ArrayFire which targets the CUDA platform. This platform allows you to to take advantage of the CUDA enabled GPUs to run ArrayFire code. Also installs the corresponding CMake config files."
id="cuda_lib" visible="true" enabled="true">
<pkg-ref id="com.arrayfire.arrayfire.cuda.lib"/>
</choice>
<choice title="OpenCL Libraries"
description="ArrayFire which targets the OpenCL platform. This platform allows you to use the ArrayFire library which targets OpenCL devices. Also installs the corresponding CMake config files. NOTE: Currently ArrayFire does not support OpenCL for the Intel CPU on Apple."
id="opencl_lib" visible="true" enabled="true">
<pkg-ref id="com.arrayfire.arrayfire.opencl.lib"/>
</choice>
<choice title="Unified Library"
description="This library will allow you to choose the platform(cpu, cuda, opencl) at runtime. Also installs the corresponding CMake config files. NOTE: This option requires the other platforms to work properly"
id="com.arrayfire.arrayfire.unified.lib"
selected="CheckBackendSelected()"
visible="true"
enabled="CheckBackendSelected()">
<pkg-ref id="com.arrayfire.arrayfire.unified.lib"/>
</choice>
<choice title="Library Common"
description="Installs ArrayFireConfig.cmake files"
id="com.arrayfire.arrayfire.libcommon"
selected="CheckBackendSelected()"
visible="false"
enabled="CheckBackendSelected()">
<pkg-ref id="com.arrayfire.arrayfire.libcommon"/>
</choice>
<choice title="ArrayFire Headers" description="ArrayFire Headers" id="com.arrayfire.arrayfire.inc" visible="true" enabled="true">
<pkg-ref id="com.arrayfire.arrayfire.inc"/>
</choice>
<choice title="Examples" description="ArrayFire Examples" id="com.arrayfire.arrayfire.examples" visible="true" enabled="true">
<pkg-ref id="com.arrayfire.arrayfire.examples"/>
</choice>
<choice title="Documentation" description="ArrayFire Documentation" id="com.arrayfire.arrayfire.doc" visible="true" enabled="true">
<pkg-ref id="com.arrayfire.arrayfire.doc"/>
</choice>

</installer-gui-script>
Loading