E57Format: for CMake version < 3.11 add_library requires explicit list of source files

This commit is contained in:
wmayer
2021-12-17 11:18:24 +01:00
parent f17c85fc47
commit 47b064e7fd

View File

@@ -100,13 +100,18 @@ option( E57_WRITE_CRAZY_PACKET_MODE "Compile library to enable reader-stressing
set( revision_id "${PROJECT_NAME}-${PROJECT_VERSION}-${${PROJECT_NAME}_BUILD_TAG}" )
message( STATUS "[E57] Revison ID: ${revision_id}" )
# Need to explicitly set the source files to add_library()
if(${CMAKE_VERSION} VERSION_LESS "3.11.0")
file(GLOB E57Format_SOURCES src/[^.]*.cpp)
endif()
# Target
if ( E57_BUILD_SHARED )
message( STATUS "[E57] Building shared library" )
add_library( E57Format SHARED )
add_library( E57Format SHARED ${E57Format_SOURCES})
else()
message( STATUS "[E57] Building static library" )
add_library( E57Format STATIC )
add_library( E57Format STATIC ${E57Format_SOURCES})
endif()
include( E57ExportHeader )