Invalid or corrupt file in CMAKE build

Unable to include a library file in CMAKE build. Facing below issue.


Code :
cmake_minimum_required(VERSION 3.19)

add_library(
cmnbase2
SHARED
IMPORTED
GLOBAL
)

set_property(
TARGET cmnbase2
PROPERTY IMPORTED_IMPLIB “${CMAKE_CURRENT_SOURCE_DIR}/lib/${RAMP_GM_PLATFORM}/libcmnbase2.so”
)

target_include_directories(
cmnbase2
INTERFACE cmn2
)

add_library(
hmitomsq
SHARED
IMPORTED
GLOBAL
)

target_include_directories(
hmitomsq
INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}
INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/cmn2
INTERFACE mq
)

set_property(
TARGET hmitomsq
PROPERTY IMPORTED_IMPLIB ${CMAKE_CURRENT_SOURCE_DIR}/lib/${RAMP_GM_PLATFORM}/libhmitomsq.so
)

add_library(
logger
SHARED
IMPORTED
GLOBAL
)

target_include_directories(
logger
INTERFACE logger
)

set_property(
TARGET logger
PROPERTY IMPORTED_IMPLIB ${CMAKE_CURRENT_SOURCE_DIR}/lib/${RAMP_GM_PLATFORM}/liblogger.so
)

From what I see, you’re trying to link an .so library (Linux dynamic object) to a Windows binary. This obviously cannot work. CMake does not check it for you but the linker simply says it cannot understand the format.