1 # Copyright (c) the JPEG XL Project Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style
4 # license that can be found in the LICENSE file.
6 # Ubuntu bionic ships with cmake 3.10.
7 cmake_minimum_required(VERSION 3.10)
8 list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
10 # Honor VISIBILITY_INLINES_HIDDEN on all types of targets.
12 cmake_policy(SET CMP0063 NEW)
14 # Pass CMAKE_EXE_LINKER_FLAGS to CC and CXX compilers when testing if they work.
16 cmake_policy(SET CMP0065 NEW)
19 # Set PIE flags for POSITION_INDEPENDENT_CODE targets, added in 3.14.
21 cmake_policy(SET CMP0083 NEW)
24 project(LIBJXL LANGUAGES C CXX)
26 include(CheckCXXSourceCompiles)
27 check_cxx_source_compiles(
29 #if !defined(__EMSCRIPTEN__)
30 static_assert(false, \"__EMSCRIPTEN__ is not defined\");
37 message(STATUS "CMAKE_SYSTEM_PROCESSOR is ${CMAKE_SYSTEM_PROCESSOR}")
38 include(CheckCXXCompilerFlag)
39 check_cxx_compiler_flag("-fsanitize=fuzzer-no-link" CXX_FUZZERS_SUPPORTED)
40 check_cxx_compiler_flag("-Xclang -mconstructor-aliases" CXX_CONSTRUCTOR_ALIASES_SUPPORTED)
41 check_cxx_compiler_flag("-fmacro-prefix-map=OLD=NEW" CXX_MACRO_PREFIX_MAP)
42 check_cxx_compiler_flag("-fno-rtti" CXX_NO_RTTI_SUPPORTED)
44 # Enabled PIE binaries by default if supported.
45 include(CheckPIESupported OPTIONAL RESULT_VARIABLE CHECK_PIE_SUPPORTED)
46 if(CHECK_PIE_SUPPORTED)
47 check_pie_supported(LANGUAGES CXX)
48 if(CMAKE_CXX_LINK_PIE_SUPPORTED)
49 set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
53 if(PROVISION_DEPENDENCIES)
54 # Run script to provision dependencies.
55 find_program (BASH_PROGRAM bash)
58 COMMAND ${BASH_PROGRAM} ${CMAKE_CURRENT_SOURCE_DIR}/deps.sh
59 RESULT_VARIABLE PROVISION_DEPENDENCIES_RESULT)
61 if(NOT PROVISION_DEPENDENCIES_RESULT EQUAL "0")
62 message(FATAL_ERROR "${CMAKE_CURRENT_SOURCE_DIR}/deps.sh failed with ${PROVISION_DEPENDENCIES_RESULT}")
66 ### Project build options:
67 if(CXX_FUZZERS_SUPPORTED)
68 # Enabled by default except on arm64, Windows and Apple builds.
69 set(ENABLE_FUZZERS_DEFAULT true)
71 find_package(PkgConfig)
72 if(NOT APPLE AND NOT WIN32 AND NOT HAIKU AND CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64")
73 pkg_check_modules(TCMallocMinimalVersionCheck QUIET IMPORTED_TARGET
75 if(TCMallocMinimalVersionCheck_FOUND AND
76 NOT TCMallocMinimalVersionCheck_VERSION VERSION_EQUAL 2.8.0)
77 # Enabled by default except on Windows and Apple builds for
78 # tcmalloc != 2.8.0. tcmalloc 2.8.1 already has a fix for this issue.
79 set(ENABLE_TCMALLOC_DEFAULT true)
82 "tcmalloc version ${TCMallocMinimalVersionCheck_VERSION} -- "
83 "tcmalloc 2.8.0 disabled due to "
84 "https://github.com/gperftools/gperftools/issues/1204")
88 check_cxx_source_compiles(
90 #if !defined(HWY_DISABLED_TARGETS)
91 static_assert(false, \"HWY_DISABLED_TARGETS is not defined\");
95 JXL_HWY_DISABLED_TARGETS_FORCED
98 set(WARNINGS_AS_ERRORS_DEFAULT false)
100 if((SANITIZER STREQUAL "msan") OR JPEGXL_EMSCRIPTEN)
101 set(BUNDLE_LIBPNG_DEFAULT YES)
103 set(BUNDLE_LIBPNG_DEFAULT NO)
106 # Standard cmake naming for building shared libraries.
107 get_property(SHARED_LIBS_SUPPORTED GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS)
108 option(BUILD_SHARED_LIBS "Build shared libraries instead of static ones" ${SHARED_LIBS_SUPPORTED})
110 set(JPEGXL_ENABLE_FUZZERS ${ENABLE_FUZZERS_DEFAULT} CACHE BOOL
111 "Build JPEGXL fuzzer targets.")
112 set(JPEGXL_ENABLE_DEVTOOLS false CACHE BOOL
113 "Build JPEGXL developer tools.")
114 set(JPEGXL_ENABLE_TOOLS true CACHE BOOL
115 "Build JPEGXL user tools: cjxl and djxl.")
116 set(JPEGXL_ENABLE_JPEGLI true CACHE BOOL
117 "Build jpegli library.")
118 set(JPEGXL_ENABLE_JPEGLI_LIBJPEG true CACHE BOOL
119 "Build libjpeg.so shared library based on jpegli.")
120 set(JPEGXL_INSTALL_JPEGLI_LIBJPEG false CACHE BOOL
121 "Install jpegli version of libjpeg.so system-wide.")
122 set(JPEGLI_LIBJPEG_LIBRARY_VERSION "62.3.0" CACHE STRING
123 "Library version of the libjpeg.so shared library that we build.")
124 set(JPEGLI_LIBJPEG_LIBRARY_SOVERSION "62" CACHE STRING
125 "Library so-version of the libjpeg.so shared library that we build.")
126 set(JPEGXL_ENABLE_DOXYGEN true CACHE BOOL
127 "Generate C API documentation using Doxygen.")
128 set(JPEGXL_ENABLE_MANPAGES true CACHE BOOL
129 "Build and install man pages for the command-line tools.")
130 set(JPEGXL_ENABLE_BENCHMARK true CACHE BOOL
131 "Build JPEGXL benchmark tools.")
132 set(JPEGXL_ENABLE_EXAMPLES true CACHE BOOL
133 "Build JPEGXL library usage examples.")
134 set(JPEGXL_BUNDLE_LIBPNG ${BUNDLE_LIBPNG_DEFAULT} CACHE BOOL
135 "Build libpng from source and link it statically.")
136 set(JPEGXL_ENABLE_JNI true CACHE BOOL
137 "Build JPEGXL JNI Java wrapper, if Java dependencies are installed.")
138 set(JPEGXL_ENABLE_SJPEG true CACHE BOOL
139 "Build JPEGXL with support for encoding with sjpeg.")
140 set(JPEGXL_ENABLE_OPENEXR true CACHE BOOL
141 "Build JPEGXL with support for OpenEXR if available.")
142 set(JPEGXL_ENABLE_SKCMS true CACHE BOOL
143 "Build with skcms instead of lcms2.")
144 set(JPEGXL_BUNDLE_SKCMS true CACHE BOOL
145 "When building with skcms, bundle it into libjxl.a.")
146 set(JPEGXL_ENABLE_VIEWERS false CACHE BOOL
147 "Build JPEGXL viewer tools for evaluation.")
148 set(JPEGXL_ENABLE_TCMALLOC ${ENABLE_TCMALLOC_DEFAULT} CACHE BOOL
149 "Build JPEGXL using gperftools (tcmalloc) allocator.")
150 set(JPEGXL_ENABLE_PLUGINS false CACHE BOOL
151 "Build third-party plugins to support JPEG XL in other applications.")
152 set(JPEGXL_ENABLE_COVERAGE false CACHE BOOL
153 "Enable code coverage tracking for libjxl. This also enables debug and disables optimizations.")
154 set(JPEGXL_ENABLE_SIZELESS_VECTORS false CACHE BOOL
155 "Builds in support for SVE/RVV vectorization")
156 set(JPEGXL_ENABLE_TRANSCODE_JPEG true CACHE BOOL
157 "Builds in support for decoding transcoded JXL files back to JPEG,\
158 disabling it makes the decoder reject JXL_DEC_JPEG_RECONSTRUCTION events,\
160 set(JPEGXL_ENABLE_BOXES true CACHE BOOL
161 "Builds in support for decoding boxes in JXL files,\
162 disabling it makes the decoder reject JXL_DEC_BOX events,\
164 set(JPEGXL_STATIC false CACHE BOOL
165 "Build tools as static binaries.")
166 set(JPEGXL_WARNINGS_AS_ERRORS ${WARNINGS_AS_ERRORS_DEFAULT} CACHE BOOL
167 "Treat warnings as errors during compilation.")
168 set(JPEGXL_DEP_LICENSE_DIR "" CACHE STRING
169 "Directory where to search for system dependencies \"copyright\" files.")
170 set(JPEGXL_FORCE_NEON false CACHE BOOL
171 "Set flags to enable NEON in arm if not enabled by your toolchain.")
172 set(JPEGXL_TEST_TOOLS false CACHE BOOL
173 "Run scripts that test the encoding / decoding tools.")
175 # Force system dependencies.
176 set(JPEGXL_FORCE_SYSTEM_BROTLI false CACHE BOOL
177 "Force using system installed brotli instead of third_party/brotli source.")
178 set(JPEGXL_FORCE_SYSTEM_GTEST false CACHE BOOL
179 "Force using system installed googletest (gtest/gmock) instead of third_party/googletest source.")
180 set(JPEGXL_FORCE_SYSTEM_LCMS2 false CACHE BOOL
181 "Force using system installed lcms2 instead of third_party/lcms source.")
182 set(JPEGXL_FORCE_SYSTEM_HWY false CACHE BOOL
183 "Force using system installed highway (libhwy-dev) instead of third_party/highway source.")
185 # Check minimum compiler versions. Older compilers are not supported and fail
186 # with hard to understand errors.
187 if (NOT CMAKE_C_COMPILER_ID STREQUAL CMAKE_CXX_COMPILER_ID)
188 message(FATAL_ERROR "Different C/C++ compilers set: "
189 "${CMAKE_C_COMPILER_ID} vs ${CMAKE_CXX_COMPILER_ID}")
191 if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
192 # Android NDK's toolchain.cmake fakes the clang version in
193 # CMAKE_CXX_COMPILER_VERSION with an incorrect number, so ignore this.
194 if (NOT CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION MATCHES "clang"
195 AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5)
197 "Minimum Clang version required is Clang 5, please update.")
199 elseif (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
200 if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7)
202 "Minimum GCC version required is 7, please update.")
207 "Compiled IDs C:${CMAKE_C_COMPILER_ID}, C++:${CMAKE_CXX_COMPILER_ID}")
209 # CMAKE_EXPORT_COMPILE_COMMANDS is used to generate the compilation database
210 # used by clang-tidy.
211 set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
214 set(BUILD_SHARED_LIBS 0)
215 # Clang developers say that in case to use "static" we have to build stdlib
216 # ourselves; for real use case we don't care about stdlib, as it is "granted",
217 # so just linking all other libraries is fine.
218 if (NOT MSVC AND NOT APPLE)
219 set(CMAKE_FIND_LIBRARY_SUFFIXES .a)
220 set(CMAKE_EXE_LINKER_FLAGS
221 "${CMAKE_EXE_LINKER_FLAGS} -static -static-libgcc -static-libstdc++")
223 endif() # JPEGXL_STATIC
226 set(THREADS_PREFER_PTHREAD_FLAG YES)
227 find_package(Threads REQUIRED)
229 # These settings are important to drive check_cxx_source_compiles
230 # See CMP0067 (min cmake version is 3.10 anyway)
231 set(CMAKE_CXX_STANDARD 11)
232 set(CMAKE_CXX_EXTENSIONS OFF)
233 set(CMAKE_CXX_STANDARD_REQUIRED YES)
236 find_package(Atomics REQUIRED)
240 # In MINGW libstdc++ uses pthreads directly. When building statically a
241 # program (regardless of whether the source code uses pthread or not) the
242 # toolchain will add stdc++ and pthread to the linking step but stdc++ will
243 # be linked statically while pthread will be linked dynamically.
244 # To avoid this and have pthread statically linked with need to pass it in
245 # the command line with "-Wl,-Bstatic -lpthread -Wl,-Bdynamic" but the
246 # linker will discard it if not used by anything else up to that point in
247 # the linker command line. If the program or any dependency don't use
248 # pthread directly -lpthread is discarded and libstdc++ (added by the
249 # toolchain later) will then use the dynamic version. For this we also need
250 # to pass -lstdc++ explicitly before -lpthread. For pure C programs -lstdc++
251 # will be discarded anyway.
252 # This adds these flags as dependencies for *all* targets. Adding this to
253 # CMAKE_EXE_LINKER_FLAGS instead would cause them to be included before any
254 # object files and therefore discarded. This should be set in the
255 # INTERFACE_LINK_LIBRARIES of Threads::Threads but some third_part targets
256 # don't depend on it.
257 link_libraries(-Wl,-Bstatic -lstdc++ -lpthread -Wl,-Bdynamic)
258 elseif(CMAKE_USE_PTHREADS_INIT)
259 # "whole-archive" is not supported on OSX.
261 # Set pthreads as a whole-archive, otherwise weak symbols in the static
262 # libraries will discard pthreads symbols leading to segmentation fault at
264 message(STATUS "Using -lpthread as --whole-archive")
265 set_target_properties(Threads::Threads PROPERTIES
266 INTERFACE_LINK_LIBRARIES
267 "-Wl,--whole-archive;-lpthread;-Wl,--no-whole-archive")
270 endif() # JPEGXL_STATIC
272 if (JPEGXL_EMSCRIPTEN)
273 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pthread")
274 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
275 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread")
278 if (CXX_MACRO_PREFIX_MAP)
279 add_compile_options(-fmacro-prefix-map=${CMAKE_CURRENT_SOURCE_DIR}=.)
282 if (CXX_NO_RTTI_SUPPORTED)
283 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti")
286 # Internal flags for coverage builds:
287 set(JPEGXL_COVERAGE_FLAGS)
288 set(JPEGXL_COVERAGE_LINK_FLAGS)
291 # TODO(janwas): add flags
292 add_definitions(-D_CRT_SECURE_NO_WARNINGS)
294 # Global compiler flags for all targets here and in subdirectories.
296 # Avoid changing the binary based on the current time and date.
297 -D__DATE__="redacted"
298 -D__TIMESTAMP__="redacted"
299 -D__TIME__="redacted"
302 # TODO(eustas): JXL currently compiles, but does not pass tests...
303 if (NOT JXL_HWY_DISABLED_TARGETS_FORCED AND NOT JPEGXL_ENABLE_SIZELESS_VECTORS)
304 add_definitions(-DHWY_DISABLED_TARGETS=\(HWY_SVE|HWY_SVE2|HWY_SVE_256|HWY_SVE2_128|HWY_RVV\))
305 message("Warning: HWY_SVE, HWY_SVE2, HWY_SVE_256, HWY_SVE2_128 and HWY_RVV CPU targets are disabled")
308 # In CMake before 3.12 it is problematic to pass repeated flags like -Xclang.
309 # For this reason we place them in CMAKE_CXX_FLAGS instead.
310 # See https://gitlab.kitware.com/cmake/cmake/issues/15826
313 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -funwind-tables")
314 if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
315 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Xclang -mrelax-all")
317 if (CXX_CONSTRUCTOR_ALIASES_SUPPORTED)
318 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Xclang -mconstructor-aliases")
322 # Not supported by clang-cl, but frame pointers are default on Windows
324 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-omit-frame-pointer")
327 # CPU flags - remove once we have NEON dynamic dispatch
329 # TODO(janwas): this also matches M1, but only ARMv7 is intended/needed.
330 if(CMAKE_SYSTEM_PROCESSOR MATCHES "arm")
331 if(JPEGXL_FORCE_NEON)
332 # GCC requires these flags, otherwise __ARM_NEON is undefined.
333 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \
334 -mfpu=neon-vfpv4 -mfloat-abi=hard")
338 # Force build with optimizations in release mode.
339 set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2")
342 # Ignore this to allow redefining __DATE__ and others.
343 -Wno-builtin-macro-redefined
345 # Global warning settings.
349 if (JPEGXL_WARNINGS_AS_ERRORS)
350 add_compile_options(-Werror)
353 if(JPEGXL_ENABLE_COVERAGE)
354 set(JPEGXL_COVERAGE_FLAGS
355 -g -O0 -fprofile-arcs -ftest-coverage
356 -DJXL_ENABLE_ASSERT=0 -DJXL_ENABLE_CHECK=0
358 set(JPEGXL_COVERAGE_LINK_FLAGS
361 endif() # JPEGXL_ENABLE_COVERAGE
364 include(GNUInstallDirs)
366 # Separately build/configure testing frameworks and other third_party libraries
367 # to allow disabling tests in those libraries.
368 include(third_party/testing.cmake)
369 add_subdirectory(third_party)
370 # Copy the JXL license file to the output build directory.
371 configure_file("${CMAKE_CURRENT_SOURCE_DIR}/LICENSE"
372 ${PROJECT_BINARY_DIR}/LICENSE.jpeg-xl COPYONLY)
374 # Enable tests regardless of where they are defined.
377 # Specify default location of `testdata`:
378 if(NOT DEFINED JPEGXL_TEST_DATA_PATH)
379 set(JPEGXL_TEST_DATA_PATH "${PROJECT_SOURCE_DIR}/testdata")
383 add_subdirectory(lib)
386 # Script to run tests over the source code in bash.
387 find_program (BASH_PROGRAM bash)
391 COMMAND ${BASH_PROGRAM} ${CMAKE_CURRENT_SOURCE_DIR}/bash_test.sh)
393 endif() # BUILD_TESTING
395 # Documentation generated by Doxygen
396 if(JPEGXL_ENABLE_DOXYGEN)
397 find_package(Doxygen)
399 set(DOXYGEN_GENERATE_HTML "YES")
400 set(DOXYGEN_GENERATE_XML "YES")
401 set(DOXYGEN_STRIP_FROM_PATH "${CMAKE_CURRENT_SOURCE_DIR}/lib/include")
402 set(DOXYGEN_USE_MDFILE_AS_MAINPAGE "README.md")
403 if(JPEGXL_WARNINGS_AS_ERRORS)
404 set(DOXYGEN_WARN_AS_ERROR "YES")
406 set(DOXYGEN_QUIET "YES")
408 "${CMAKE_CURRENT_SOURCE_DIR}/lib/include"
409 "${CMAKE_CURRENT_SOURCE_DIR}/doc/api.txt"
410 WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
411 COMMENT "Generating C API documentation")
413 # Add sphinx doc build step for readthedocs.io (requires doxygen too).
414 find_program(SPHINX_BUILD_PROGRAM sphinx-build)
415 if(SPHINX_BUILD_PROGRAM)
417 OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/rtd/nonexistent"
418 COMMENT "Generating readthedocs.io output on ${CMAKE_CURRENT_BINARY_DIR}/rtd"
419 COMMAND ${SPHINX_BUILD_PROGRAM} -q -W -b html -j auto
420 ${CMAKE_SOURCE_DIR}/doc/sphinx
421 ${CMAKE_CURRENT_BINARY_DIR}/rtd
424 # This command runs the documentation generation every time since the output
425 # target file doesn't exist.
426 add_custom_target(rtd-html
427 DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/rtd/nonexistent
429 else() # SPHINX_BUILD_PROGRAM\
430 message(WARNING "sphinx-build not found, skipping rtd documentation")
431 endif() # SPHINX_BUILD_PROGRAM
434 # Create a "doc" target for compatibility since "doc" is not otherwise added to
435 # the build when doxygen is not installed.
436 add_custom_target(doc false
437 COMMENT "Error: Can't generate doc since Doxygen not installed.")
438 endif() # DOXYGEN_FOUND
439 endif() # JPEGXL_ENABLE_DOXYGEN
441 if(JPEGXL_ENABLE_MANPAGES)
442 find_program(ASCIIDOC a2x)
444 file(STRINGS "${ASCIIDOC}" ASCIIDOC_SHEBANG LIMIT_COUNT 1)
445 if(ASCIIDOC_SHEBANG MATCHES "/sh|/bash" OR MINGW)
446 set(ASCIIDOC_PY_FOUND ON)
447 # Run the program directly and set ASCIIDOC as empty.
448 set(ASCIIDOC_PY "${ASCIIDOC}")
450 elseif(ASCIIDOC_SHEBANG MATCHES "python2")
451 find_package(Python2 COMPONENTS Interpreter)
452 set(ASCIIDOC_PY_FOUND "${Python2_Interpreter_FOUND}")
453 set(ASCIIDOC_PY Python2::Interpreter)
454 elseif(ASCIIDOC_SHEBANG MATCHES "python3")
455 find_package(Python3 COMPONENTS Interpreter)
456 set(ASCIIDOC_PY_FOUND "${Python3_Interpreter_FOUND}")
457 set(ASCIIDOC_PY Python3::Interpreter)
459 find_package(Python COMPONENTS Interpreter QUIET)
460 if(NOT Python_Interpreter_FOUND)
461 find_program(ASCIIDOC_PY python)
463 set(ASCIIDOC_PY_FOUND ON)
466 set(ASCIIDOC_PY_FOUND "${Python_Interpreter_FOUND}")
467 set(ASCIIDOC_PY Python::Interpreter)
471 if (ASCIIDOC_PY_FOUND)
472 set(MANPAGE_FILES "")
474 foreach(PAGE IN ITEMS cjxl djxl)
475 # Invoking the Python interpreter ourselves instead of running the a2x binary
476 # directly is necessary on MSYS2, otherwise it is run through cmd.exe which
477 # does not recognize it.
480 COMMAND "${ASCIIDOC_PY}"
482 --format manpage --destination-dir="${CMAKE_CURRENT_BINARY_DIR}"
483 "${CMAKE_CURRENT_SOURCE_DIR}/doc/man/${PAGE}.txt"
484 MAIN_DEPENDENCY "${CMAKE_CURRENT_SOURCE_DIR}/doc/man/${PAGE}.txt")
485 list(APPEND MANPAGE_FILES "${CMAKE_CURRENT_BINARY_DIR}/${PAGE}.1")
486 list(APPEND MANPAGES "${PAGE}.1")
488 add_custom_target(manpages ALL DEPENDS ${MANPAGES})
489 install(FILES ${MANPAGE_FILES} DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
490 endif() # ASCIIDOC_PY_FOUND
492 message(WARNING "asciidoc was not found, the man pages will not be installed.")
494 endif() # JPEGXL_ENABLE_MANPAGES
496 # Example usage code.
497 if (JPEGXL_ENABLE_EXAMPLES)
498 include(examples/examples.cmake)
501 # Plugins for third-party software
502 if (JPEGXL_ENABLE_PLUGINS)
503 add_subdirectory(plugins)
507 add_subdirectory(tools)