1 # Copyright 2019 Mike Dev
2 # Distributed under the Boost Software License, Version 1.0.
3 # See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt
5 # NOTE: CMake support for Boost.Filesystem is currently experimental at best
6 # and the interface is likely to change in the future
8 cmake_minimum_required( VERSION 3.5 )
9 project( BoostFilesystem )
11 add_library( boost_filesystem
12 src/codecvt_error_category.cpp
20 src/utf8_codecvt_facet.cpp
21 src/windows_file_codecvt.cpp
24 add_library( Boost::filesystem ALIAS boost_filesystem )
26 target_include_directories( boost_filesystem PUBLIC include )
28 target_compile_definitions( boost_filesystem
31 # We deactivate autolinking, because cmake based builds don't need it
32 # and we don't implement name mangling for the library file anyway.
33 # Ususally the parent CMakeLists.txt file should already have globally defined BOOST_ALL_NO_LIB
34 BOOST_FILESYSTEM_NO_LIB
35 $<$<STREQUAL:$<TARGET_PROPERTY:boost_filesystem,TYPE>,SHARED_LIBRARY>:BOOST_FILESYSTEM_DYN_LINK=1>
36 $<$<STREQUAL:$<TARGET_PROPERTY:boost_filesystem,TYPE>,STATIC_LIBRARY>:BOOST_FILESYSTEM_STATIC_LINK=1>
39 BOOST_FILESYSTEM_SOURCE
42 target_link_libraries( boost_filesystem
56 target_link_libraries( boost_filesystem