@@ -18,31 +18,22 @@ write_basic_package_version_file(
18
18
)
19
19
20
20
# Define installation targets
21
- set (LSLTargets lsl )
22
- if (LSL_BUILD_STATIC )
23
- list (APPEND LSLTargets lslobj lslboost )
24
- endif ()
21
+ set (LSLTargets lsl lslobj lslboost )
25
22
26
23
# Install the targets and store configuration information.
27
24
install (TARGETS ${LSLTargets}
28
- EXPORT LSLTargets # generates a CMake package config; TODO: Why the same name as the list of targets?
25
+ EXPORT LSLTargets
29
26
COMPONENT liblsl
30
27
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
31
28
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
32
29
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
33
- INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
34
- # If we use CMake 3.23 FILE_SET, replace INCLUDES line with: FILE_SET HEADERS DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
35
- )
36
-
37
- # TODO: What does this do? Why do we need LSLTargets.cmake in the build dir?
38
- export (EXPORT LSLTargets
39
- FILE "${CMAKE_CURRENT_BINARY_DIR} /LSLTargets.cmake"
40
- NAMESPACE LSL::
30
+ # INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
31
+ FILE_SET HEADERS DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
41
32
)
42
33
43
34
# Generate the LSLConfig.cmake file and mark it for installation
44
35
install (EXPORT LSLTargets
45
- FILE LSLTargets.cmake # TODO: I think we can use this to generate LSLConfig.cmake, no?
36
+ FILE LSLConfig.cmake
46
37
COMPONENT liblsl
47
38
NAMESPACE "LSL::"
48
39
DESTINATION ${CMAKE_INSTALL_LIBDIR} /cmake/LSL
@@ -53,28 +44,10 @@ install(EXPORT LSLTargets
53
44
# INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/lsl)
54
45
# If we use this method, then we need a corresponding install(FILES ...) command to install the generated file.
55
46
56
- # Copy hardcoded CMake files to the build directory.
57
- # TODO: Why bother with this copy? Is it not enough to install (into cmake/LSL)?
58
- configure_file (cmake/LSLCMake.cmake "${CMAKE_CURRENT_BINARY_DIR} /LSLCMake.cmake" COPYONLY )
59
- # TODO: Why bother with this copy? Is it not enough to install (into cmake/LSL)?
60
- # TODO: Why use hardcoded files? We can generate the LSLConfig.cmake.
61
- configure_file (cmake/LSLConfig.cmake "${CMAKE_CURRENT_BINARY_DIR} /LSLConfig.cmake" COPYONLY )
62
-
63
- # Install the public headers.
64
- # TODO: Verify that this is necessary, given that we already installed the INCLUDES above.
65
- # TODO: Verify if it is still necessary to install the headers if we use FILE_SET.
66
- install (DIRECTORY include /
67
- COMPONENT liblsl
68
- DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
69
- )
70
-
71
47
# Install the version file and the helper CMake script.
72
48
install (
73
49
FILES
74
- # TODO: Keep this. But why does the configure_file(... COPYONLY) above exist?
75
50
cmake/LSLCMake.cmake
76
- # TODO: Next line shouldn't be necessary if install(EXPORT...) uses LSLConfig.cmake instead of LSLTargets.cmake
77
- ${CMAKE_CURRENT_BINARY_DIR} /LSLConfig.cmake
78
51
${CMAKE_CURRENT_BINARY_DIR} /LSLConfigVersion.cmake
79
52
COMPONENT liblsl
80
53
DESTINATION ${CMAKE_INSTALL_LIBDIR} /cmake/LSL
0 commit comments