Skip to content

Commit 56cbbd2

Browse files
CMake 3.15 doesn't know file(GENERATE TARGET)
1 parent bcfcee5 commit 56cbbd2

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

src/libmongoc/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1287,20 +1287,20 @@ endfunction()
12871287

12881288
# Generate pkg-config for mongoc_shared
12891289
if(TARGET mongoc_shared)
1290+
set(GENERATE_TARGET mongoc_shared)
12901291
_mongoc_configure_and_generate_file(
12911292
src/libmongoc.pc.in
1292-
src/libmongoc-1.0.pc
1293-
TARGET mongoc_shared)
1293+
src/libmongoc-1.0.pc)
12941294
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/src/libmongoc-1.0.pc
12951295
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
12961296
endif()
12971297

12981298
# Now one for mongoc_static:
12991299
if(TARGET mongoc_static)
1300+
set(GENERATE_TARGET mongoc_static)
13001301
_mongoc_configure_and_generate_file(
13011302
src/libmongoc.pc.in
1302-
src/libmongoc-static-1.0.pc
1303-
TARGET mongoc_static)
1303+
src/libmongoc-static-1.0.pc)
13041304
if(MONGOC_ENABLE_STATIC_INSTALL)
13051305
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/src/libmongoc-static-1.0.pc
13061306
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)

src/libmongoc/src/libmongoc.pc.in

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@ exec_prefix=${prefix}
33
libdir=@libdir@
44
includedir=${exec_prefix}/include
55

6-
Name: $<TARGET_PROPERTY:pc_NAME>
7-
Description: $<TARGET_PROPERTY:pc_DESCRIPTION>
8-
Version: $<TARGET_PROPERTY:pc_VERSION>
6+
Name: $<TARGET_PROPERTY:@GENERATE_TARGET@,pc_NAME>
7+
Description: $<TARGET_PROPERTY:@GENERATE_TARGET@,pc_DESCRIPTION>
8+
Version: $<TARGET_PROPERTY:@GENERATE_TARGET@,pc_VERSION>
99

1010
%define $<is-empty: $<STREQUAL:@empty@,
1111
%define $<<not-empty: $<NOT:$<is-empty:
1212

1313
#~ "Requires" dependencies:
1414
%define requires_joiner @newline@~ Requires: ~@space@
15-
%define requires_prop $<TARGET_PROPERTY:pc_REQUIRES>
15+
%define requires_prop $<TARGET_PROPERTY:@GENERATE_TARGET@,pc_REQUIRES>
1616
#~ Conditional: Only expand a first "\nRequires: " if Requires is non-empty:
1717
%define has_requires $<<not-empty:requires_prop>>
1818
~$<has_requires:requires_joiner>
@@ -22,36 +22,36 @@ Version: $<TARGET_PROPERTY:pc_VERSION>
2222
~@newline@~
2323

2424
#~ Link options:
25-
Libs: -L${libdir} -l$<TARGET_PROPERTY:OUTPUT_NAME> ~@space@~
25+
Libs: -L${libdir} -l$<TARGET_PROPERTY:@GENERATE_TARGET@,OUTPUT_NAME> ~@space@~
2626
#~ Join each "Libs" item with spaces. This could be more robust, but it suites our purposes:
27-
%define libs_prop $<TARGET_PROPERTY:pc_LIBS>
27+
%define libs_prop $<TARGET_PROPERTY:@GENERATE_TARGET@,pc_LIBS>
2828
#~ Remove duplicate items, which will usually be redundant link paths:
2929
%define libs $<REMOVE_DUPLICATES:libs_prop>
3030
$<JOIN:libs,@space@>~
3131

3232
#~ Add link options. Don't remove duplicates, because they may be important
33-
%define link_opts $<TARGET_PROPERTY:INTERFACE_LINK_OPTIONS>
33+
%define link_opts $<TARGET_PROPERTY:@GENERATE_TARGET@,INTERFACE_LINK_OPTIONS>
3434
$<$<<not-empty:link_opts>>:@space@$<JOIN:link_opts,@space@>>
3535

3636
~@newline@~
3737

3838
#~ Compile-flags:
39-
%define cflags_prop $<TARGET_PROPERTY:pc_CFLAGS>
39+
%define cflags_prop $<TARGET_PROPERTY:@GENERATE_TARGET@,pc_CFLAGS>
4040
Cflags: $<JOIN:cflags_prop,@space@> ~@space@~
4141

4242
#~ Options:
43-
%define opts_prop $<TARGET_PROPERTY:INTERFACE_COMPILE_OPTIONS>
43+
%define opts_prop $<TARGET_PROPERTY:@GENERATE_TARGET@,INTERFACE_COMPILE_OPTIONS>
4444
%define opts $<REMOVE_DUPLICATES:opts_prop>
4545
$<JOIN:opts,@space@>~
4646

4747
#~ Preprocessor definitions:
48-
%define defs_prop $<TARGET_PROPERTY:INTERFACE_COMPILE_DEFINITIONS>
48+
%define defs_prop $<TARGET_PROPERTY:@GENERATE_TARGET@,INTERFACE_COMPILE_DEFINITIONS>
4949
%define defs $<REMOVE_DUPLICATES:defs_prop>
5050
$<$<<not-empty:defs>>: -D>~
5151
$<JOIN:defs, -D>~
5252

5353
#~ Inclusions:
54-
%define inc_prop $<TARGET_PROPERTY:pc_INCLUDE_DIRECTORIES>
54+
%define inc_prop $<TARGET_PROPERTY:@GENERATE_TARGET@,pc_INCLUDE_DIRECTORIES>
5555
%define incs $<REMOVE_DUPLICATES:inc_prop>
5656
#~ Absolute path includes are kept absolute:
5757
%define abs_includes $<FILTER:incs,INCLUDE,^/>

0 commit comments

Comments
 (0)