CMake: Make call to file(GENERATE [..]) work for CMake <3.19

Error from CMake 3.7.2 was:

CMake Error at CMakeLists.txt:482 (file):
  file Incorrect arguments to GENERATE subcommand.
This commit is contained in:
Sebastian Pipping 2021-12-31 20:35:25 +01:00
parent 60bbbe560c
commit 2ed8e19ada
3 changed files with 9 additions and 9 deletions

View File

@ -481,8 +481,7 @@ if(EXPAT_BUILD_PKGCONFIG)
file(GENERATE
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/expat.pc
INPUT ${PROJECT_SOURCE_DIR}/expat.pc.cmake
TARGET expat)
INPUT ${PROJECT_SOURCE_DIR}/expat.pc.cmake)
expat_install(FILES ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/expat.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
endif()

View File

@ -4,6 +4,7 @@ NOTE: We are looking for help with a few things:
Release x.x.x xxx xxxxxxxx xx xxxx
Other changes:
#535 CMake: Make call to file(GENERATE [..]) work for CMake <3.19
#527 #528 Address compiler warnings
Release 2.4.2 Sun December 19 2021

View File

@ -1,11 +1,11 @@
prefix=$<TARGET_PROPERTY:pkgconfig_prefix>
exec_prefix=$<TARGET_PROPERTY:pkgconfig_exec_prefix>
libdir=$<TARGET_PROPERTY:pkgconfig_libdir>
includedir=$<TARGET_PROPERTY:pkgconfig_includedir>
prefix=$<TARGET_PROPERTY:expat,pkgconfig_prefix>
exec_prefix=$<TARGET_PROPERTY:expat,pkgconfig_exec_prefix>
libdir=$<TARGET_PROPERTY:expat,pkgconfig_libdir>
includedir=$<TARGET_PROPERTY:expat,pkgconfig_includedir>
Name: $<TARGET_PROPERTY:pkgconfig_$<LOWER_CASE:$<CONFIG>>_name>
Version: $<TARGET_PROPERTY:pkgconfig_version>
Name: $<TARGET_PROPERTY:expat,pkgconfig_$<LOWER_CASE:$<CONFIG>>_name>
Version: $<TARGET_PROPERTY:expat,pkgconfig_version>
Description: expat XML parser
URL: https://libexpat.github.io/
Libs: -L${libdir} -l$<TARGET_PROPERTY:pkgconfig_$<LOWER_CASE:$<CONFIG>>_name> $<TARGET_PROPERTY:pkgconfig_libm>
Libs: -L${libdir} -l$<TARGET_PROPERTY:expat,pkgconfig_$<LOWER_CASE:$<CONFIG>>_name> $<TARGET_PROPERTY:expat,pkgconfig_libm>
Cflags: -I${includedir}