build: impertively define output name for static library

When building with an older CMake, the generator expression is not
evaluated properly and embedded into the final output name which is
incorrect.  This should repair the ability to build with an older CMake.
This commit is contained in:
Saleem Abdulrasool 2021-08-13 15:59:26 -07:00 committed by John MacFarlane
parent 15762d7d39
commit 599da32b7e

View File

@ -98,9 +98,15 @@ if (CMARK_STATIC)
cmark_add_compile_options(${STATICLIBRARY})
set_target_properties(${STATICLIBRARY} PROPERTIES
COMPILE_FLAGS -DCMARK_STATIC_DEFINE
OUTPUT_NAME "cmark$<$<BOOL:${MSVC}>:_static>"
POSITION_INDEPENDENT_CODE ON
VERSION ${PROJECT_VERSION})
if(MSVC)
set_target_properties(${STATICLIBRARY} PROPERTIES
OUTPUT_NAME cmark_static)
else()
set_target_properties(${STATICLIBRARY} PROPERTIES
OUTPUT_NAME cmark)
endif()
target_include_directories(${STATICLIBRARY} INTERFACE
$<INSTALL_INTERFACE:include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>