@@ -10,7 +10,10 @@ project(boost_dll VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX)
10
10
11
11
option (BOOST_DLL_USE_STD_FS "Use std::filesystem instead of Boost.Filesystem" OFF )
12
12
13
+ # Base library
14
+
13
15
add_library (boost_dll_base INTERFACE )
16
+ add_library (Boost::dll_base ALIAS boost_dll_base)
14
17
target_include_directories (boost_dll_base INTERFACE include )
15
18
target_link_libraries (boost_dll_base
16
19
INTERFACE
@@ -25,35 +28,53 @@ target_link_libraries(boost_dll_base
25
28
${CMAKE_DL_LIBS}
26
29
)
27
30
31
+ # Library with std::filesystem
28
32
29
33
add_library (boost_dll_std_fs INTERFACE )
30
- target_link_libraries (boost_dll_std_fs
31
- INTERFACE
32
- boost_dll_base
33
- )
34
+ add_library (Boost::dll_std_fs ALIAS boost_dll_std_fs)
35
+ target_include_directories (boost_dll_std_fs INTERFACE include )
36
+ target_link_libraries (boost_dll_std_fs INTERFACE Boost::dll_base)
34
37
target_compile_definitions (boost_dll_std_fs INTERFACE BOOST_DLL_USE_STD_FS)
35
38
target_compile_features (boost_dll_std_fs INTERFACE cxx_std_17)
36
39
40
+ # Library with Boost.Filesystem
41
+
37
42
add_library (boost_dll_boost_fs INTERFACE )
43
+ add_library (Boost::dll_boost_fs ALIAS boost_dll_boost_fs)
44
+ target_include_directories (boost_dll_boost_fs INTERFACE include )
38
45
target_link_libraries (boost_dll_boost_fs
39
46
INTERFACE
40
- boost_dll_base
47
+ Boost::dll_base # Internal dependency
41
48
Boost::filesystem
42
49
)
43
50
51
+ # Detault library
44
52
45
53
add_library (boost_dll INTERFACE )
46
- if (BOOST_DLL_USE_STD_FS)
47
- target_link_libraries (boost_dll INTERFACE boost_dll_std_fs)
54
+ add_library (Boost::dll ALIAS boost_dll)
55
+ target_include_directories (boost_dll INTERFACE include )
56
+ if (BOOST_DLL_USE_STD_FS)
57
+ target_link_libraries (boost_dll INTERFACE Boost::dll_std_fs)
48
58
else ()
49
- target_link_libraries (boost_dll INTERFACE boost_dll_boost_fs )
59
+ target_link_libraries (boost_dll INTERFACE Boost::dll_boost_fs )
50
60
endif ()
51
61
52
- add_library (Boost::dll ALIAS boost_dll)
62
+ if (BOOST_SUPERPROJECT_VERSION AND NOT CMAKE_VERSION VERSION_LESS 3.13)
63
+ boost_install(
64
+ TARGETS
65
+ boost_dll
66
+ boost_dll_base
67
+ boost_dll_std_fs
68
+ boost_dll_boost_fs
69
+ VERSION
70
+ "${BOOST_SUPERPROJECT_VERSION} "
71
+ HEADER_DIRECTORY
72
+ include
73
+ )
74
+ endif ()
53
75
54
76
if (BUILD_TESTING AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR} /test/CMakeLists.txt" )
55
77
56
78
add_subdirectory (test )
57
79
58
80
endif ()
59
-
0 commit comments