OpenXLSX icon indicating copy to clipboard operation
OpenXLSX copied to clipboard

OPENXLSX_LIBRARY_TYPE check in cmake

Open sauronalexander opened this issue 3 years ago • 3 comments
trafficstars

In CMakeList.txt, we have the following:

if(NOT ${OPENXLSX_LIBRARY_TYPE} STREQUAL "STATIC" AND NOT ${OPENXLSX_LIBRARY_TYPE} STREQUAL "SHARED")
    message( FATAL_ERROR "Invalid library type. Must be SHARED or STATIC." )
endif()

I will rephrase my situation. My CMake fails with this log when adding this project as subdirectory.

CMake Error at third_party/OpenXLSX/OpenXLSX/CMakeLists.txt:118 (message):
  Invalid library type.  Must be SHARED or STATIC.

sauronalexander avatar Sep 15 '22 01:09 sauronalexander

That shouldn't happen at all but are you looking for CMakeLists help?

This part defines default to be "STATIC" so you shouldn't have to change anything in that from the version in the repository: https://github.com/troldal/OpenXLSX/blob/b80da42d1454f361c29117095ebe1989437db390/OpenXLSX/CMakeLists.txt#L34

SimantoR avatar Oct 11 '22 19:10 SimantoR

I also encountered the same problem, is there any solution?

navono avatar Feb 22 '24 03:02 navono

I also encountered the same problem, is there any solution?

check this pr

navono avatar Feb 22 '24 03:02 navono