Merge branch 'master' into blender2.8
[blender.git] / build_files / cmake / platform / platform_apple.cmake
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) 2016, Blender Foundation
18 # All rights reserved.
19 #
20 # Contributor(s): Sergey Sharybin.
21 #
22 # ***** END GPL LICENSE BLOCK *****
23
24 # Libraries configuration for Apple.
25
26 set(MACOSX_DEPLOYMENT_TARGET "10.9")
27
28 macro(find_package_wrapper)
29 # do nothing, just satisfy the macro
30 endmacro()
31
32 if(NOT DEFINED LIBDIR)
33         set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/darwin)
34         # Prefer lib directory paths
35         file(GLOB LIB_SUBDIRS ${LIBDIR}/*)
36         set(CMAKE_PREFIX_PATH ${LIB_SUBDIRS})
37 else()
38         message(STATUS "Using pre-compiled LIBDIR: ${LIBDIR}")
39 endif()
40 if(NOT EXISTS "${LIBDIR}/")
41         message(FATAL_ERROR "Mac OSX requires pre-compiled libs at: '${LIBDIR}'")
42 endif()
43
44 if(WITH_OPENAL)
45         find_package(OpenAL)
46         if(OPENAL_FOUND)
47                 set(WITH_OPENAL ON)
48                 set(OPENAL_INCLUDE_DIR "${LIBDIR}/openal/include/AL")
49         else()
50                 set(WITH_OPENAL OFF)
51         endif()
52 endif()
53
54 if(WITH_ALEMBIC)
55         set(ALEMBIC ${LIBDIR}/alembic)
56         set(ALEMBIC_INCLUDE_DIR ${ALEMBIC}/include)
57         set(ALEMBIC_INCLUDE_DIRS ${ALEMBIC_INCLUDE_DIR})
58         set(ALEMBIC_LIBPATH ${ALEMBIC}/lib)
59         set(ALEMBIC_LIBRARIES Alembic)
60         set(ALEMBIC_FOUND ON)
61 endif()
62
63 if(WITH_OPENSUBDIV OR WITH_CYCLES_OPENSUBDIV)
64         set(OPENSUBDIV ${LIBDIR}/opensubdiv)
65         set(OPENSUBDIV_LIBPATH ${OPENSUBDIV}/lib)
66         find_library(OSD_LIB_CPU NAMES osdCPU PATHS ${OPENSUBDIV_LIBPATH})
67         find_library(OSD_LIB_GPU NAMES osdGPU PATHS ${OPENSUBDIV_LIBPATH})
68         set(OPENSUBDIV_INCLUDE_DIR ${OPENSUBDIV}/include)
69         set(OPENSUBDIV_INCLUDE_DIRS ${OPENSUBDIV_INCLUDE_DIR})
70         list(APPEND OPENSUBDIV_LIBRARIES ${OSD_LIB_CPU} ${OSD_LIB_GPU})
71 endif()
72
73 if(WITH_JACK)
74         find_library(JACK_FRAMEWORK
75                 NAMES jackmp
76         )
77         set(JACK_INCLUDE_DIRS ${JACK_FRAMEWORK}/headers)
78         if(NOT JACK_FRAMEWORK)
79                 set(WITH_JACK OFF)
80         endif()
81 endif()
82
83 if(WITH_CODEC_SNDFILE)
84         set(LIBSNDFILE ${LIBDIR}/sndfile)
85         set(LIBSNDFILE_INCLUDE_DIRS ${LIBSNDFILE}/include)
86         set(LIBSNDFILE_LIBRARIES sndfile FLAC ogg vorbis vorbisenc)
87         set(LIBSNDFILE_LIBPATH ${LIBSNDFILE}/lib ${LIBDIR}/ffmpeg/lib)  # TODO, deprecate
88 endif()
89
90 if(WITH_PYTHON)
91         # we use precompiled libraries for py 3.5 and up by default
92         set(PYTHON_VERSION 3.6)
93         if(NOT WITH_PYTHON_MODULE AND NOT WITH_PYTHON_FRAMEWORK)
94                 # normally cached but not since we include them with blender
95                 set(PYTHON_INCLUDE_DIR "${LIBDIR}/python/include/python${PYTHON_VERSION}m")
96                 set(PYTHON_EXECUTABLE "${LIBDIR}/python/bin/python${PYTHON_VERSION}m")
97                 set(PYTHON_LIBRARY ${LIBDIR}/python/lib/libpython${PYTHON_VERSION}m.a)
98                 set(PYTHON_LIBPATH "${LIBDIR}/python/lib/python${PYTHON_VERSION}")
99                 # set(PYTHON_LINKFLAGS "-u _PyMac_Error")  # won't  build with this enabled
100         else()
101                 # module must be compiled against Python framework
102                 set(_py_framework "/Library/Frameworks/Python.framework/Versions/${PYTHON_VERSION}")
103
104                 set(PYTHON_INCLUDE_DIR "${_py_framework}/include/python${PYTHON_VERSION}m")
105                 set(PYTHON_EXECUTABLE "${_py_framework}/bin/python${PYTHON_VERSION}m")
106                 set(PYTHON_LIBPATH "${_py_framework}/lib/python${PYTHON_VERSION}/config-${PYTHON_VERSION}m")
107                 #set(PYTHON_LIBRARY python${PYTHON_VERSION})
108                 #set(PYTHON_LINKFLAGS "-u _PyMac_Error -framework Python")  # won't  build with this enabled
109
110                 unset(_py_framework)
111         endif()
112
113         # uncached vars
114         set(PYTHON_INCLUDE_DIRS "${PYTHON_INCLUDE_DIR}")
115         set(PYTHON_LIBRARIES  "${PYTHON_LIBRARY}")
116
117         # needed for Audaspace, numpy is installed into python site-packages
118         set(NUMPY_INCLUDE_DIRS "${PYTHON_LIBPATH}/site-packages/numpy/core/include")
119
120         if(NOT EXISTS "${PYTHON_EXECUTABLE}")
121                 message(FATAL_ERROR "Python executable missing: ${PYTHON_EXECUTABLE}")
122         endif()
123 endif()
124
125 if(WITH_FFTW3)
126         set(FFTW3 ${LIBDIR}/fftw3)
127         set(FFTW3_INCLUDE_DIRS ${FFTW3}/include)
128         set(FFTW3_LIBRARIES fftw3)
129         set(FFTW3_LIBPATH ${FFTW3}/lib)
130 endif()
131
132 set(PNG_LIBRARIES png)
133 set(JPEG_LIBRARIES jpeg)
134
135 set(ZLIB /usr)
136 set(ZLIB_INCLUDE_DIRS "${ZLIB}/include")
137 set(ZLIB_LIBRARIES z bz2)
138
139 set(FREETYPE ${LIBDIR}/freetype)
140 set(FREETYPE_INCLUDE_DIRS ${FREETYPE}/include ${FREETYPE}/include/freetype2)
141 set(FREETYPE_LIBPATH ${FREETYPE}/lib)
142 set(FREETYPE_LIBRARY freetype)
143
144 if(WITH_IMAGE_OPENEXR)
145         set(OPENEXR ${LIBDIR}/openexr)
146         set(OPENEXR_INCLUDE_DIR ${OPENEXR}/include)
147         set(OPENEXR_INCLUDE_DIRS ${OPENEXR_INCLUDE_DIR} ${OPENEXR}/include/OpenEXR)
148         set(OPENEXR_POSTFIX -2_2)
149         set(OPENEXR_LIBRARIES
150                 Iex${OPENEXR_POSTFIX}
151                 Half
152                 IlmImf${OPENEXR_POSTFIX}
153                 Imath${OPENEXR_POSTFIX}
154                 IlmThread${OPENEXR_POSTFIX})
155         set(OPENEXR_LIBPATH ${OPENEXR}/lib)
156 endif()
157
158 if(WITH_CODEC_FFMPEG)
159         set(FFMPEG ${LIBDIR}/ffmpeg)
160         set(FFMPEG_INCLUDE_DIRS ${FFMPEG}/include)
161         set(FFMPEG_LIBRARIES
162                 avcodec avdevice avformat avutil
163                 mp3lame swscale x264 xvidcore theora theoradec theoraenc vorbis vorbisenc vorbisfile ogg
164                 )
165               # commenting out until libs are updated on svn. schroedinger and orc
166               # will be removed then
167               # set(FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} vpx webp swresample)
168         set(FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} schroedinger orc vpx webp swresample)
169         set(FFMPEG_LIBPATH ${FFMPEG}/lib)
170 endif()
171
172 if(WITH_IMAGE_OPENJPEG OR WITH_CODEC_FFMPEG)
173         # use openjpeg from libdir that is linked into ffmpeg
174         set(OPENJPEG ${LIBDIR}/openjpeg)
175         set(WITH_SYSTEM_OPENJPEG ON)
176         set(OPENJPEG_INCLUDE_DIRS ${OPENJPEG}/include)
177         # same as with ffmpeg libs, update when svn are updated
178         #set(OPENJPEG_LIBRARIES ${OPENJPEG}/lib/libopenjp2.a)
179         set(OPENJPEG_LIBRARIES ${OPENJPEG}/lib/libopenjpeg.a)
180 endif()
181
182 find_library(SYSTEMSTUBS_LIBRARY
183         NAMES
184         SystemStubs
185         PATHS
186 )
187 mark_as_advanced(SYSTEMSTUBS_LIBRARY)
188 if(SYSTEMSTUBS_LIBRARY)
189         list(APPEND PLATFORM_LINKLIBS SystemStubs)
190 endif()
191
192 set(PLATFORM_CFLAGS "-pipe -funsigned-char")
193 set(PLATFORM_LINKFLAGS
194         "-fexceptions -framework CoreServices -framework Foundation -framework IOKit -framework AppKit -framework Cocoa -framework Carbon -framework AudioUnit -framework AudioToolbox -framework CoreAudio"
195 )
196
197 list(APPEND PLATFORM_LINKLIBS c++)
198
199 if(WITH_JACK)
200         set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -F/Library/Frameworks -weak_framework jackmp")
201 endif()
202
203 if(WITH_PYTHON_MODULE OR WITH_PYTHON_FRAMEWORK)
204         # force cmake to link right framework
205         set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} /Library/Frameworks/Python.framework/Versions/${PYTHON_VERSION}/Python")
206 endif()
207
208 if(WITH_OPENCOLLADA)
209         set(OPENCOLLADA ${LIBDIR}/opencollada)
210
211         set(OPENCOLLADA_INCLUDE_DIRS
212                 ${LIBDIR}/opencollada/include/COLLADAStreamWriter
213                 ${LIBDIR}/opencollada/include/COLLADABaseUtils
214                 ${LIBDIR}/opencollada/include/COLLADAFramework
215                 ${LIBDIR}/opencollada/include/COLLADASaxFrameworkLoader
216                 ${LIBDIR}/opencollada/include/GeneratedSaxParser
217         )
218
219         set(OPENCOLLADA_LIBPATH ${OPENCOLLADA}/lib)
220         set(OPENCOLLADA_LIBRARIES
221                 OpenCOLLADASaxFrameworkLoader
222                 -lOpenCOLLADAFramework
223                 -lOpenCOLLADABaseUtils
224                 -lOpenCOLLADAStreamWriter
225                 -lMathMLSolver
226                 -lGeneratedSaxParser
227                 -lxml2 -lbuffer -lftoa
228         )
229         # Use UTF functions from collada if LLVM is not enabled
230         if(NOT WITH_LLVM)
231                 list(APPEND OPENCOLLADA_LIBRARIES -lUTF)
232         endif()
233         # pcre is bundled with openCollada
234         #set(PCRE ${LIBDIR}/pcre)
235         #set(PCRE_LIBPATH ${PCRE}/lib)
236         set(PCRE_LIBRARIES pcre)
237         #libxml2 is used
238         #set(EXPAT ${LIBDIR}/expat)
239         #set(EXPAT_LIBPATH ${EXPAT}/lib)
240         set(EXPAT_LIB)
241 endif()
242
243 if(WITH_SDL)
244         set(SDL ${LIBDIR}/sdl)
245         set(SDL_INCLUDE_DIR ${SDL}/include)
246         set(SDL_LIBRARY SDL2)
247         set(SDL_LIBPATH ${SDL}/lib)
248         set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -framework ForceFeedback")
249 endif()
250
251 set(PNG "${LIBDIR}/png")
252 set(PNG_INCLUDE_DIRS "${PNG}/include")
253 set(PNG_LIBPATH ${PNG}/lib)
254
255 set(JPEG "${LIBDIR}/jpeg")
256 set(JPEG_INCLUDE_DIR "${JPEG}/include")
257 set(JPEG_LIBPATH ${JPEG}/lib)
258
259 if(WITH_IMAGE_TIFF)
260         set(TIFF ${LIBDIR}/tiff)
261         set(TIFF_INCLUDE_DIR ${TIFF}/include)
262         set(TIFF_LIBRARY tiff)
263         set(TIFF_LIBPATH ${TIFF}/lib)
264 endif()
265
266 if(WITH_BOOST)
267         set(BOOST ${LIBDIR}/boost)
268         set(BOOST_INCLUDE_DIR ${BOOST}/include)
269         set(BOOST_POSTFIX)
270         set(BOOST_LIBRARIES
271                 boost_date_time${BOOST_POSTFIX}
272                 boost_filesystem${BOOST_POSTFIX}
273                 boost_regex${BOOST_POSTFIX}
274                 boost_system${BOOST_POSTFIX}
275                 boost_thread${BOOST_POSTFIX}
276                 boost_wave${BOOST_POSTFIX}
277         )
278         if(WITH_INTERNATIONAL)
279                 list(APPEND BOOST_LIBRARIES boost_locale${BOOST_POSTFIX})
280         endif()
281         if(WITH_CYCLES_NETWORK)
282                 list(APPEND BOOST_LIBRARIES boost_serialization${BOOST_POSTFIX})
283         endif()
284         if(WITH_OPENVDB)
285                 list(APPEND BOOST_LIBRARIES boost_iostreams${BOOST_POSTFIX})
286         endif()
287         set(BOOST_LIBPATH ${BOOST}/lib)
288         set(BOOST_DEFINITIONS)
289 endif()
290
291 if(WITH_INTERNATIONAL OR WITH_CODEC_FFMPEG)
292         set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -liconv") # boost_locale and ffmpeg needs it !
293 endif()
294
295 if(WITH_OPENIMAGEIO)
296         set(OPENIMAGEIO ${LIBDIR}/openimageio)
297         set(OPENIMAGEIO_INCLUDE_DIRS ${OPENIMAGEIO}/include)
298         set(OPENIMAGEIO_LIBRARIES
299                 ${OPENIMAGEIO}/lib/libOpenImageIO.a
300                 ${PNG_LIBRARIES}
301                 ${JPEG_LIBRARIES}
302                 ${TIFF_LIBRARY}
303                 ${OPENEXR_LIBRARIES}
304                 ${OPENJPEG_LIBRARIES}
305                 ${ZLIB_LIBRARIES}
306         )
307         set(OPENIMAGEIO_LIBRARIES ${OPENIMAGEIO_LIBRARIES} ${LIBDIR}/ffmpeg/lib/libwebp.a)
308         set(OPENIMAGEIO_LIBPATH
309                 ${OPENIMAGEIO}/lib
310                 ${JPEG_LIBPATH}
311                 ${PNG_LIBPATH}
312                 ${TIFF_LIBPATH}
313                 ${OPENEXR_LIBPATH}
314                 ${ZLIB_LIBPATH}
315         )
316         set(OPENIMAGEIO_DEFINITIONS "-DOIIO_STATIC_BUILD")
317         set(OPENIMAGEIO_IDIFF "${LIBDIR}/openimageio/bin/idiff")
318 endif()
319
320 if(WITH_OPENCOLORIO)
321         set(OPENCOLORIO ${LIBDIR}/opencolorio)
322         set(OPENCOLORIO_INCLUDE_DIRS ${OPENCOLORIO}/include)
323         set(OPENCOLORIO_LIBRARIES OpenColorIO tinyxml yaml-cpp)
324         set(OPENCOLORIO_LIBPATH ${OPENCOLORIO}/lib)
325 endif()
326
327 if(WITH_OPENVDB)
328         set(OPENVDB ${LIBDIR}/openvdb)
329         set(OPENVDB_INCLUDE_DIRS ${OPENVDB}/include)
330         set(TBB_INCLUDE_DIRS ${LIBDIR}/tbb/include)
331         set(TBB_LIBRARIES ${LIBDIR}/tbb/lib/libtbb.a)
332         set(OPENVDB_LIBRARIES openvdb blosc ${TBB_LIBRARIES})
333         set(OPENVDB_LIBPATH ${LIBDIR}/openvdb/lib)
334         set(OPENVDB_DEFINITIONS)
335 endif()
336
337 if(WITH_LLVM)
338         set(LLVM_ROOT_DIR ${LIBDIR}/llvm)
339         set(LLVM_VERSION 3.4)
340         if(EXISTS "${LLVM_ROOT_DIR}/bin/llvm-config")
341                 set(LLVM_CONFIG "${LLVM_ROOT_DIR}/bin/llvm-config")
342         else()
343                 set(LLVM_CONFIG llvm-config)
344         endif()
345         execute_process(COMMAND ${LLVM_CONFIG} --version
346                         OUTPUT_VARIABLE LLVM_VERSION
347                         OUTPUT_STRIP_TRAILING_WHITESPACE)
348         execute_process(COMMAND ${LLVM_CONFIG} --prefix
349                         OUTPUT_VARIABLE LLVM_ROOT_DIR
350                         OUTPUT_STRIP_TRAILING_WHITESPACE)
351         execute_process(COMMAND ${LLVM_CONFIG} --libdir
352                         OUTPUT_VARIABLE LLVM_LIBPATH
353                         OUTPUT_STRIP_TRAILING_WHITESPACE)
354         find_library(LLVM_LIBRARY
355                       NAMES LLVMAnalysis # first of a whole bunch of libs to get
356                       PATHS ${LLVM_LIBPATH})
357
358         if(LLVM_LIBRARY AND LLVM_ROOT_DIR AND LLVM_LIBPATH)
359                 if(LLVM_STATIC)
360                         # if static LLVM libraries were requested, use llvm-config to generate
361                         # the list of what libraries we need, and substitute that in the right
362                         # way for LLVM_LIBRARY.
363                         execute_process(COMMAND ${LLVM_CONFIG} --libfiles
364                                         OUTPUT_VARIABLE LLVM_LIBRARY
365                                         OUTPUT_STRIP_TRAILING_WHITESPACE)
366                         string(REPLACE ".a /" ".a;/" LLVM_LIBRARY ${LLVM_LIBRARY})
367                 else()
368                         set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -lLLVM-3.4")
369                 endif()
370         else()
371                 message(FATAL_ERROR "LLVM not found.")
372         endif()
373 endif()
374
375 if(WITH_CYCLES_OSL)
376         set(CYCLES_OSL ${LIBDIR}/osl)
377
378         find_library(OSL_LIB_EXEC NAMES oslexec PATHS ${CYCLES_OSL}/lib)
379         find_library(OSL_LIB_COMP NAMES oslcomp PATHS ${CYCLES_OSL}/lib)
380         find_library(OSL_LIB_QUERY NAMES oslquery PATHS ${CYCLES_OSL}/lib)
381         # WARNING! depends on correct order of OSL libs linking
382         list(APPEND OSL_LIBRARIES ${OSL_LIB_COMP} -force_load ${OSL_LIB_EXEC} ${OSL_LIB_QUERY})
383         find_path(OSL_INCLUDE_DIR OSL/oslclosure.h PATHS ${CYCLES_OSL}/include)
384         find_program(OSL_COMPILER NAMES oslc PATHS ${CYCLES_OSL}/bin)
385
386         if(OSL_INCLUDE_DIR AND OSL_LIBRARIES AND OSL_COMPILER)
387                 set(OSL_FOUND TRUE)
388         else()
389                 message(STATUS "OSL not found")
390                 set(WITH_CYCLES_OSL OFF)
391         endif()
392 endif()
393
394 if(WITH_OPENMP)
395         execute_process(COMMAND ${CMAKE_C_COMPILER} --version OUTPUT_VARIABLE COMPILER_VENDOR)
396         string(SUBSTRING "${COMPILER_VENDOR}" 0 5 VENDOR_NAME) # truncate output
397         if(${VENDOR_NAME} MATCHES "Apple") # Apple does not support OpenMP reliable with gcc and not with clang
398                 set(WITH_OPENMP OFF)
399         else() # vanilla gcc or clang_omp support OpenMP
400                 message(STATUS "Using special OpenMP enabled compiler !") # letting find_package(OpenMP) module work for gcc
401         endif()
402 endif()
403
404 set(EXETYPE MACOSX_BUNDLE)
405
406 set(CMAKE_C_FLAGS_DEBUG "-fno-strict-aliasing -g")
407 set(CMAKE_CXX_FLAGS_DEBUG "-fno-strict-aliasing -g")
408 if(CMAKE_OSX_ARCHITECTURES MATCHES "x86_64" OR CMAKE_OSX_ARCHITECTURES MATCHES "i386")
409         set(CMAKE_CXX_FLAGS_RELEASE "-O2 -mdynamic-no-pic -msse -msse2 -msse3 -mssse3")
410         set(CMAKE_C_FLAGS_RELEASE "-O2 -mdynamic-no-pic  -msse -msse2 -msse3 -mssse3")
411         if(NOT CMAKE_C_COMPILER_ID MATCHES "Clang")
412                 set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -ftree-vectorize  -fvariable-expansion-in-unroller")
413                 set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -ftree-vectorize  -fvariable-expansion-in-unroller")
414         endif()
415 else()
416         set(CMAKE_C_FLAGS_RELEASE "-mdynamic-no-pic -fno-strict-aliasing")
417         set(CMAKE_CXX_FLAGS_RELEASE "-mdynamic-no-pic -fno-strict-aliasing")
418 endif()
419
420 if(${XCODE_VERSION} VERSION_EQUAL 5 OR ${XCODE_VERSION} VERSION_GREATER 5)
421         # Xcode 5 is always using CLANG, which has too low template depth of 128 for libmv
422         set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftemplate-depth=1024")
423 endif()
424 # Get rid of eventually clashes, we export some symbols explicite as local
425 set(PLATFORM_LINKFLAGS
426         "${PLATFORM_LINKFLAGS} -Xlinker -unexported_symbols_list -Xlinker '${CMAKE_SOURCE_DIR}/source/creator/osx_locals.map'"
427 )
428
429 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
430 set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -stdlib=libc++")
431
432 # Suppress ranlib "has no symbols" warnings (workaround for T48250)
433 set(CMAKE_C_ARCHIVE_CREATE   "<CMAKE_AR> Scr <TARGET> <LINK_FLAGS> <OBJECTS>")
434 set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> Scr <TARGET> <LINK_FLAGS> <OBJECTS>")
435 set(CMAKE_C_ARCHIVE_FINISH   "<CMAKE_RANLIB> -no_warning_for_no_symbols -c <TARGET>")
436 set(CMAKE_CXX_ARCHIVE_FINISH "<CMAKE_RANLIB> -no_warning_for_no_symbols -c <TARGET>")