CMakeLists.txt 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. cmake_minimum_required( VERSION 3.5 )
  8. project( BoostFilesystem )
  9. add_library( boost_filesystem
  10. src/codecvt_error_category.cpp
  11. src/exception.cpp
  12. src/operations.cpp
  13. src/directory.cpp
  14. src/path.cpp
  15. src/path_traits.cpp
  16. src/portability.cpp
  17. src/unique_path.cpp
  18. src/utf8_codecvt_facet.cpp
  19. src/windows_file_codecvt.cpp
  20. )
  21. add_library( Boost::filesystem ALIAS boost_filesystem )
  22. target_include_directories( boost_filesystem PUBLIC include )
  23. target_compile_definitions( boost_filesystem
  24. PUBLIC
  25. # NOTE:
  26. # We deactivate autolinking, because cmake based builds don't need it
  27. # and we don't implement name mangling for the library file anyway.
  28. # Ususally the parent CMakeLists.txt file should already have globally defined BOOST_ALL_NO_LIB
  29. BOOST_FILESYSTEM_NO_LIB
  30. $<$<STREQUAL:$<TARGET_PROPERTY:boost_filesystem,TYPE>,SHARED_LIBRARY>:BOOST_FILESYSTEM_DYN_LINK=1>
  31. $<$<STREQUAL:$<TARGET_PROPERTY:boost_filesystem,TYPE>,STATIC_LIBRARY>:BOOST_FILESYSTEM_STATIC_LINK=1>
  32. PRIVATE
  33. BOOST_FILESYSTEM_SOURCE
  34. )
  35. target_link_libraries( boost_filesystem
  36. PUBLIC
  37. Boost::assert
  38. Boost::config
  39. Boost::container_hash
  40. Boost::core
  41. Boost::detail
  42. Boost::io
  43. Boost::iterator
  44. Boost::smart_ptr
  45. Boost::system
  46. Boost::type_traits
  47. )
  48. target_link_libraries( boost_filesystem
  49. PRIVATE
  50. Boost::winapi
  51. )