Cleanup: cmake, indentation, line length
[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                 # overrides only used when non-empty strings
190                 -DBUILD_DATE=${BUILDINFO_OVERRIDE_DATE}
191                 -DBUILD_TIME=${BUILDINFO_OVERRIDE_TIME}
192                 -P ${CMAKE_SOURCE_DIR}/build_files/cmake/buildinfo.cmake)
193
194         # buildinfo.h is a generated file
195         set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/buildinfo.h
196                 PROPERTIES GENERATED TRUE
197                 HEADER_FILE_ONLY TRUE)
198
199         # add deps below, after adding blender
200         # -------------- done with header values.
201
202         list(APPEND SRC
203                 buildinfo.c
204         )
205
206         # make an object library so can load with it in tests
207         add_library(buildinfoobj OBJECT buildinfo.c)
208         add_dependencies(buildinfoobj buildinfo)
209 endif()
210
211 # message(STATUS "Configuring blender")
212 if(WITH_PYTHON_MODULE)
213         add_definitions(-DWITH_PYTHON_MODULE)
214
215         # creates ./bin/bpy.so which can be imported as a python module.
216         #
217         # note that 'SHARED' works on Linux and Windows,
218         # but not OSX which _must_ be 'MODULE'
219         add_library(blender MODULE ${SRC})
220         set_target_properties(
221                 blender
222                 PROPERTIES
223                         PREFIX ""
224                         OUTPUT_NAME bpy
225                         LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
226                         RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin  # only needed on windows
227         )
228
229         if(APPLE)
230                 set_target_properties(
231                         blender
232                         PROPERTIES
233                                 MACOSX_BUNDLE
234                                 LINK_FLAGS_RELEASE "${PLATFORM_LINKFLAGS}"
235                                 LINK_FLAGS_DEBUG "${PLATFORM_LINKFLAGS_DEBUG}"
236                 )
237         endif()
238
239         if(WIN32)
240                 # python modules use this
241                 set_target_properties(
242                         blender
243                         PROPERTIES
244                         SUFFIX ".pyd"
245                 )
246         endif()
247
248 else()
249         add_executable(blender ${EXETYPE} ${SRC})
250 endif()
251
252 if(WITH_BUILDINFO)
253         # explicitly say that the executable depends on the buildinfo
254         add_dependencies(blender buildinfo)
255 endif()
256
257
258 set(BLENDER_TEXT_FILES
259         ${CMAKE_SOURCE_DIR}/release/text/GPL-license.txt
260         ${CMAKE_SOURCE_DIR}/release/text/GPL3-license.txt
261         ${CMAKE_SOURCE_DIR}/release/text/Python-license.txt
262         ${CMAKE_SOURCE_DIR}/release/text/copyright.txt
263         ${CMAKE_SOURCE_DIR}/release/text/jemalloc-license.txt
264         ${CMAKE_SOURCE_DIR}/release/text/ocio-license.txt
265         # generate this file
266         # ${CMAKE_SOURCE_DIR}/release/text/readme.html
267         ${CMAKE_SOURCE_DIR}/release/datafiles/LICENSE-bfont.ttf.txt
268 )
269
270 if(WITH_INTERNATIONAL)
271         list(APPEND BLENDER_TEXT_FILES
272                 ${CMAKE_SOURCE_DIR}/release/datafiles/LICENSE-droidsans.ttf.txt
273                 ${CMAKE_SOURCE_DIR}/release/datafiles/LICENSE-bmonofont-i18n.ttf.txt
274         )
275 endif()
276
277
278 # -----------------------------------------------------------------------------
279 # Platform Specific Var: TARGETDIR_VER
280
281 if(UNIX AND NOT APPLE)
282         if(WITH_PYTHON_MODULE)
283                 if(WITH_INSTALL_PORTABLE)
284                         set(TARGETDIR_VER ${BLENDER_VERSION})
285                 else()
286                         set(TARGETDIR_VER ${PYTHON_SITE_PACKAGES}/${BLENDER_VERSION})
287                 endif()
288         else()
289                 if(WITH_INSTALL_PORTABLE)
290                         set(TARGETDIR_VER ${BLENDER_VERSION})
291                 else()
292                         set(TARGETDIR_VER share/blender/${BLENDER_VERSION})
293                 endif()
294         endif()
295
296 elseif(WIN32)
297         set(TARGETDIR_VER ${BLENDER_VERSION})
298
299 elseif(APPLE)
300         if(WITH_PYTHON_MODULE)
301                 set(TARGETDIR_VER ${BLENDER_VERSION})
302         else()
303                 set(TARGETDIR_VER blender.app/Contents/Resources/${BLENDER_VERSION})
304         endif()
305         # Skip relinking on cpack / install
306         set_target_properties(blender PROPERTIES BUILD_WITH_INSTALL_RPATH true)
307 endif()
308
309
310 # -----------------------------------------------------------------------------
311 # Install Targets (Generic, All Platforms)
312
313
314 # important to make a clean  install each time, else old scripts get loaded.
315 install(
316         CODE
317         "file(REMOVE_RECURSE ${TARGETDIR_VER})"
318 )
319
320 if(WITH_PYTHON)
321         # install(CODE "message(\"copying blender scripts...\")")
322         
323         # exclude addons_contrib if release
324         if("${BLENDER_VERSION_CYCLE}" STREQUAL "release")
325                 set(ADDON_EXCLUDE_CONDITIONAL "addons_contrib/*")
326         else()
327                 set(ADDON_EXCLUDE_CONDITIONAL "_addons_contrib/*")  # dummy, wont do anything
328         endif()
329
330         # do not install freestyle dir if disabled
331         if(NOT WITH_FREESTYLE)
332                 set(FREESTYLE_EXCLUDE_CONDITIONAL "freestyle/*")
333         else()
334                 set(FREESTYLE_EXCLUDE_CONDITIONAL "_freestyle/*")  # dummy, wont do anything
335         endif()
336
337         install(
338                 DIRECTORY ${CMAKE_SOURCE_DIR}/release/scripts
339                 DESTINATION ${TARGETDIR_VER}
340                 PATTERN ".git" EXCLUDE
341                 PATTERN "__pycache__" EXCLUDE
342                 PATTERN "${ADDON_EXCLUDE_CONDITIONAL}" EXCLUDE
343                 PATTERN "${FREESTYLE_EXCLUDE_CONDITIONAL}" EXCLUDE
344         )
345         
346         unset(ADDON_EXCLUDE_CONDITIONAL)
347         unset(FREESTYLE_EXCLUDE_CONDITIONAL)
348 endif()
349
350 # localization
351 if(WITH_INTERNATIONAL)
352         install(
353                 DIRECTORY
354                         ${CMAKE_SOURCE_DIR}/release/datafiles/fonts
355                 DESTINATION ${TARGETDIR_VER}/datafiles
356         )
357
358         set(_locale_dir "${CMAKE_SOURCE_DIR}/release/datafiles/locale")
359         set(_locale_target_dir ${TARGETDIR_VER}/datafiles/locale)
360
361         file(GLOB _po_files "${_locale_dir}/po/*.po")
362         foreach(_po_file ${_po_files})
363                 msgfmt_simple(${_po_file} _all_mo_files)
364         endforeach()
365
366         # Create a custom target which will compile all po to mo
367         add_custom_target(
368                 locales
369                 DEPENDS ${_all_mo_files})
370
371         add_dependencies(blender locales)
372
373         # Generate INSTALL rules
374         install(
375                 FILES ${_locale_dir}/languages
376                 DESTINATION ${_locale_target_dir}
377         )
378
379         foreach(_mo_file ${_all_mo_files})
380                 get_filename_component(_locale_name ${_mo_file} NAME_WE)
381                 install(
382                         FILES ${_mo_file}
383                         DESTINATION ${_locale_target_dir}/${_locale_name}/LC_MESSAGES
384                         RENAME blender.mo
385                 )
386                 unset(_locale_name)
387         endforeach()
388
389         unset(_all_mo_files)
390         unset(_po_files)
391         unset(_po_file)
392         unset(_mo_file)
393         unset(_locale_target_dir)
394
395         unset(_locale_dir)
396 endif()
397
398 # color management
399 if(WITH_OPENCOLORIO)
400         install(
401                 DIRECTORY ${CMAKE_SOURCE_DIR}/release/datafiles/colormanagement
402                 DESTINATION ${TARGETDIR_VER}/datafiles
403         )
404 endif()
405
406 # helpful tip when using make
407 if("${CMAKE_GENERATOR}" MATCHES ".*Makefiles.*")
408         # message after building.
409         add_custom_command(
410                 TARGET blender POST_BUILD MAIN_DEPENDENCY blender
411                 COMMAND ${CMAKE_COMMAND} -E
412                         echo 'now run: \"make install\" to copy runtime files and scripts to ${TARGETDIR_VER}'
413         )
414 endif()
415
416
417 # -----------------------------------------------------------------------------
418 # Install Targets (Platform Specific)
419
420 if(UNIX AND NOT APPLE)
421
422         if(NOT WITH_PYTHON_MODULE)
423                 if(WITH_DOC_MANPAGE)
424                         add_custom_target(
425                                 blender_man_page ALL
426                                 COMMAND ${CMAKE_SOURCE_DIR}/doc/manpage/blender.1.py
427                                         ${EXECUTABLE_OUTPUT_PATH}/blender
428                                         ${CMAKE_CURRENT_BINARY_DIR}/blender.1)
429                         add_dependencies(blender_man_page blender)
430                 endif()
431         endif()
432
433         # there are a few differences between portable and system install
434         if(WITH_PYTHON_MODULE)
435                 if(WITH_INSTALL_PORTABLE)
436                         install(
437                                 TARGETS blender
438                                 DESTINATION "."
439                         )
440                 else()
441                         install(
442                                 TARGETS blender
443                                 LIBRARY DESTINATION ${PYTHON_SITE_PACKAGES}
444                         )
445                 endif()
446                 # none of the other files are needed currently
447         elseif(WITH_INSTALL_PORTABLE)
448                 install(
449                         TARGETS blender
450                         DESTINATION "."
451                 )
452
453                 if(WITH_DOC_MANPAGE)
454                         install(
455                                 FILES ${CMAKE_CURRENT_BINARY_DIR}/blender.1
456                                 DESTINATION "."
457                         )
458                 endif()
459                 install(
460                         FILES
461                                 ${CMAKE_SOURCE_DIR}/release/freedesktop/blender.desktop
462                                 ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/scalable/apps/blender.svg
463                         DESTINATION "."
464                 )
465
466                 install(
467                         PROGRAMS
468                         ${CMAKE_SOURCE_DIR}/release/bin/blender-thumbnailer.py
469                         DESTINATION "."
470                 )
471
472                 set(BLENDER_TEXT_FILES_DESTINATION ".")
473         else()
474                 # main blender binary
475                 install(
476                         TARGETS blender
477                         DESTINATION bin
478                 )
479                 if(WITH_DOC_MANPAGE)
480                         # manpage only with 'blender' binary
481                         install(
482                                 FILES ${CMAKE_CURRENT_BINARY_DIR}/blender.1
483                                 DESTINATION share/man/man1
484                         )
485                 endif()
486
487                 # misc files
488                 install(
489                         FILES ${CMAKE_SOURCE_DIR}/release/freedesktop/blender.desktop
490                         DESTINATION share/applications
491                 )
492                 install(
493                         DIRECTORY
494                                 ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/16x16
495                                 ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/22x22
496                                 ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/24x24
497                                 ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/32x32
498                                 ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/48x48
499                                 ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/256x256
500                         DESTINATION share/icons/hicolor
501                         PATTERN "*.svg" EXCLUDE
502                 )
503                 install(
504                         FILES ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/scalable/apps/blender.svg
505                         DESTINATION share/icons/hicolor/scalable/apps
506                 )
507                 install(
508                         PROGRAMS ${CMAKE_SOURCE_DIR}/release/bin/blender-thumbnailer.py
509                         DESTINATION bin
510                 )
511                 set(BLENDER_TEXT_FILES_DESTINATION share/doc/blender)
512         endif()
513
514         if(WITH_PYTHON)
515                 if(WITH_PYTHON_INSTALL)
516
517                         install(
518                                 PROGRAMS ${PYTHON_EXECUTABLE}
519                                 DESTINATION ${TARGETDIR_VER}/python/bin
520                         )
521
522                         # on some platforms (like openSUSE) Python is linked
523                         # to be used from lib64 folder.
524                         # determine this from Python's libraries path
525                         #
526                         # ugh, its possible 'lib64' is just a symlink to 'lib' which causes incorrect use of 'lib64'
527                         get_filename_component(_pypath_real ${PYTHON_LIBPATH} REALPATH)
528                         if(${_pypath_real} MATCHES "lib64$")
529                                 set(_target_LIB "lib64")
530                         else()
531                                 set(_target_LIB "lib")
532                         endif()
533                         unset(_pypath_real)
534
535                         # Copy the systems python into the install directory
536                         # install(CODE "message(\"copying a subset of the systems python...\")")
537                         install(
538                                 DIRECTORY ${PYTHON_LIBPATH}/python${PYTHON_VERSION}
539                                 DESTINATION ${TARGETDIR_VER}/python/${_target_LIB}
540                                 PATTERN "__pycache__" EXCLUDE               # * any cache *
541                                 PATTERN "lib2to3" EXCLUDE                   # ./lib2to3
542                                 PATTERN "site-packages/*" EXCLUDE           # ./site-packages/*
543                                 PATTERN "tkinter" EXCLUDE                   # ./tkinter
544                                 PATTERN "lib-dynload/_tkinter.*" EXCLUDE    # ./lib-dynload/_tkinter.co
545                                 PATTERN "idlelib" EXCLUDE                   # ./idlelib
546                                 PATTERN "test" EXCLUDE                      # ./test
547                                 PATTERN "turtledemo" EXCLUDE                # ./turtledemo
548                                 PATTERN "turtle.py" EXCLUDE                 # ./turtle.py
549                         )
550
551                         # Needed for distutils/pip
552                         # get the last part of the include dir, will be 'python{version}{abiflag}',
553                         get_filename_component(_py_inc_suffix ${PYTHON_INCLUDE_DIR} NAME)
554                         install(
555                                 FILES ${PYTHON_INCLUDE_DIR}/pyconfig.h
556                                 DESTINATION ${TARGETDIR_VER}/python/include/${_py_inc_suffix}
557                         )
558                         unset(_py_inc_suffix)
559
560                         if(WITH_PYTHON_INSTALL_NUMPY)
561                                 # Install to the same directory as the source, so debian-like
562                                 # distros are happy with their policy.
563                                 set(_suffix "site-packages")
564                                 if(${PYTHON_NUMPY_PATH} MATCHES "dist-packages")
565                                         set(_suffix "dist-packages")
566                                 endif()
567                                 install(
568                                         DIRECTORY ${PYTHON_NUMPY_PATH}/numpy
569                                         DESTINATION ${TARGETDIR_VER}/python/${_target_LIB}/python${PYTHON_VERSION}/${_suffix}
570                                         PATTERN ".svn" EXCLUDE
571                                         PATTERN "__pycache__" EXCLUDE           # * any cache *
572                                         PATTERN "*.pyc" EXCLUDE                 # * any cache *
573                                         PATTERN "*.pyo" EXCLUDE                 # * any cache *
574                                         PATTERN "oldnumeric" EXCLUDE            # ./oldnumeric
575                                         PATTERN "doc" EXCLUDE                   # ./doc
576                                         PATTERN "tests" EXCLUDE                 # ./tests
577                                         PATTERN "f2py" EXCLUDE                  # ./f2py - fortran/python interface code, not for blender.
578                                         PATTERN "include" EXCLUDE               # include dirs all over, we wont use NumPy/CAPI
579                                         PATTERN "*.h" EXCLUDE                   # some includes are not in include dirs
580                                         PATTERN "*.a" EXCLUDE                   # ./core/lib/libnpymath.a - for linking, we dont need.
581                                 )
582                                 unset(_suffix)
583                         endif()
584
585                         # Copy requests, we need to generalize site-packages
586                         if(WITH_PYTHON_INSTALL_REQUESTS)
587                                 set(_suffix "site-packages")
588                                 if(${PYTHON_REQUESTS_PATH} MATCHES "dist-packages")
589                                         set(_suffix "dist-packages")
590                                 endif()
591                                 install(
592                                         DIRECTORY ${PYTHON_REQUESTS_PATH}/requests
593                                         DESTINATION ${TARGETDIR_VER}/python/${_target_LIB}/python${PYTHON_VERSION}/${_suffix}
594                                         PATTERN ".svn" EXCLUDE
595                                         PATTERN "__pycache__" EXCLUDE           # * any cache *
596                                         PATTERN "*.pyc" EXCLUDE                 # * any cache *
597                                         PATTERN "*.pyo" EXCLUDE                 # * any cache *
598                                 )
599                                 # On some platforms requests does have extra dependencies.
600                                 set(_requests_deps "chardet" "urllib3")
601                                 foreach(_requests_dep ${_requests_deps})
602                                         if(EXISTS ${PYTHON_REQUESTS_PATH}/${_requests_dep})
603                                                 install(
604                                                         DIRECTORY ${PYTHON_REQUESTS_PATH}/${_requests_dep}
605                                                         DESTINATION ${TARGETDIR_VER}/python/${_target_LIB}/python${PYTHON_VERSION}/${_suffix}
606                                                         PATTERN ".svn" EXCLUDE
607                                                         PATTERN "__pycache__" EXCLUDE           # * any cache *
608                                                         PATTERN "*.pyc" EXCLUDE                 # * any cache *
609                                                         PATTERN "*.pyo" EXCLUDE                 # * any cache *
610                                                 )
611                                         endif()
612                                 endforeach()
613                                 if(EXISTS ${PYTHON_REQUESTS_PATH}/six.py)
614                                         install(
615                                                 FILES ${PYTHON_REQUESTS_PATH}/six.py
616                                                 DESTINATION ${TARGETDIR_VER}/python/${_target_LIB}/python${PYTHON_VERSION}/${_suffix}
617                                         )
618                                 endif()
619                                 unset(_requests_dep)
620                                 unset(_requests_deps)
621                                 unset(_suffix)
622                         endif()
623                         unset(_target_LIB)
624                         
625                 endif()
626         endif()
627 elseif(WIN32)
628
629         set(BLENDER_TEXT_FILES_DESTINATION ".")
630
631         if(WITH_PYTHON)
632                 string(REPLACE "." "" _PYTHON_VERSION_NO_DOTS ${PYTHON_VERSION})
633
634                 # MinGW TODO: This bit of Python configuration diverges from MSVC
635                 if(NOT CMAKE_COMPILER_IS_GNUCC)
636                         install(
637                                 FILES ${LIBDIR}/python/lib/python${_PYTHON_VERSION_NO_DOTS}.dll
638                                 DESTINATION "."
639                                 CONFIGURATIONS Release;RelWithDebInfo;MinSizeRel
640                         )
641
642                         install(
643                                 FILES ${LIBDIR}/python/lib/python${_PYTHON_VERSION_NO_DOTS}_d.dll
644                                 DESTINATION "."
645                                 CONFIGURATIONS Debug
646                         )
647                 endif()
648
649                 if(WITH_PYTHON_INSTALL)
650                         # note, as far as python is concerned 'RelWithDebInfo' is not debug since its without debug flags.
651
652                         install(DIRECTORY DESTINATION ${TARGETDIR_VER}/python)
653                         install(DIRECTORY DESTINATION ${TARGETDIR_VER}/python/lib)
654
655                         # WARNING: its important that 'CMAKE_INSTALL_CONFIG_NAME' is evaluated at build time
656                         # and _NOT_ configuration time, when modifying the lines below,
657                         # check it works in both Release & Debug mode.
658                         #
659                         # Edit with extreme care! - Campbell
660
661                         # extract python
662                         install(
663                                 CODE
664                                 "
665                                 message(STATUS \"Extracting Python to: \${CMAKE_INSTALL_PREFIX}/${BLENDER_VERSION}/python\")
666                                 if(\"\${CMAKE_INSTALL_CONFIG_NAME}\" MATCHES \"^([Dd][Ee][Bb][Uu][Gg])$\")
667                                         set(PYTHON_ZIP \"${LIBDIR}/release/python${_PYTHON_VERSION_NO_DOTS}_d.tar.gz\")
668                                 else()
669                                         set(PYTHON_ZIP \"${LIBDIR}/release/python${_PYTHON_VERSION_NO_DOTS}.tar.gz\")
670                                 endif()
671
672                                 execute_process(
673                                         COMMAND \${CMAKE_COMMAND} -E make_directory
674                                                 \"\${CMAKE_INSTALL_PREFIX}/${BLENDER_VERSION}/python\"
675                                         COMMAND \${CMAKE_COMMAND} -E
676                                                 chdir \"\${CMAKE_INSTALL_PREFIX}/${BLENDER_VERSION}/python\"
677                                                 \${CMAKE_COMMAND} -E
678                                                 tar xzfv \"\${PYTHON_ZIP}\"
679                                 )
680                                 unset(PYTHON_ZIP)
681                                 "
682                         )
683
684                         # release/site-packages
685                         install(
686                                 DIRECTORY ${LIBDIR}/release/site-packages
687                                 DESTINATION ${BLENDER_VERSION}/python/lib
688                                 PATTERN ".svn" EXCLUDE
689                                 PATTERN "__pycache__" EXCLUDE           # * any cache *
690                                 PATTERN "*.pyc" EXCLUDE                 # * any cache *
691                                 PATTERN "*.pyo" EXCLUDE                 # * any cache *)
692                         )
693
694                         if(WITH_PYTHON_INSTALL_NUMPY)
695                                 add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${BLENDER_VERSION}/python/lib/site-packages
696                                         COMMAND ${CMAKE_COMMAND} -E
697                                                 make_directory ${CMAKE_CURRENT_BINARY_DIR}/${BLENDER_VERSION}/python/lib/site-packages)
698
699                                 add_custom_command(
700                                         OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${BLENDER_VERSION}/python/lib/site-packages/numpy
701                                         COMMAND ${CMAKE_COMMAND} -E
702                                                 tar xzvf "${LIBDIR}/release/python${_PYTHON_VERSION_NO_DOTS}_numpy_1.9.tar.gz"
703                                         DEPENDS
704                                                 ${LIBDIR}/release/python${_PYTHON_VERSION_NO_DOTS}_numpy_1.9.tar.gz
705                                                 ${CMAKE_CURRENT_BINARY_DIR}/${BLENDER_VERSION}/python/lib/site-packages
706                                         WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${BLENDER_VERSION}/python/lib/site-packages
707                                 )
708                                 add_custom_target(
709                                         python_numpy ALL
710                                         DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${BLENDER_VERSION}/python/lib/site-packages/numpy
711                                 )
712                                 install(
713                                         DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${BLENDER_VERSION}/python/lib/site-packages/numpy
714                                         DESTINATION ${BLENDER_VERSION}/python/lib/site-packages
715                                 )
716                         endif()
717
718
719                         # TODO(sergey): For unti we've got better way to deal with python binary
720                         install(
721                                 FILES ${LIBDIR}/python/lib/python${_PYTHON_VERSION_NO_DOTS}.dll
722                                 DESTINATION ${BLENDER_VERSION}/python/bin
723                                 CONFIGURATIONS Release;RelWithDebInfo;MinSizeRel
724                         )
725                         install(
726                                 FILES ${LIBDIR}/python/lib/python${_PYTHON_VERSION_NO_DOTS}_d.dll
727                                 DESTINATION ${BLENDER_VERSION}/python/bin
728                                 CONFIGURATIONS Debug
729                         )
730
731                         # MinGW needs Python DLL
732                         if(MINGW)
733                                 install(
734                                         FILES ${LIBDIR}/python/lib/python${_PYTHON_VERSION_NO_DOTS}.dll
735                                         DESTINATION "."
736                                         CONFIGURATIONS Release;RelWithDebInfo;MinSizeRel
737                                 )
738                                 install(
739                                         FILES ${LIBDIR}/python/lib/python${_PYTHON_VERSION_NO_DOTS}_d.dll
740                                         DESTINATION "."
741                                         CONFIGURATIONS Debug
742                                 )
743                         endif()
744                 endif()
745
746                 unset(_PYTHON_VERSION_NO_DOTS)
747         endif()
748
749         # EGL Runtime Components
750         if(WITH_GL_EGL)
751                 if(WIN32)
752                         install(FILES "${OPENGLES_DLL}"     DESTINATION ".")
753                         install(FILES "${OPENGLES_EGL_DLL}" DESTINATION ".")
754
755                         if(WITH_GL_ANGLE)
756                                 install(FILES "${D3DCOMPILER_DLL}" DESTINATION ".")
757                         endif()
758                 endif()
759         endif()
760
761         if(MSVC)
762                 install(
763                         FILES ${LIBDIR}/pthreads/lib/pthreadVC2.dll
764                         DESTINATION "."
765                 )
766         else()
767                 #MinGW64 comes with own version. For portable builds it will probaly have to be copied to work
768                 if(NOT WITH_MINGW64)
769                         install(
770                                 FILES ${LIBDIR}/pthreads/lib/pthreadGC2.dll
771                                 DESTINATION "."
772                         )
773                 elseif(WITH_MINGW64)
774                         install(
775                                 FILES 
776                                         ${LIBDIR}/binaries/libgcc_s_sjlj-1.dll
777                                         ${LIBDIR}/binaries/libwinpthread-1.dll
778                                         ${LIBDIR}/binaries/libstdc++-6.dll
779                                 DESTINATION "."
780                         )
781                         
782                         if(WITH_OPENMP)
783                                 install(
784                                         FILES 
785                                         ${LIBDIR}/binaries/libgomp-1.dll
786                                         DESTINATION "."
787                                 )
788                         endif()
789                 endif()
790         endif()
791
792         if(WITH_CODEC_FFMPEG)
793                 if(WITH_MINGW64)
794                         install(
795                                 FILES
796                                         ${LIBDIR}/ffmpeg/lib/avcodec-53.dll
797                                         ${LIBDIR}/ffmpeg/lib/avformat-53.dll
798                                         ${LIBDIR}/ffmpeg/lib/avdevice-53.dll
799                                         ${LIBDIR}/ffmpeg/lib/avutil-51.dll
800                                         ${LIBDIR}/ffmpeg/lib/swscale-2.dll
801                                         ${LIBDIR}/ffmpeg/lib/swresample-0.dll
802                                         ${LIBDIR}/ffmpeg/lib/xvidcore.dll
803                                 DESTINATION "."
804                         )
805                 else()
806                         install(
807                                 FILES
808                                         ${LIBDIR}/ffmpeg/lib/avcodec-55.dll
809                                         ${LIBDIR}/ffmpeg/lib/avformat-55.dll
810                                         ${LIBDIR}/ffmpeg/lib/avdevice-55.dll
811                                         ${LIBDIR}/ffmpeg/lib/avutil-52.dll
812                                         ${LIBDIR}/ffmpeg/lib/swscale-2.dll
813                                 DESTINATION "."
814                         )
815                 endif()
816         endif()
817
818         if(WITH_CODEC_SNDFILE)
819                 install(
820                         FILES ${LIBDIR}/sndfile/lib/libsndfile-1.dll
821                         DESTINATION "."
822                 )
823         endif()
824
825         if(WITH_OPENAL)
826                 install(
827                         FILES
828                                 ${LIBDIR}/openal/lib/OpenAL32.dll
829                         DESTINATION "."
830                 )
831                 # MinGW TODO: Need to update to a newer OpenAL version
832                 # which does not depend on wrap_oal.dll
833                 if(CMAKE_COMPILER_IS_GNUCC)
834                         install(
835                                 FILES
836                                         ${LIBDIR}/openal/lib/wrap_oal.dll
837                                 DESTINATION "."
838                         )
839                 endif()
840         endif()
841
842         if(WITH_SDL)
843                 #MinGW TODO: Update to SDL2
844                 if(NOT CMAKE_COMPILER_IS_GNUCC)
845                         install(
846                                 FILES ${LIBDIR}/sdl/lib/SDL2.dll
847                                 DESTINATION "."
848                         )
849                 else()
850                         install(
851                                 FILES ${LIBDIR}/sdl/lib/SDL.dll
852                                 DESTINATION "."
853                         )
854                 endif()
855         endif()
856         
857         if(WITH_SYSTEM_AUDASPACE)
858                 install(
859                         FILES
860                                 ${LIBDIR}/audaspace/lib/audaspace.dll
861                                 ${LIBDIR}/audaspace/lib/audaspace-c.dll
862                                 ${LIBDIR}/audaspace/lib/audaspace-py.dll
863                         DESTINATION "."
864                 )
865         endif()
866
867         if(NOT CMAKE_CL_64)
868                 install(
869                         FILES ${LIBDIR}/thumbhandler/lib/BlendThumb.dll
870                         DESTINATION "."
871                 )
872         endif()
873                 
874         install( # x86 builds can run on x64 Windows, so this is required at all times
875                 FILES ${LIBDIR}/thumbhandler/lib/BlendThumb64.dll
876                 DESTINATION "."
877         )
878
879         if(WITH_OPENCOLORIO)
880                 set(OCIOBIN ${LIBDIR}/opencolorio/bin)
881                 if(NOT MINGW)
882                         install(
883                                 FILES
884                                         ${OCIOBIN}/OpenColorIO.dll
885                                 DESTINATION "."
886                         )
887                 else()
888                         install(
889                                 FILES
890                                         ${OCIOBIN}/libOpenColorIO.dll
891                                 DESTINATION "."
892                         )
893                 endif()
894         endif()
895
896 elseif(APPLE)
897
898         # handy install macro to exclude files, we use \$ escape for the "to"
899         # argument when calling so ${BUILD_TYPE} does not get expanded
900         macro(install_dir from to)
901                 install(
902                         DIRECTORY ${from}
903                         DESTINATION ${to}
904                         PATTERN ".git" EXCLUDE
905                         PATTERN ".svn" EXCLUDE
906                         PATTERN "*.pyc" EXCLUDE
907                         PATTERN "*.pyo" EXCLUDE
908                         PATTERN "*.orig" EXCLUDE
909                         PATTERN "*.rej" EXCLUDE
910                         PATTERN "__pycache__" EXCLUDE
911                         PATTERN "__MACOSX" EXCLUDE
912                         PATTERN ".DS_Store" EXCLUDE
913                 )
914         endmacro()
915
916         set(OSX_APP_SOURCEDIR ${CMAKE_SOURCE_DIR}/release/darwin/blender.app)
917
918         # setup Info.plist
919         execute_process(COMMAND date "+%Y-%m-%d"
920                         OUTPUT_VARIABLE BLENDER_DATE
921                         OUTPUT_STRIP_TRAILING_WHITESPACE)
922
923         set_target_properties(blender PROPERTIES
924                 MACOSX_BUNDLE_INFO_PLIST ${OSX_APP_SOURCEDIR}/Contents/Info.plist
925                 MACOSX_BUNDLE_SHORT_VERSION_STRING ${BLENDER_VERSION}
926                 MACOSX_BUNDLE_LONG_VERSION_STRING "${BLENDER_VERSION} ${BLENDER_DATE}")
927
928         # Gather the date in finder-style
929         execute_process(COMMAND date "+%m/%d/%Y/%H:%M"
930         OUTPUT_VARIABLE SETFILE_DATE
931         OUTPUT_STRIP_TRAILING_WHITESPACE)
932
933         # Give the bundle actual creation/modification date
934         execute_process(COMMAND SetFile -d ${SETFILE_DATE} -m ${SETFILE_DATE}
935                         ${EXECUTABLE_OUTPUT_PATH}/blender.app)
936
937         install(
938                 TARGETS blender
939                 DESTINATION "."
940         )
941
942         # install release and app files
943         set(BLENDER_TEXT_FILES_DESTINATION ".")
944
945         install(
946                 FILES ${OSX_APP_SOURCEDIR}/Contents/PkgInfo
947                 DESTINATION blender.app/Contents
948         )
949
950         install_dir(
951                 ${OSX_APP_SOURCEDIR}/Contents/Resources
952                 blender.app/Contents/
953         )
954
955         if(WITH_OPENMP AND CMAKE_C_COMPILER_ID MATCHES "Clang" AND NOT ${CMAKE_C_COMPILER_VERSION} VERSION_LESS '3.4')
956                 install(
957                         FILES ${LIBDIR}/openmp/lib/libiomp5.dylib
958                         DESTINATION blender.app/Contents/Resources/lib/
959                 )
960                 install(
961                         FILES ${LIBDIR}/openmp/LICENSE.txt
962                         DESTINATION "."
963                         RENAME LICENSE-libiomp5.txt
964                 )
965         endif()
966
967         if(WITH_LLVM AND NOT LLVM_STATIC)
968                 install(
969                         FILES ${LIBDIR}/llvm/lib/libLLVM-3.4.dylib
970                         DESTINATION blender.app/Contents/MacOS
971                 )
972         endif()
973
974         # python
975         if(WITH_PYTHON AND NOT WITH_PYTHON_MODULE AND NOT WITH_PYTHON_FRAMEWORK)
976                 # the python zip is first extract as part of the build process,
977                 # and then later installed as part of make install. this is much
978                 # quicker, and means we can easily exclude files on copy
979                 # Not needed for PYTHON_MODULE or WEB_PLUGIN due uses  Pyhon framework
980                 add_custom_target(
981                         extractpyzip
982                         DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/python)
983
984                 set(PYTHON_ZIP "python_${CMAKE_OSX_ARCHITECTURES}.zip")
985
986                 add_custom_command(
987                         OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/python
988                         COMMAND ${CMAKE_COMMAND} -E remove_directory "${CMAKE_CURRENT_BINARY_DIR}/python/"
989                         COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/python/"
990                         COMMAND ${CMAKE_COMMAND} -E chdir "${CMAKE_CURRENT_BINARY_DIR}/python/"
991                                 ${CMAKE_COMMAND} -E tar xzfv "${LIBDIR}/release/${PYTHON_ZIP}"
992                         DEPENDS ${LIBDIR}/release/${PYTHON_ZIP})
993
994                 add_dependencies(blender extractpyzip)
995
996                 # copy extracted python files
997                 install_dir(
998                         ${CMAKE_CURRENT_BINARY_DIR}/python
999                         \${TARGETDIR_VER}
1000                 )
1001                 # copy site-packages files
1002                 install_dir(
1003                         ${LIBDIR}/release/site-packages
1004                         ${CMAKE_CURRENT_BINARY_DIR}/python/lib/python${PYTHON_VERSION}
1005                 )
1006
1007                 install(DIRECTORY ${LIBDIR}/python/bin
1008                         DESTINATION ${TARGETDIR_VER}/python
1009                         USE_SOURCE_PERMISSIONS
1010                 )
1011
1012                 # Needed for distutils/pip
1013                 # get the last part of the include dir, will be 'python{version}{abiflag}',
1014                 get_filename_component(_py_inc_suffix ${PYTHON_INCLUDE_DIR} NAME)
1015                 install(
1016                         FILES ${PYTHON_INCLUDE_DIR}/pyconfig.h
1017                         DESTINATION ${TARGETDIR_VER}/python/include/${_py_inc_suffix}
1018                 )
1019                 unset(_py_inc_suffix)
1020         endif()
1021         
1022         # install blenderplayer bundle - copy of blender.app above. re-using macros et al
1023         # note we are using OSX Bundle as base and copying Blender dummy bundle on top of it
1024         if(WITH_GAMEENGINE AND WITH_PLAYER)
1025                 set(OSX_APP_PLAYER_SOURCEDIR ${CMAKE_SOURCE_DIR}/release/darwin/blenderplayer.app)
1026                 set(PLAYER_SOURCEINFO ${OSX_APP_PLAYER_SOURCEDIR}/Contents/Info.plist)
1027                 set(PLAYER_TARGETDIR_VER blenderplayer.app/Contents/Resources/${BLENDER_VERSION})
1028
1029
1030                 # important to make a clean  install each time else old scripts get loaded.
1031                 install(
1032                         CODE
1033                         "file(REMOVE_RECURSE ${PLAYER_TARGETDIR_VER})"
1034                 )
1035
1036                 # Give the bundle actual creation/modification date
1037                 execute_process(COMMAND SetFile -d ${SETFILE_DATE} -m ${SETFILE_DATE}
1038                                 ${EXECUTABLE_OUTPUT_PATH}/blenderplayer.app)
1039
1040                 install(
1041                         FILES ${OSX_APP_PLAYER_SOURCEDIR}/Contents/PkgInfo
1042                         DESTINATION blenderplayer.app/Contents
1043                 )
1044
1045                 install_dir(
1046                         ${OSX_APP_PLAYER_SOURCEDIR}/Contents/Resources
1047                         blenderplayer.app/Contents/
1048                 )
1049
1050                 if(WITH_OPENMP AND CMAKE_C_COMPILER_ID MATCHES "Clang" AND NOT ${CMAKE_C_COMPILER_VERSION} VERSION_LESS '3.4')
1051                         install(
1052                                 FILES ${LIBDIR}/openmp/lib/libiomp5.dylib
1053                                 DESTINATION blenderplayer.app/Contents/Resources/lib/
1054                         )
1055                 endif()
1056
1057
1058                 # python
1059                 if(WITH_PYTHON AND NOT WITH_PYTHON_FRAMEWORK)
1060                         add_custom_command(
1061                                 OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/python
1062                                 COMMAND ${CMAKE_COMMAND} -E remove_directory "${CMAKE_CURRENT_BINARY_DIR}/python/"
1063                                 COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/python/"
1064                                 COMMAND ${CMAKE_COMMAND} -E chdir "${CMAKE_CURRENT_BINARY_DIR}/python/"
1065                                         ${CMAKE_COMMAND} -E tar xzfv "${LIBDIR}/release/${PYTHON_ZIP}"
1066                                 DEPENDS ${LIBDIR}/release/${PYTHON_ZIP})
1067
1068                         # copy extracted python files
1069                         install_dir(
1070                                 ${CMAKE_CURRENT_BINARY_DIR}/python
1071                                 \${PLAYER_TARGETDIR_VER}
1072                         )
1073                 endif()
1074
1075         endif()
1076
1077 endif()
1078
1079 # -----------------------------------------------------------------------------
1080 # Generic Install, for all targets
1081
1082 if(DEFINED BLENDER_TEXT_FILES_DESTINATION)
1083
1084         install(
1085                 CODE
1086                 "
1087                 file(READ \"${CMAKE_SOURCE_DIR}/release/text/readme.html\" DATA_SRC)
1088                 string(REGEX REPLACE \"BLENDER_VERSION\" \"${BLENDER_VERSION}\" DATA_DST \"\${DATA_SRC}\")
1089                 file(WRITE \"${CMAKE_BINARY_DIR}/release/text/readme.html\" \"\${DATA_DST}\")
1090                 unset(DATA_SRC)
1091                 unset(DATA_DST)
1092                 "
1093         )
1094         list(APPEND BLENDER_TEXT_FILES
1095                 ${CMAKE_BINARY_DIR}/release/text/readme.html
1096         )
1097
1098         install(
1099                 FILES ${BLENDER_TEXT_FILES}
1100                 DESTINATION "${BLENDER_TEXT_FILES_DESTINATION}"
1101         )
1102 endif()
1103
1104 # install more files specified elsewhere
1105 delayed_do_install(${TARGETDIR_VER})
1106
1107 unset(BLENDER_TEXT_FILES)
1108 unset(BLENDER_TEXT_FILES_DESTINATION)
1109
1110
1111 # -----------------------------------------------------------------------------
1112 # Setup link libs
1113
1114 add_dependencies(blender makesdna)
1115
1116 setup_blender_sorted_libs()
1117 target_link_libraries(blender ${BLENDER_SORTED_LIBS})
1118
1119 setup_liblinks(blender)
1120
1121 # -----------------------------------------------------------------------------
1122 # Setup launcher
1123
1124 if(WIN32 AND NOT WITH_PYTHON_MODULE)
1125         install(
1126                 TARGETS blender
1127                 COMPONENT Blender
1128                 DESTINATION "."
1129         )
1130
1131         if(MSVC12_REDIST_DIR)
1132                 if(CMAKE_CL_64)
1133                         set(_WIN_PLATFORM x64)
1134                 else()
1135                         set(_WIN_PLATFORM x86)
1136                 endif()
1137                 install(
1138                         FILES
1139                                 ${MSVC12_REDIST_DIR}/${_WIN_PLATFORM}/Microsoft.VC120.CRT/msvcp120.dll
1140                                 ${MSVC12_REDIST_DIR}/${_WIN_PLATFORM}/Microsoft.VC120.CRT/msvcr120.dll
1141                         DESTINATION "."
1142                 )
1143                 if(WITH_OPENMP)
1144                         install(
1145                                 FILES ${MSVC12_REDIST_DIR}/${_WIN_PLATFORM}/Microsoft.VC120.OpenMP/vcomp120.dll
1146                                 DESTINATION "."
1147                         )
1148                 endif()
1149         endif()
1150 endif()