Welcome to mirror list, hosted at ThFree Co, Russian Federation.

openpgl.cmake « cmake « build_environment « build_files - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e6b0cd8eb4a2aca7b453adc8e8cf1e7e4bb12ee4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# SPDX-License-Identifier: GPL-2.0-or-later

# Note the utility apps may use png/tiff/gif system libraries, but the
# library itself does not depend on them, so should give no problems.

set(OPENPGL_EXTRA_ARGS
    -DOPENPGL_BUILD_PYTHON=OFF
    -DOPENPGL_BUILD_STATIC=ON
    -DOPENPGL_TBB_ROOT=${LIBDIR}/tbb
    -DTBB_ROOT=${LIBDIR}/tbb
    -Dembree_DIR=${LIBDIR}/embree/lib/cmake/embree-${EMBREE_VERSION}
    -DCMAKE_DEBUG_POSTFIX=_d
)

if(TBB_STATIC_LIBRARY)
  set(OPENPGL_EXTRA_ARGS
    ${OPENPGL_EXTRA_ARGS}
    -DOPENPGL_TBB_COMPONENT=tbb_static
  )
endif()

ExternalProject_Add(external_openpgl
    URL file://${PACKAGE_DIR}/${OPENPGL_FILE}
    DOWNLOAD_DIR ${DOWNLOAD_DIR}
    URL_HASH ${OPENPGL_HASH_TYPE}=${OPENPGL_HASH}
    PREFIX ${BUILD_DIR}/openpgl
    CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openpgl ${DEFAULT_CMAKE_FLAGS} ${OPENPGL_EXTRA_ARGS}
    INSTALL_DIR ${LIBDIR}/openpgl
)

add_dependencies(
    external_openpgl
    external_tbb
    external_embree
)

if(WIN32)
  if(BUILD_MODE STREQUAL Release)
    ExternalProject_Add_Step(external_openpgl after_install
      COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/openpgl ${HARVEST_TARGET}/openpgl
      DEPENDEES install
    )
  else()
  ExternalProject_Add_Step(external_openpgl after_install
      COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openpgl/lib/openpgl_d.lib ${HARVEST_TARGET}/openpgl/lib/openpgl_d.lib
      DEPENDEES install
    )
  endif()
endif()