@@ -19,30 +19,20 @@ write_basic_package_version_file(
19
19
20
20
# Define installation targets
21
21
set (LSLTargets lsl )
22
- if (LSL_BUILD_STATIC )
23
- list (APPEND LSLTargets lslobj lslboost )
24
- endif ()
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
+ FILE_SET HEADERS DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
41
31
)
42
32
43
33
# Generate the LSLConfig.cmake file and mark it for installation
44
34
install (EXPORT LSLTargets
45
- FILE LSLTargets.cmake # TODO: I think we can use this to generate LSLConfig.cmake, no?
35
+ FILE LSLConfig.cmake
46
36
COMPONENT liblsl
47
37
NAMESPACE "LSL::"
48
38
DESTINATION ${CMAKE_INSTALL_LIBDIR} /cmake/LSL
@@ -53,28 +43,10 @@ install(EXPORT LSLTargets
53
43
# INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/lsl)
54
44
# If we use this method, then we need a corresponding install(FILES ...) command to install the generated file.
55
45
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
46
# Install the version file and the helper CMake script.
72
47
install (
73
48
FILES
74
- # TODO: Keep this. But why does the configure_file(... COPYONLY) above exist?
75
49
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
50
${CMAKE_CURRENT_BINARY_DIR} /LSLConfigVersion.cmake
79
51
COMPONENT liblsl
80
52
DESTINATION ${CMAKE_INSTALL_LIBDIR} /cmake/LSL
0 commit comments