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