Browse Source

Add requires to pkgconfig file

Slávek Banko 5 years ago
parent
commit
f22daba70b
2 changed files with 29 additions and 0 deletions
  1. 28
    0
      CMakeLists.txt
  2. 1
    0
      arts.pc.cmake

+ 28
- 0
CMakeLists.txt View File

@@ -226,6 +226,34 @@ configure_file( config.h.cmake config.h @ONLY )
226 226
 
227 227
 ##### write pkgconfig file ######################
228 228
 
229
+set( PC_LIB_REQUIRE "" )
230
+if( WITH_ALSA )
231
+  list( APPEND PC_LIB_REQUIRE "alsa" )
232
+endif( WITH_ALSA )
233
+if( WITH_AUDIOFILE )
234
+  list( APPEND PC_LIB_REQUIRE "audiofile" )
235
+endif( WITH_AUDIOFILE )
236
+if( WITH_VORBIS )
237
+  list( APPEND PC_LIB_REQUIRE "vorbis" )
238
+  list( APPEND PC_LIB_REQUIRE "vorbisfile" )
239
+endif( WITH_VORBIS )
240
+if( WITH_MAD )
241
+  list( APPEND PC_LIB_REQUIRE "mad" )
242
+endif( WITH_MAD )
243
+if( WITH_ESOUND )
244
+  list( APPEND PC_LIB_REQUIRE "esound" )
245
+endif( WITH_ESOUND )
246
+if( WITH_JACK )
247
+  list( APPEND PC_LIB_REQUIRE "jack" )
248
+endif( WITH_JACK )
249
+
250
+list( LENGTH PC_LIB_REQUIRE PC_LIB_REQUIRES_FOUND )
251
+if( PC_LIB_REQUIRES_FOUND GREATER 0 )
252
+  string( REPLACE ";" " " PC_LIB_REQUIRES "Requires: ${PC_LIB_REQUIRE}" )
253
+else( )
254
+  set( PC_LIB_REQUIRES "" )
255
+endif( )
256
+
229 257
 string( REGEX REPLACE "^${CMAKE_INSTALL_PREFIX}" "\${prefix}" PC_EXEC_PREFIX ${EXEC_INSTALL_PREFIX} )
230 258
 string( REGEX REPLACE "^${CMAKE_INSTALL_PREFIX}" "\${prefix}" PC_INCLUDE_DIR ${INCLUDE_INSTALL_DIR} )
231 259
 string( REGEX REPLACE "^${CMAKE_INSTALL_PREFIX}" "\${prefix}" PC_LIB_DIR ${LIB_INSTALL_DIR} )

+ 1
- 0
arts.pc.cmake View File

@@ -8,3 +8,4 @@ Description: Soundserver for the Trinity Desktop Environment (TDE)
8 8
 Version: @ARTS_VERSION@
9 9
 Libs: -L${libdir}
10 10
 Cflags: -I${includedir}
11
+@PC_LIB_REQUIRES@

Loading…
Cancel
Save