Add license text for OCIO configuration
[blender.git] / source / creator / CMakeLists.txt
1 # ***** BEGIN GPL LICENSE BLOCK *****
2 #
3 # This program is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU General Public License
5 # as published by the Free Software Foundation; either version 2
6 # of the License, or (at your option) any later version.
7 #
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 # GNU General Public License for more details.
12 #
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software Foundation,
15 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 #
17 # The Original Code is Copyright (C) 2006, Blender Foundation
18 # All rights reserved.
19 #
20 # The Original Code is: all of this file.
21 #
22 # Contributor(s): Jacques Beaurain.
23 #
24 # ***** END GPL LICENSE BLOCK *****
25
26 setup_libdirs()
27
28 blender_include_dirs(
29         ../../intern/guardedalloc
30         ../../intern/glew-mx
31         ../blender/blenlib
32         ../blender/blenkernel
33         ../blender/blenloader
34         ../blender/depsgraph
35         ../blender/editors/include
36         ../blender/makesrna
37         ../blender/imbuf
38         ../blender/render/extern/include
39         ../blender/makesdna
40         ../blender/gpu
41         ../blender/windowmanager
42 )
43
44 add_definitions(${GL_DEFINITIONS})
45 blender_include_dirs("${GLEW_INCLUDE_PATH}")
46
47 if(WIN32)
48         blender_include_dirs(../../intern/utfconv)
49 endif()
50
51 if(WITH_LIBMV)
52         blender_include_dirs(../../intern/libmv)
53         add_definitions(-DWITH_LIBMV)
54 endif()
55
56 if(WITH_CYCLES AND WITH_CYCLES_LOGGING)
57         blender_include_dirs(../../intern/cycles/blender)
58         add_definitions(-DWITH_CYCLES_LOGGING)
59 endif()
60
61 if(WITH_CODEC_FFMPEG)
62         add_definitions(-DWITH_FFMPEG)
63 endif()
64
65 if(WITH_PYTHON)
66         blender_include_dirs(../blender/python)
67         add_definitions(-DWITH_PYTHON)
68
69         if(WITH_PYTHON_SECURITY)
70                 add_definitions(-DWITH_PYTHON_SECURITY)
71         endif()
72 endif()
73
74 if(WITH_HEADLESS)
75         add_definitions(-DWITH_HEADLESS)
76 endif()
77
78 if(WITH_GAMEENGINE)
79         blender_include_dirs(../gameengine/BlenderRoutines)
80
81         add_definitions(-DWITH_GAMEENGINE)
82 endif()
83
84 if(WITH_SDL)
85         if(WITH_SDL_DYNLOAD)
86                 add_definitions(-DWITH_SDL_DYNLOAD)
87                 blender_include_dirs(../../extern/sdlew/include)
88         endif()
89         add_definitions(-DWITH_SDL)
90 endif()
91
92 if(WITH_BINRELOC)
93         add_definitions(-DWITH_BINRELOC)
94         blender_include_dirs(${BINRELOC_INCLUDE_DIRS})
95 endif()
96
97 if(WITH_FREESTYLE)
98         add_definitions(-DWITH_FREESTYLE)
99         blender_include_dirs(../blender/freestyle)
100 endif()
101
102 # Setup the exe sources and buildinfo
103 set(SRC
104         creator.c
105         creator_args.c
106         creator_signals.c
107
108         creator_intern.h
109 )
110
111 # MSVC 2010 gives linking errors with the manifest
112 if(WIN32 AND NOT UNIX)
113         string(SUBSTRING ${BLENDER_VERSION} 0 1 bver1)
114         string(SUBSTRING ${BLENDER_VERSION} 2 1 bver2)
115         string(SUBSTRING ${BLENDER_VERSION} 3 1 bver3)
116         if(MINGW)
117                 add_definitions(
118                         -DWINDRES
119                         -DBLEN_VER_RC_STR_M=${BLENDER_VERSION}
120                         -DBLEN_VER_RC_1=${bver1}
121                         -DBLEN_VER_RC_2=${bver2}
122                         -DBLEN_VER_RC_3=${bver3}
123                         -DBLEN_VER_RC_4=0
124                 )
125         else()
126                 add_definitions(
127                         -DBLEN_VER_RC_STR=${BLENDER_VERSION}
128                         -DBLEN_VER_RC_1=${bver1}
129                         -DBLEN_VER_RC_2=${bver2}
130                         -DBLEN_VER_RC_3=${bver3}
131                         -DBLEN_VER_RC_4=0
132                 )
133         endif()
134
135
136         list(APPEND SRC
137                 ${CMAKE_SOURCE_DIR}/release/windows/icons/winblender.rc
138         )
139 endif()
140
141 if(WITH_BUILDINFO)
142         add_definitions(-DWITH_BUILDINFO)
143         # --------------------------------------------------------------------------
144         # These defines could all be moved into the header below
145         string(REPLACE " " "\ " BUILDINFO_CFLAGS "${CMAKE_C_FLAGS}")
146         string(REPLACE " " "\ " BUILDINFO_CXXFLAGS "${CMAKE_CXX_FLAGS}")
147         string(REPLACE " " "\ " BUILDINFO_LINKFLAGS "${PLATFORM_LINKFLAGS}")
148         add_definitions(
149                 # # define in header now, else these get out of date on rebuilds.
150                 # -DBUILD_DATE="${BUILD_DATE}"
151                 # -DBUILD_TIME="${BUILD_TIME}"
152                 # -DBUILD_COMMIT_TIMESTAMP="${BUILD_COMMIT_TIMESTAMP}"
153                 # -DBUILD_COMMIT_TIME="${BUILD_COMMIT_TIME}"
154                 # -DBUILD_COMMIT_DATE="${BUILD_COMMIT_DATE}"
155                 # -DBUILD_HASH="${BUILD_HASH}"
156                 # -DBUILD_BRANCH="${BUILD_BRANCH}"
157                 -DWITH_BUILDINFO_HEADER # alternative to lines above
158                 -DBUILD_PLATFORM="${CMAKE_SYSTEM_NAME}"
159                 -DBUILD_TYPE="${CMAKE_BUILD_TYPE}"
160                 -DBUILD_CFLAGS="${BUILDINFO_CFLAGS}"
161                 -DBUILD_CXXFLAGS="${BUILDINFO_CXXFLAGS}"
162                 -DBUILD_LINKFLAGS="${BUILDINFO_LINKFLAGS}"
163                 -DBUILD_SYSTEM="CMake"
164         )
165
166         # --------------------------------------------------------------------------
167         # write header for values that change each build
168         # note, generaed file is in build dir's source/creator
169         #       except when used as an include path.
170
171         # include the output directory, where the buildinfo.h file is generated
172         include_directories(${CMAKE_CURRENT_BINARY_DIR})
173
174
175         # XXX, "_buildinfo.h" is used twice here,
176         # because we rely on that file being detected as missing
177         # every build so that the real header "buildinfo.h" is updated.
178         #
179         # Keep this until we find a better way to resolve!
180
181         # a custom target that is always built
182         add_custom_target(buildinfo ALL
183                 DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/_buildinfo.h)
184
185         # creates buildinfo.h using cmake script
186         add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/_buildinfo.h
187                 COMMAND ${CMAKE_COMMAND}
188                 -DSOURCE_DIR=${CMAKE_SOURCE_DIR}
189                 -P ${CMAKE_SOURCE_DIR}/build_files/cmake/buildinfo.cmake)
190
191         # buildinfo.h is a generated file
192         set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/buildinfo.h
193                 PROPERTIES GENERATED TRUE
194                 HEADER_FILE_ONLY TRUE)
195
196         # add deps below, after adding blender
197         # -------------- done with header values.
198
199         list(APPEND SRC
200                 buildinfo.c
201         )
202
203         # make an object library so can load with it in tests
204         add_library(buildinfoobj OBJECT buildinfo.c)
205         add_dependencies(buildinfoobj buildinfo)
206 endif()
207
208 # message(STATUS "Configuring blender")
209 if(WITH_PYTHON_MODULE)
210         add_definitions(-DWITH_PYTHON_MODULE)
211
212         # creates ./bin/bpy.so which can be imported as a python module.
213         #
214         # note that 'SHARED' works on Linux and Windows,
215         # but not OSX which _must_ be 'MODULE'
216         add_library(blender MODULE ${SRC})
217         set_target_properties(
218                 blender
219                 PROPERTIES
220                         PREFIX ""
221                         OUTPUT_NAME bpy
222                         LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
223                         RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin  # only needed on windows
224         )
225
226         if(APPLE)
227                 set_target_properties(
228                         blender
229                         PROPERTIES
230                                 MACOSX_BUNDLE
231                                 LINK_FLAGS_RELEASE "${PLATFORM_LINKFLAGS}"
232                                 LINK_FLAGS_DEBUG "${PLATFORM_LINKFLAGS_DEBUG}"
233                 )
234         endif()
235
236         if(WIN32)
237                 # python modules use this
238                 set_target_properties(
239                         blender
240                         PROPERTIES
241                         SUFFIX ".pyd"
242                 )
243         endif()
244
245 else()
246         add_executable(blender ${EXETYPE} ${SRC})
247 endif()
248
249 if(WITH_BUILDINFO)
250         # explicitly say that the executable depends on the buildinfo
251         add_dependencies(blender buildinfo)
252 endif()
253
254
255 set(BLENDER_TEXT_FILES
256         ${CMAKE_SOURCE_DIR}/release/text/GPL-license.txt
257         ${CMAKE_SOURCE_DIR}/release/text/GPL3-license.txt
258         ${CMAKE_SOURCE_DIR}/release/text/Python-license.txt
259         ${CMAKE_SOURCE_DIR}/release/text/copyright.txt
260         ${CMAKE_SOURCE_DIR}/release/text/jemalloc-license.txt
261         ${CMAKE_SOURCE_DIR}/release/text/ocio-license.txt
262         # generate this file
263         # ${CMAKE_SOURCE_DIR}/release/text/readme.html
264         ${CMAKE_SOURCE_DIR}/release/datafiles/LICENSE-bfont.ttf.txt
265 )
266
267 if(WITH_INTERNATIONAL)
268         list(APPEND BLENDER_TEXT_FILES
269                 ${CMAKE_SOURCE_DIR}/release/datafiles/LICENSE-droidsans.ttf.txt
270                 ${CMAKE_SOURCE_DIR}/release/datafiles/LICENSE-bmonofont-i18n.ttf.txt
271         )
272 endif()
273
274
275 # -----------------------------------------------------------------------------
276 # Platform Specific Var: TARGETDIR_VER
277
278 if(UNIX AND NOT APPLE)
279         if(WITH_PYTHON_MODULE)
280                 if(WITH_INSTALL_PORTABLE)
281                         set(TARGETDIR_VER ${BLENDER_VERSION})
282                 else()
283                         set(TARGETDIR_VER ${PYTHON_SITE_PACKAGES}/${BLENDER_VERSION})
284                 endif()
285         else()
286                 if(WITH_INSTALL_PORTABLE)
287                         set(TARGETDIR_VER ${BLENDER_VERSION})
288                 else()
289                         set(TARGETDIR_VER share/blender/${BLENDER_VERSION})
290                 endif()
291         endif()
292
293 elseif(WIN32)
294         set(TARGETDIR_VER ${BLENDER_VERSION})
295
296 elseif(APPLE)
297         if(WITH_PYTHON_MODULE)
298                 set(TARGETDIR_VER ${BLENDER_VERSION})
299         else()
300                 set(TARGETDIR_VER blender.app/Contents/Resources/${BLENDER_VERSION})
301         endif()
302         # Skip relinking on cpack / install
303         set_target_properties(blender PROPERTIES BUILD_WITH_INSTALL_RPATH true)
304 endif()
305
306
307 # -----------------------------------------------------------------------------
308 # Install Targets (Generic, All Platforms)
309
310
311 # important to make a clean  install each time, else old scripts get loaded.
312 install(
313         CODE
314         "file(REMOVE_RECURSE ${TARGETDIR_VER})"
315 )
316
317 if(WITH_PYTHON)
318         # install(CODE "message(\"copying blender scripts...\")")
319         
320         # exclude addons_contrib if release
321         if("${BLENDER_VERSION_CYCLE}" STREQUAL "release")
322                 set(ADDON_EXCLUDE_CONDITIONAL "addons_contrib/*")
323         else()
324                 set(ADDON_EXCLUDE_CONDITIONAL "_addons_contrib/*")  # dummy, wont do anything
325         endif()
326
327         # do not install freestyle dir if disabled
328         if(NOT WITH_FREESTYLE)
329                 set(FREESTYLE_EXCLUDE_CONDITIONAL "freestyle/*")
330         else()
331                 set(FREESTYLE_EXCLUDE_CONDITIONAL "_freestyle/*")  # dummy, wont do anything
332         endif()
333
334         install(
335                 DIRECTORY ${CMAKE_SOURCE_DIR}/release/scripts
336                 DESTINATION ${TARGETDIR_VER}
337                 PATTERN ".git" EXCLUDE
338                 PATTERN "__pycache__" EXCLUDE
339                 PATTERN "${ADDON_EXCLUDE_CONDITIONAL}" EXCLUDE
340                 PATTERN "${FREESTYLE_EXCLUDE_CONDITIONAL}" EXCLUDE
341         )
342         
343         unset(ADDON_EXCLUDE_CONDITIONAL)
344         unset(FREESTYLE_EXCLUDE_CONDITIONAL)
345 endif()
346
347 # localization
348 if(WITH_INTERNATIONAL)
349         install(
350                 DIRECTORY
351                         ${CMAKE_SOURCE_DIR}/release/datafiles/fonts
352                 DESTINATION ${TARGETDIR_VER}/datafiles
353         )
354
355         set(_locale_dir "${CMAKE_SOURCE_DIR}/release/datafiles/locale")
356         set(_locale_target_dir ${TARGETDIR_VER}/datafiles/locale)
357
358         file(GLOB _po_files "${_locale_dir}/po/*.po")
359         foreach(_po_file ${_po_files})
360                 msgfmt_simple(${_po_file} _all_mo_files)
361         endforeach()
362
363         # Create a custom target which will compile all po to mo
364         add_custom_target(
365                 locales
366                 DEPENDS ${_all_mo_files})
367
368         add_dependencies(blender locales)
369
370         # Generate INSTALL rules
371         install(
372                 FILES ${_locale_dir}/languages
373                 DESTINATION ${_locale_target_dir}
374         )
375
376         foreach(_mo_file ${_all_mo_files})
377                 get_filename_component(_locale_name ${_mo_file} NAME_WE)
378                 install(
379                         FILES ${_mo_file}
380                         DESTINATION ${_locale_target_dir}/${_locale_name}/LC_MESSAGES
381                         RENAME blender.mo
382                 )
383                 unset(_locale_name)
384         endforeach()
385
386         unset(_all_mo_files)
387         unset(_po_files)
388         unset(_po_file)
389         unset(_mo_file)
390         unset(_locale_target_dir)
391
392         unset(_locale_dir)
393 endif()
394
395 # color management
396 if(WITH_OPENCOLORIO)
397         install(
398                 DIRECTORY ${CMAKE_SOURCE_DIR}/release/datafiles/colormanagement
399                 DESTINATION ${TARGETDIR_VER}/datafiles
400         )
401 endif()
402
403 # helpful tip when using make
404 if("${CMAKE_GENERATOR}" MATCHES ".*Makefiles.*")
405         # message after building.
406         add_custom_command(
407                 TARGET blender POST_BUILD MAIN_DEPENDENCY blender
408                 COMMAND ${CMAKE_COMMAND} -E echo 'now run: \"make install\" to copy runtime files and scripts to ${TARGETDIR_VER}'
409         )
410 endif()
411
412
413 # -----------------------------------------------------------------------------
414 # Install Targets (Platform Specific)
415
416 if(UNIX AND NOT APPLE)
417
418         if(NOT WITH_PYTHON_MODULE)
419                 if(WITH_DOC_MANPAGE)
420                         add_custom_target(
421                                 blender_man_page ALL
422                                 COMMAND ${CMAKE_SOURCE_DIR}/doc/manpage/blender.1.py
423                                         ${EXECUTABLE_OUTPUT_PATH}/blender
424                                         ${CMAKE_CURRENT_BINARY_DIR}/blender.1)
425                         add_dependencies(blender_man_page blender)
426                 endif()
427         endif()
428
429         # there are a few differences between portable and system install
430         if(WITH_PYTHON_MODULE)
431                 if(WITH_INSTALL_PORTABLE)
432                         install(
433                                 TARGETS blender
434                                 DESTINATION "."
435                         )
436                 else()
437                         install(
438                                 TARGETS blender
439                                 LIBRARY DESTINATION ${PYTHON_SITE_PACKAGES}
440                         )
441                 endif()
442                 # none of the other files are needed currently
443         elseif(WITH_INSTALL_PORTABLE)
444                 install(
445                         TARGETS blender
446                         DESTINATION "."
447                 )
448
449                 if(WITH_DOC_MANPAGE)
450                         install(
451                                 FILES ${CMAKE_CURRENT_BINARY_DIR}/blender.1
452                                 DESTINATION "."
453                         )
454                 endif()
455                 install(
456                         FILES
457                                 ${CMAKE_SOURCE_DIR}/release/freedesktop/blender.desktop
458                                 ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/scalable/apps/blender.svg
459                         DESTINATION "."
460                 )
461
462                 install(
463                         PROGRAMS
464                         ${CMAKE_SOURCE_DIR}/release/bin/blender-thumbnailer.py
465                         DESTINATION "."
466                 )
467
468                 set(BLENDER_TEXT_FILES_DESTINATION ".")
469         else()
470                 # main blender binary
471                 install(
472                         TARGETS blender
473                         DESTINATION bin
474                 )
475                 if(WITH_DOC_MANPAGE)
476                         # manpage only with 'blender' binary
477                         install(
478                                 FILES ${CMAKE_CURRENT_BINARY_DIR}/blender.1
479                                 DESTINATION share/man/man1
480                         )
481                 endif()
482
483                 # misc files
484                 install(
485                         FILES ${CMAKE_SOURCE_DIR}/release/freedesktop/blender.desktop
486                         DESTINATION share/applications
487                 )
488                 install(
489                         DIRECTORY
490                                 ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/16x16
491                                 ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/22x22
492                                 ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/24x24
493                                 ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/32x32
494                                 ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/48x48
495                                 ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/256x256
496                         DESTINATION share/icons/hicolor
497                         PATTERN "*.svg" EXCLUDE
498                 )
499                 install(
500                         FILES ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/scalable/apps/blender.svg
501                         DESTINATION share/icons/hicolor/scalable/apps
502                 )
503                 install(
504                         PROGRAMS ${CMAKE_SOURCE_DIR}/release/bin/blender-thumbnailer.py
505                         DESTINATION bin
506                 )
507                 set(BLENDER_TEXT_FILES_DESTINATION share/doc/blender)
508         endif()
509
510         if(WITH_PYTHON)
511                 if(WITH_PYTHON_INSTALL)
512
513                         install(
514                                 PROGRAMS ${PYTHON_EXECUTABLE}
515                                 DESTINATION ${TARGETDIR_VER}/python/bin
516                         )
517
518                         # on some platforms (like openSUSE) Python is linked
519                         # to be used from lib64 folder.
520                         # determine this from Python's libraries path
521                         #
522                         # ugh, its possible 'lib64' is just a symlink to 'lib' which causes incorrect use of 'lib64'
523                         get_filename_component(_pypath_real ${PYTHON_LIBPATH} REALPATH)
524                         if(${_pypath_real} MATCHES "lib64$")
525                                 set(_target_LIB "lib64")
526                         else()
527                                 set(_target_LIB "lib")
528                         endif()
529                         unset(_pypath_real)
530
531                         # Copy the systems python into the install directory
532                         # install(CODE "message(\"copying a subset of the systems python...\")")
533                         install(
534                                 DIRECTORY ${PYTHON_LIBPATH}/python${PYTHON_VERSION}
535                                 DESTINATION ${TARGETDIR_VER}/python/${_target_LIB}
536                                 PATTERN "__pycache__" EXCLUDE               # * any cache *
537                                 PATTERN "lib2to3" EXCLUDE                   # ./lib2to3
538                                 PATTERN "site-packages/*" EXCLUDE           # ./site-packages/*
539                                 PATTERN "tkinter" EXCLUDE                   # ./tkinter
540                                 PATTERN "lib-dynload/_tkinter.*" EXCLUDE    # ./lib-dynload/_tkinter.co
541                                 PATTERN "idlelib" EXCLUDE                   # ./idlelib
542                                 PATTERN "test" EXCLUDE                      # ./test
543                                 PATTERN "turtledemo" EXCLUDE                # ./turtledemo
544                                 PATTERN "turtle.py" EXCLUDE                 # ./turtle.py
545                         )
546
547                         # Needed for distutils/pip
548                         # get the last part of the include dir, will be 'python{version}{abiflag}',
549                         get_filename_component(_py_inc_suffix ${PYTHON_INCLUDE_DIR} NAME)
550                         install(
551                                 FILES ${PYTHON_INCLUDE_DIR}/pyconfig.h
552                                 DESTINATION ${TARGETDIR_VER}/python/include/${_py_inc_suffix}
553                         )
554                         unset(_py_inc_suffix)
555
556                         # # doesnt work, todo
557                         # install(CODE "execute_process(COMMAND find ${CMAKE_INSTALL_PREFIX}/${BLENDER_VERSION}/python/lib/ -name '*.so' -exec strip -s {} '\;')")
558
559                         if(WITH_PYTHON_INSTALL_NUMPY)
560                                 # Install to the same directory as the source, so debian-like
561                                 # distros are happy with their policy.
562                                 set(_suffix "site-packages")
563                                 if(${PYTHON_NUMPY_PATH} MATCHES "dist-packages")
564                                         set(_suffix "dist-packages")
565                                 endif()
566                                 install(
567                                         DIRECTORY ${PYTHON_NUMPY_PATH}/numpy
568                                         DESTINATION ${TARGETDIR_VER}/python/${_target_LIB}/python${PYTHON_VERSION}/${_suffix}
569                                         PATTERN ".svn" EXCLUDE
570                                         PATTERN "__pycache__" EXCLUDE           # * any cache *
571                                         PATTERN "*.pyc" EXCLUDE                 # * any cache *
572                                         PATTERN "*.pyo" EXCLUDE                 # * any cache *
573                                         PATTERN "oldnumeric" EXCLUDE            # ./oldnumeric
574                                         PATTERN "doc" EXCLUDE                   # ./doc
575                                         PATTERN "tests" EXCLUDE                 # ./tests
576                                         PATTERN "f2py" EXCLUDE                  # ./f2py - fortran/python interface code, not fun for blender devs.
577                                         PATTERN "include" EXCLUDE               # include dirs all over, we wont use NumPy/CAPI
578                                         PATTERN "*.h" EXCLUDE                   # some includes are not in include dirs
579                                         PATTERN "*.a" EXCLUDE                   # ./core/lib/libnpymath.a - for linking, we dont need.
580                                 )
581                                 unset(_suffix)
582                         endif()
583
584                         # Copy requests, we need to generalize site-packages
585                         if(WITH_PYTHON_INSTALL_REQUESTS)
586                                 set(_suffix "site-packages")
587                                 if(${PYTHON_REQUESTS_PATH} MATCHES "dist-packages")
588                                         set(_suffix "dist-packages")
589                                 endif()
590                                 install(
591                                         DIRECTORY ${PYTHON_REQUESTS_PATH}/requests
592                                         DESTINATION ${TARGETDIR_VER}/python/${_target_LIB}/python${PYTHON_VERSION}/${_suffix}
593                                         PATTERN ".svn" EXCLUDE
594                                         PATTERN "__pycache__" EXCLUDE           # * any cache *
595                                         PATTERN "*.pyc" EXCLUDE                 # * any cache *
596                                         PATTERN "*.pyo" EXCLUDE                 # * any cache *
597                                 )
598                                 # On some platforms requests does have extra dependencies.
599                                 set(_requests_deps "chardet" "urllib3")
600                                 foreach(_requests_dep ${_requests_deps})
601                                         if(EXISTS ${PYTHON_REQUESTS_PATH}/${_requests_dep})
602                                                 install(
603                                                         DIRECTORY ${PYTHON_REQUESTS_PATH}/${_requests_dep}
604                                                         DESTINATION ${TARGETDIR_VER}/python/${_target_LIB}/python${PYTHON_VERSION}/${_suffix}
605                                                         PATTERN ".svn" EXCLUDE
606                                                         PATTERN "__pycache__" EXCLUDE           # * any cache *
607                                                         PATTERN "*.pyc" EXCLUDE                 # * any cache *
608                                                         PATTERN "*.pyo" EXCLUDE                 # * any cache *
609                                                 )
610                                         endif()
611                                 endforeach()
612                                 if(EXISTS ${PYTHON_REQUESTS_PATH}/six.py)
613                                         install(
614                                                 FILES ${PYTHON_REQUESTS_PATH}/six.py
615                                                 DESTINATION ${TARGETDIR_VER}/python/${_target_LIB}/python${PYTHON_VERSION}/${_suffix}
616                                         )
617                                         endif()
618                                 unset(_requests_dep)
619                                 unset(_requests_deps)
620                                 unset(_suffix)
621                         endif()
622                         unset(_target_LIB)
623                         
624                 endif()
625         endif()
626 elseif(WIN32)
627
628         set(BLENDER_TEXT_FILES_DESTINATION ".")
629
630         if(WITH_PYTHON)
631                 string(REPLACE "." "" _PYTHON_VERSION_NO_DOTS ${PYTHON_VERSION})
632
633                 # MinGW TODO: This bit of Python configuration diverges from MSVC
634                 if(NOT CMAKE_COMPILER_IS_GNUCC)
635                         install(
636                                 FILES ${LIBDIR}/python/lib/python${_PYTHON_VERSION_NO_DOTS}.dll
637                                 DESTINATION "."
638                                 CONFIGURATIONS Release;RelWithDebInfo;MinSizeRel
639                         )
640
641                         install(
642                                 FILES ${LIBDIR}/python/lib/python${_PYTHON_VERSION_NO_DOTS}_d.dll
643                                 DESTINATION "."
644                                 CONFIGURATIONS Debug
645                         )
646                 endif()
647
648                 if(WITH_PYTHON_INSTALL)
649                         # note, as far as python is concerned 'RelWithDebInfo' is not debug since its without debug flags.
650
651                         install(DIRECTORY DESTINATION ${TARGETDIR_VER}/python)
652                         install(DIRECTORY DESTINATION ${TARGETDIR_VER}/python/lib)
653
654                         # WARNING: its important that 'CMAKE_INSTALL_CONFIG_NAME' is evaluated at build time
655                         # and _NOT_ configuration time, when modifying the lines below,
656                         # check it works in both Release & Debug mode.
657                         #
658                         # Edit with extreme care! - Campbell
659
660                         # extract python
661                         install(
662                                 CODE
663                                 "
664                                 message(STATUS \"Extracting Python to: \${CMAKE_INSTALL_PREFIX}/${BLENDER_VERSION}/python\")
665                                 if(\"\${CMAKE_INSTALL_CONFIG_NAME}\" MATCHES \"^([Dd][Ee][Bb][Uu][Gg])$\")
666                                         set(PYTHON_ZIP \"${LIBDIR}/release/python${_PYTHON_VERSION_NO_DOTS}_d.tar.gz\")
667                                 else()
668                                         set(PYTHON_ZIP \"${LIBDIR}/release/python${_PYTHON_VERSION_NO_DOTS}.tar.gz\")
669                                 endif()
670
671                                 execute_process(
672                                         COMMAND \${CMAKE_COMMAND} -E make_directory
673                                                 \"\${CMAKE_INSTALL_PREFIX}/${BLENDER_VERSION}/python\"
674                                         COMMAND \${CMAKE_COMMAND} -E
675                                                 chdir \"\${CMAKE_INSTALL_PREFIX}/${BLENDER_VERSION}/python\"
676                                                 \${CMAKE_COMMAND} -E
677                                                 tar xzfv \"\${PYTHON_ZIP}\"
678                                 )
679                                 unset(PYTHON_ZIP)
680                                 "
681                         )
682
683                         # release/site-packages
684                         install(
685                                 DIRECTORY ${LIBDIR}/release/site-packages
686                                 DESTINATION ${BLENDER_VERSION}/python/lib
687                                 PATTERN ".svn" EXCLUDE
688                                 PATTERN "__pycache__" EXCLUDE           # * any cache *
689                                 PATTERN "*.pyc" EXCLUDE                 # * any cache *
690                                 PATTERN "*.pyo" EXCLUDE                 # * any cache *)
691                         )
692
693                         if(WITH_PYTHON_INSTALL_NUMPY)
694                                 add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${BLENDER_VERSION}/python/lib/site-packages
695                                         COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/${BLENDER_VERSION}/python/lib/site-packages)
696
697                                 add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${BLENDER_VERSION}/python/lib/site-packages/numpy
698                                         COMMAND ${CMAKE_COMMAND} -E tar xzvf "${LIBDIR}/release/python${_PYTHON_VERSION_NO_DOTS}_numpy_1.9.tar.gz"
699                                         DEPENDS ${LIBDIR}/release/python${_PYTHON_VERSION_NO_DOTS}_numpy_1.9.tar.gz
700                                                 ${CMAKE_CURRENT_BINARY_DIR}/${BLENDER_VERSION}/python/lib/site-packages
701                                         WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${BLENDER_VERSION}/python/lib/site-packages)
702                                 add_custom_target(python_numpy ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${BLENDER_VERSION}/python/lib/site-packages/numpy)
703                                 install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${BLENDER_VERSION}/python/lib/site-packages/numpy
704                                                 DESTINATION ${BLENDER_VERSION}/python/lib/site-packages)
705                         endif()
706
707
708                         # TODO(sergey): For unti we've got better way to deal with python binary
709                         install(
710                                 FILES ${LIBDIR}/python/lib/python${_PYTHON_VERSION_NO_DOTS}.dll
711                                 DESTINATION ${BLENDER_VERSION}/python/bin
712                                 CONFIGURATIONS Release;RelWithDebInfo;MinSizeRel
713                         )
714                         install(
715                                 FILES ${LIBDIR}/python/lib/python${_PYTHON_VERSION_NO_DOTS}_d.dll
716                                 DESTINATION ${BLENDER_VERSION}/python/bin
717                                 CONFIGURATIONS Debug
718                         )
719
720                         # MinGW needs Python DLL
721                         if(MINGW)
722                                 install(
723                                         FILES ${LIBDIR}/python/lib/python${_PYTHON_VERSION_NO_DOTS}.dll
724                                         DESTINATION "."
725                                         CONFIGURATIONS Release;RelWithDebInfo;MinSizeRel
726                                 )
727                                 install(
728                                         FILES ${LIBDIR}/python/lib/python${_PYTHON_VERSION_NO_DOTS}_d.dll
729                                         DESTINATION "."
730                                         CONFIGURATIONS Debug
731                                 )
732                         endif()
733                 endif()
734
735                 unset(_PYTHON_VERSION_NO_DOTS)
736         endif()
737
738         # EGL Runtime Components
739         if(WITH_GL_EGL)
740                 if(WIN32)
741                         install(FILES "${OPENGLES_DLL}"     DESTINATION ".")
742                         install(FILES "${OPENGLES_EGL_DLL}" DESTINATION ".")
743
744                         if(WITH_GL_ANGLE)
745                                 install(FILES "${D3DCOMPILER_DLL}" DESTINATION ".")
746                         endif()
747                 endif()
748         endif()
749
750         if(MSVC)
751                 install(
752                         FILES ${LIBDIR}/pthreads/lib/pthreadVC2.dll
753                         DESTINATION "."
754                 )
755         else()
756                 #MinGW64 comes with own version. For portable builds it will probaly have to be copied to work
757                 if(NOT WITH_MINGW64)
758                         install(
759                                 FILES ${LIBDIR}/pthreads/lib/pthreadGC2.dll
760                                 DESTINATION "."
761                         )
762                 elseif(WITH_MINGW64)
763                         install(
764                                 FILES 
765                                         ${LIBDIR}/binaries/libgcc_s_sjlj-1.dll
766                                         ${LIBDIR}/binaries/libwinpthread-1.dll
767                                         ${LIBDIR}/binaries/libstdc++-6.dll
768                                 DESTINATION "."
769                         )
770                         
771                         if(WITH_OPENMP)
772                                 install(
773                                         FILES 
774                                         ${LIBDIR}/binaries/libgomp-1.dll
775                                         DESTINATION "."
776                                 )
777                         endif()
778                 endif()
779         endif()
780
781         if(WITH_CODEC_FFMPEG)
782                 if(WITH_MINGW64)
783                         install(
784                                 FILES
785                                         ${LIBDIR}/ffmpeg/lib/avcodec-53.dll
786                                         ${LIBDIR}/ffmpeg/lib/avformat-53.dll
787                                         ${LIBDIR}/ffmpeg/lib/avdevice-53.dll
788                                         ${LIBDIR}/ffmpeg/lib/avutil-51.dll
789                                         ${LIBDIR}/ffmpeg/lib/swscale-2.dll
790                                         ${LIBDIR}/ffmpeg/lib/swresample-0.dll
791                                         ${LIBDIR}/ffmpeg/lib/xvidcore.dll
792                                 DESTINATION "."
793                         )
794                 else()
795                         install(
796                                 FILES
797                                         ${LIBDIR}/ffmpeg/lib/avcodec-55.dll
798                                         ${LIBDIR}/ffmpeg/lib/avformat-55.dll
799                                         ${LIBDIR}/ffmpeg/lib/avdevice-55.dll
800                                         ${LIBDIR}/ffmpeg/lib/avutil-52.dll
801                                         ${LIBDIR}/ffmpeg/lib/swscale-2.dll
802                                 DESTINATION "."
803                         )
804                 endif()
805         endif()
806
807         if(WITH_CODEC_SNDFILE)
808                 install(
809                         FILES ${LIBDIR}/sndfile/lib/libsndfile-1.dll
810                         DESTINATION "."
811                 )
812         endif()
813
814         if(WITH_OPENAL)
815                 install(
816                         FILES
817                                 ${LIBDIR}/openal/lib/OpenAL32.dll
818                         DESTINATION "."
819                 )
820                 # MinGW TODO: Need to update to a newer OpenAL version
821                 # which does not depend on wrap_oal.dll
822                 if(CMAKE_COMPILER_IS_GNUCC)
823                         install(
824                                 FILES
825                                         ${LIBDIR}/openal/lib/wrap_oal.dll
826                                 DESTINATION "."
827                         )
828                 endif()
829         endif()
830
831         if(WITH_SDL)
832                 #MinGW TODO: Update to SDL2
833                 if(NOT CMAKE_COMPILER_IS_GNUCC)
834                         install(
835                                 FILES ${LIBDIR}/sdl/lib/SDL2.dll
836                                 DESTINATION "."
837                         )
838                 else()
839                         install(
840                                 FILES ${LIBDIR}/sdl/lib/SDL.dll
841                                 DESTINATION "."
842                         )
843                 endif()
844         endif()
845         
846         if(WITH_SYSTEM_AUDASPACE)
847                 install(
848                         FILES
849                                 ${LIBDIR}/audaspace/lib/audaspace.dll
850                                 ${LIBDIR}/audaspace/lib/audaspace-c.dll
851                                 ${LIBDIR}/audaspace/lib/audaspace-py.dll
852                         DESTINATION "."
853                 )
854         endif()
855
856         if(NOT CMAKE_CL_64)
857                 install(
858                         FILES ${LIBDIR}/thumbhandler/lib/BlendThumb.dll
859                         DESTINATION "."
860                 )
861         endif()
862                 
863         install( # x86 builds can run on x64 Windows, so this is required at all times
864                 FILES ${LIBDIR}/thumbhandler/lib/BlendThumb64.dll
865                 DESTINATION "."
866         )
867
868         if(WITH_OPENCOLORIO)
869                 set(OCIOBIN ${LIBDIR}/opencolorio/bin)
870                 if(NOT MINGW)
871                         install(
872                                 FILES
873                                         ${OCIOBIN}/OpenColorIO.dll
874                                 DESTINATION "."
875                         )
876                 else()
877                         install(
878                                 FILES
879                                         ${OCIOBIN}/libOpenColorIO.dll
880                                 DESTINATION "."
881                         )
882                 endif()
883         endif()
884
885 elseif(APPLE)
886
887         # handy install macro to exclude files, we use \$ escape for the "to"
888         # argument when calling so ${BUILD_TYPE} does not get expanded
889         macro(install_dir from to)
890                 install(
891                         DIRECTORY ${from}
892                         DESTINATION ${to}
893                         PATTERN ".git" EXCLUDE
894                         PATTERN ".svn" EXCLUDE
895                         PATTERN "*.pyc" EXCLUDE
896                         PATTERN "*.pyo" EXCLUDE
897                         PATTERN "*.orig" EXCLUDE
898                         PATTERN "*.rej" EXCLUDE
899                         PATTERN "__pycache__" EXCLUDE
900                         PATTERN "__MACOSX" EXCLUDE
901                         PATTERN ".DS_Store" EXCLUDE
902                 )
903         endmacro()
904
905         set(OSX_APP_SOURCEDIR ${CMAKE_SOURCE_DIR}/release/darwin/blender.app)
906
907         # setup Info.plist
908         execute_process(COMMAND date "+%Y-%m-%d"
909                         OUTPUT_VARIABLE BLENDER_DATE
910                         OUTPUT_STRIP_TRAILING_WHITESPACE)
911
912         set_target_properties(blender PROPERTIES
913                 MACOSX_BUNDLE_INFO_PLIST ${OSX_APP_SOURCEDIR}/Contents/Info.plist
914                 MACOSX_BUNDLE_SHORT_VERSION_STRING ${BLENDER_VERSION}
915                 MACOSX_BUNDLE_LONG_VERSION_STRING "${BLENDER_VERSION} ${BLENDER_DATE}")
916
917         # Gather the date in finder-style
918         execute_process(COMMAND date "+%m/%d/%Y/%H:%M"
919         OUTPUT_VARIABLE SETFILE_DATE
920         OUTPUT_STRIP_TRAILING_WHITESPACE)
921
922         # Give the bundle actual creation/modification date
923         execute_process(COMMAND SetFile -d ${SETFILE_DATE} -m ${SETFILE_DATE} ${EXECUTABLE_OUTPUT_PATH}/blender.app)
924
925         install(
926                 TARGETS blender
927                 DESTINATION "."
928         )
929
930         # install release and app files
931         set(BLENDER_TEXT_FILES_DESTINATION ".")
932
933         install(
934                 FILES ${OSX_APP_SOURCEDIR}/Contents/PkgInfo
935                 DESTINATION blender.app/Contents
936         )
937
938         install_dir(
939                 ${OSX_APP_SOURCEDIR}/Contents/Resources
940                 blender.app/Contents/
941         )
942
943         if(WITH_OPENMP AND CMAKE_C_COMPILER_ID MATCHES "Clang" AND NOT ${CMAKE_C_COMPILER_VERSION} VERSION_LESS '3.4')
944                 install(
945                         FILES ${LIBDIR}/openmp/lib/libiomp5.dylib
946                         DESTINATION blender.app/Contents/Resources/lib/
947                 )
948                 install(
949                         FILES ${LIBDIR}/openmp/LICENSE.txt
950                         DESTINATION "."
951                         RENAME LICENSE-libiomp5.txt
952                 )
953         endif()
954
955         if(WITH_LLVM AND NOT LLVM_STATIC)
956                 install(
957                         FILES ${LIBDIR}/llvm/lib/libLLVM-3.4.dylib
958                         DESTINATION blender.app/Contents/MacOS
959                 )
960         endif()
961
962         # python
963         if(WITH_PYTHON AND NOT WITH_PYTHON_MODULE AND NOT WITH_PYTHON_FRAMEWORK)
964                 # the python zip is first extract as part of the build process,
965                 # and then later installed as part of make install. this is much
966                 # quicker, and means we can easily exclude files on copy
967                 # Not needed for PYTHON_MODULE or WEB_PLUGIN due uses  Pyhon framework
968                 add_custom_target(
969                         extractpyzip
970                         DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/python)
971
972                 set(PYTHON_ZIP "python_${CMAKE_OSX_ARCHITECTURES}.zip")
973
974                 add_custom_command(
975                         OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/python
976                         COMMAND ${CMAKE_COMMAND} -E remove_directory "${CMAKE_CURRENT_BINARY_DIR}/python/"
977                         COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/python/"
978                         COMMAND ${CMAKE_COMMAND} -E chdir "${CMAKE_CURRENT_BINARY_DIR}/python/"
979                                 ${CMAKE_COMMAND} -E tar xzfv "${LIBDIR}/release/${PYTHON_ZIP}"
980                         DEPENDS ${LIBDIR}/release/${PYTHON_ZIP})
981
982                 add_dependencies(blender extractpyzip)
983
984                 # copy extracted python files
985                 install_dir(
986                         ${CMAKE_CURRENT_BINARY_DIR}/python
987                         \${TARGETDIR_VER}
988                 )
989                 # copy site-packages files
990                 install_dir(
991                         ${LIBDIR}/release/site-packages
992                         ${CMAKE_CURRENT_BINARY_DIR}/python/lib/python${PYTHON_VERSION}
993                 )
994
995                 install(DIRECTORY ${LIBDIR}/python/bin
996                         DESTINATION ${TARGETDIR_VER}/python
997                         USE_SOURCE_PERMISSIONS
998                 )
999         endif()
1000         
1001         # install blenderplayer bundle - copy of blender.app above. re-using macros et al
1002         # note we are using OSX Bundle as base and copying Blender dummy bundle on top of it
1003         if(WITH_GAMEENGINE AND WITH_PLAYER)
1004                 set(OSX_APP_PLAYER_SOURCEDIR ${CMAKE_SOURCE_DIR}/release/darwin/blenderplayer.app)
1005                 set(PLAYER_SOURCEINFO ${OSX_APP_PLAYER_SOURCEDIR}/Contents/Info.plist)
1006                 set(PLAYER_TARGETDIR_VER blenderplayer.app/Contents/Resources/${BLENDER_VERSION})
1007
1008
1009                 # important to make a clean  install each time else old scripts get loaded.
1010                 install(
1011                         CODE
1012                         "file(REMOVE_RECURSE ${PLAYER_TARGETDIR_VER})"
1013                 )
1014
1015                 # Give the bundle actual creation/modification date
1016                 execute_process(COMMAND SetFile -d ${SETFILE_DATE} -m ${SETFILE_DATE} ${EXECUTABLE_OUTPUT_PATH}/blenderplayer.app)
1017
1018                 install(
1019                         FILES ${OSX_APP_PLAYER_SOURCEDIR}/Contents/PkgInfo
1020                         DESTINATION blenderplayer.app/Contents
1021                 )
1022
1023                 install_dir(
1024                         ${OSX_APP_PLAYER_SOURCEDIR}/Contents/Resources
1025                         blenderplayer.app/Contents/
1026                 )
1027
1028                 if(WITH_OPENMP AND CMAKE_C_COMPILER_ID MATCHES "Clang" AND NOT ${CMAKE_C_COMPILER_VERSION} VERSION_LESS '3.4')
1029                 install(
1030                 FILES ${LIBDIR}/openmp/lib/libiomp5.dylib
1031                 DESTINATION blenderplayer.app/Contents/Resources/lib/
1032                 )
1033                 endif()
1034
1035
1036                 # python
1037                 if(WITH_PYTHON AND NOT WITH_PYTHON_FRAMEWORK)
1038                         add_custom_command(
1039                                 OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/python
1040                                 COMMAND ${CMAKE_COMMAND} -E remove_directory "${CMAKE_CURRENT_BINARY_DIR}/python/"
1041                                 COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/python/"
1042                                 COMMAND ${CMAKE_COMMAND} -E chdir "${CMAKE_CURRENT_BINARY_DIR}/python/"
1043                                         ${CMAKE_COMMAND} -E tar xzfv "${LIBDIR}/release/${PYTHON_ZIP}"
1044                                 DEPENDS ${LIBDIR}/release/${PYTHON_ZIP})
1045
1046                         # copy extracted python files
1047                         install_dir(
1048                                 ${CMAKE_CURRENT_BINARY_DIR}/python
1049                                 \${PLAYER_TARGETDIR_VER}
1050                         )
1051                 endif()
1052
1053         endif()
1054
1055 endif()
1056
1057 # -----------------------------------------------------------------------------
1058 # Generic Install, for all targets
1059
1060 if(DEFINED BLENDER_TEXT_FILES_DESTINATION)
1061
1062         install(
1063                 CODE
1064                 "
1065                 file(READ \"${CMAKE_SOURCE_DIR}/release/text/readme.html\" DATA_SRC)
1066                 string(REGEX REPLACE \"BLENDER_VERSION\" \"${BLENDER_VERSION}\" DATA_DST \"\${DATA_SRC}\")
1067                 file(WRITE \"${CMAKE_BINARY_DIR}/release/text/readme.html\" \"\${DATA_DST}\")
1068                 unset(DATA_SRC)
1069                 unset(DATA_DST)
1070                 "
1071         )
1072         list(APPEND BLENDER_TEXT_FILES
1073                 ${CMAKE_BINARY_DIR}/release/text/readme.html
1074         )
1075
1076         install(
1077                 FILES ${BLENDER_TEXT_FILES}
1078                 DESTINATION "${BLENDER_TEXT_FILES_DESTINATION}"
1079         )
1080 endif()
1081
1082 # install more files specified elsewhere
1083 delayed_do_install(${TARGETDIR_VER})
1084
1085 unset(BLENDER_TEXT_FILES)
1086 unset(BLENDER_TEXT_FILES_DESTINATION)
1087
1088
1089 # -----------------------------------------------------------------------------
1090 # Setup link libs
1091
1092 add_dependencies(blender makesdna)
1093
1094 setup_blender_sorted_libs()
1095 target_link_libraries(blender ${BLENDER_SORTED_LIBS})
1096
1097 setup_liblinks(blender)
1098
1099 # -----------------------------------------------------------------------------
1100 # Setup launcher
1101
1102 if(WIN32 AND NOT WITH_PYTHON_MODULE)
1103         set(LAUNCHER_SRC
1104                 creator_launch_win.c
1105                 ${CMAKE_SOURCE_DIR}/release/windows/icons/winblender.rc
1106         )
1107         add_executable(blender-launcher ${LAUNCHER_SRC})
1108         target_link_libraries(blender-launcher bf_intern_utfconv ${PLATFORM_LINKLIBS})
1109
1110         set_target_properties(blender PROPERTIES OUTPUT_NAME blender-app)
1111         set_target_properties(blender-launcher PROPERTIES OUTPUT_NAME blender)
1112
1113         install(TARGETS blender blender-launcher
1114                         COMPONENT Blender
1115                         DESTINATION ".")
1116
1117         if(MSVC12_REDIST_DIR)
1118                 if(CMAKE_CL_64)
1119                         set(_WIN_PLATFORM x64)
1120                 else()
1121                         set(_WIN_PLATFORM x86)
1122                 endif()
1123                 install(
1124                         FILES ${MSVC12_REDIST_DIR}/${_WIN_PLATFORM}/Microsoft.VC120.CRT/msvcp120.dll
1125                                   ${MSVC12_REDIST_DIR}/${_WIN_PLATFORM}/Microsoft.VC120.CRT/msvcr120.dll
1126                 DESTINATION ".")
1127                 if(WITH_OPENMP)
1128                         install(
1129                                 FILES ${MSVC12_REDIST_DIR}/${_WIN_PLATFORM}/Microsoft.VC120.OpenMP/vcomp120.dll
1130                                 DESTINATION ".")
1131                 endif()
1132         endif()
1133 endif()