Imported Upstream version 1.72.0
[platform/upstream/boost.git] / libs / filesystem / CMakeLists.txt
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
4 #
5 # NOTE: CMake support for Boost.Filesystem is currently experimental at best
6 #       and the interface is likely to change in the future
7
8 cmake_minimum_required( VERSION 3.5 )
9 project( BoostFilesystem )
10
11 add_library( boost_filesystem
12     src/codecvt_error_category.cpp
13     src/exception.cpp
14     src/operations.cpp
15     src/directory.cpp
16     src/path.cpp
17     src/path_traits.cpp
18     src/portability.cpp
19     src/unique_path.cpp
20     src/utf8_codecvt_facet.cpp
21     src/windows_file_codecvt.cpp
22 )
23
24 add_library( Boost::filesystem ALIAS boost_filesystem )
25
26 target_include_directories( boost_filesystem PUBLIC include )
27
28 target_compile_definitions( boost_filesystem
29     PUBLIC
30         # NOTE:
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>
37
38     PRIVATE
39         BOOST_FILESYSTEM_SOURCE
40 )
41
42 target_link_libraries( boost_filesystem
43     PUBLIC
44         Boost::assert
45         Boost::config
46         Boost::container_hash
47         Boost::core
48         Boost::detail
49         Boost::io
50         Boost::iterator
51         Boost::smart_ptr
52         Boost::system
53         Boost::type_traits
54 )
55
56 target_link_libraries( boost_filesystem
57     PRIVATE
58         Boost::winapi
59 )