Closed aliaksei135 closed 2 years ago
So not sure whether this was CImg
or MSVC fault, but have worked around by just disabling the warnings that trigger the error.
I have copied over CImg.h
into my project extern
folder and added around L134:
#pragma warning( disable : 4611 )
#pragma warning( disable : 4324 )
Then used this version as the system CImg
:
set(WITH_SYSTEM_CIMG ON)
set(CIMG_INCLUDE_DIR "${EXTERN_DIR}/CImg")
target_include_directories(${PROJECT_NAME} PUBLIC ${CIMG_INCLUDE_DIR})
find_package(Matplot++ QUIET)
if(NOT Matplot++_FOUND)
# Put your FetchContent or CPM.cmake script here
FetchContent_Declare(
matplotplusplus
GIT_REPOSITORY https://github.com/alandefreitas/matplotplusplus
GIT_TAG origin/master
)
FetchContent_GetProperties(matplotplusplus)
if(NOT matplotplusplus_POPULATED)
FetchContent_Populate(matplotplusplus)
add_subdirectory(${matplotplusplus_SOURCE_DIR} ${matplotplusplus_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()
target_link_libraries(${PROJECT_NAME} PUBLIC Matplot++::matplot)
endif()
Compiles fine after this.
That's interesting. CImg is linked as a system library, so there should be no compilation errors or warnings.
This needs some debugging.
Bug category
Describe the bug Compile warning treated as error resulting in failure to compile. See below
Steps to Reproduce Including in my CMake project using
FetchContent
as per the following snippetOutput
Platform
Environment Details:
Additional context
CImg
, installed from conan, but this has the same problem.origin/master
latest instead of tagged release, but this gives same error amongst other errors.