@@ -72,12 +72,12 @@ or library:
72
72
73
73
``` cmake
74
74
add_executable(MyApp
75
- # Sources go here
76
- )
75
+ # Sources go here
76
+ )
77
77
target_link_libraries(MyApp
78
- PRIVATE
79
- projectM::Eval
80
- )
78
+ PRIVATE
79
+ projectM::Eval
80
+ )
81
81
```
82
82
83
83
Important: If your final target is a static library, this will _ not_ copy any code into it! Any application using this
@@ -104,26 +104,26 @@ variant. To link the library as a static library, the CMake code is identical:
104
104
105
105
``` cmake
106
106
add_executable(MyApp
107
- # Sources go here
108
- )
107
+ # Sources go here
108
+ )
109
109
target_link_libraries(MyApp
110
- PRIVATE
111
- projectM::Eval
112
- )
110
+ PRIVATE
111
+ projectM::Eval
112
+ )
113
113
```
114
114
115
115
If the target is a static library, to which the projectM-Eval object files should be added, then an additional line in
116
116
the target source list is required:
117
117
118
118
``` cmake
119
119
add_library(MyLib STATIC
120
- $<TARGET_OBJECTS:projectM::Eval>
121
- # Other sources go here
122
- )
120
+ $<TARGET_OBJECTS:projectM::Eval>
121
+ # Other sources go here
122
+ )
123
123
target_link_libraries(MyApp
124
- PRIVATE
125
- projectM::Eval
126
- )
124
+ PRIVATE
125
+ projectM::Eval
126
+ )
127
127
```
128
128
129
129
Note that the library still needs to be linked. While this won't add any code to the target, it will populate the
@@ -134,6 +134,11 @@ required include directories and compiler flags needed to use the headers.
134
134
If CMake is not an option, the static library can be linked manually and the ` projectm-eval.h ` header file can be copied
135
135
into the project or pointed to via the include directory settings of the build system used.
136
136
137
+ On UNIX operating systems such as Linux, macOS or BSD and if ` ENABLE_PROJECTM_EVAL_INSTALL ` is enabled, a
138
+ ` projectm-eval.pc ` pkg-config file will be installed into the destination library dir and can be used by any
139
+ pkg-config-compatible build system to link the static library (using ` pkg-config --libs projectm-eval ` ) and retrieve the
140
+ correct include dir (using ` pkg-config --cflags projectm-eval ` ).
141
+
137
142
To use it as an object library, please refer to the platform build tools on how to unpack the static library into its
138
143
object files or how to copy its contents into another static library.
139
144
0 commit comments