diff --git a/vtkm/rendering/CMakeLists.txt b/vtkm/rendering/CMakeLists.txt index e115ebaf1..2c80d8cda 100644 --- a/vtkm/rendering/CMakeLists.txt +++ b/vtkm/rendering/CMakeLists.txt @@ -88,7 +88,7 @@ set(sources DecodePNG.cxx EncodePNG.cxx raytracing/Logger.cxx -) + ) # This list of sources has code that uses devices and so might need to be # compiled with a device-specific compiler (like CUDA). @@ -103,7 +103,6 @@ set(device_sources ColorBarAnnotation.cxx ColorLegendAnnotation.cxx ConnectivityProxy.cxx - DecodePNG.cxx LineRenderer.cxx Mapper.cxx MapperConnectivity.cxx diff --git a/vtkm/rendering/Canvas.cxx b/vtkm/rendering/Canvas.cxx index 32045c31c..431c9e64d 100644 --- a/vtkm/rendering/Canvas.cxx +++ b/vtkm/rendering/Canvas.cxx @@ -523,8 +523,7 @@ bool Canvas::LoadFont() const const std::vector& rawPNG = Internals->Font.GetRawImageData(); std::vector rgba; unsigned long textureWidth, textureHeight; - auto error = - vtkm::rendering::DecodePNG(rgba, textureWidth, textureHeight, &rawPNG[0], rawPNG.size()); + auto error = DecodePNG(rgba, textureWidth, textureHeight, &rawPNG[0], rawPNG.size()); if (error != 0) { return false; diff --git a/vtkm/rendering/EncodePNG.cxx b/vtkm/rendering/EncodePNG.cxx index 88ed55d55..b3004e5ed 100644 --- a/vtkm/rendering/EncodePNG.cxx +++ b/vtkm/rendering/EncodePNG.cxx @@ -15,7 +15,7 @@ VTKM_THIRDPARTY_PRE_INCLUDE #include -VTKM_THIRDPARTY_PRE_INCLUDE +VTKM_THIRDPARTY_POST_INCLUDE namespace vtkm { diff --git a/vtkm/rendering/WorldAnnotatorGL.cxx b/vtkm/rendering/WorldAnnotatorGL.cxx index e7ef4259e..0993743cc 100644 --- a/vtkm/rendering/WorldAnnotatorGL.cxx +++ b/vtkm/rendering/WorldAnnotatorGL.cxx @@ -8,13 +8,14 @@ // PURPOSE. See the above copyright notice for more information. //============================================================================ +#include + #include #include #include #include #include #include -#include #include @@ -102,7 +103,7 @@ void WorldAnnotatorGL::RenderText(vtkm::Float32 scale, const std::vector& rawpngdata = this->Font.GetRawImageData(); std::vector rgba; - unsigned width, height; + unsigned long width, height; int error = vtkm::rendering::DecodePNG(rgba, width, height, &rawpngdata[0], rawpngdata.size()); if (error != 0) { diff --git a/vtkm/rendering/testing/CMakeLists.txt b/vtkm/rendering/testing/CMakeLists.txt index 5a2bd7e8c..2ab5d75bd 100644 --- a/vtkm/rendering/testing/CMakeLists.txt +++ b/vtkm/rendering/testing/CMakeLists.txt @@ -27,7 +27,7 @@ set(unit_tests UnitTestScalarRenderer.cxx ) -vtkm_unit_tests(SOURCES ${unit_tests} ALL_BACKENDS LIBRARIES vtkm_rendering vtkm_lodepng) +vtkm_unit_tests(SOURCES ${unit_tests} ALL_BACKENDS LIBRARIES vtkm_rendering) if(VTKm_ENABLE_GL_CONTEXT) # message(STATUS "rendering testing/glfw needs a FindGLFW") diff --git a/vtkm/thirdparty/lodepng/CMakeLists.txt b/vtkm/thirdparty/lodepng/CMakeLists.txt index b19b6be8a..1465202c6 100644 --- a/vtkm/thirdparty/lodepng/CMakeLists.txt +++ b/vtkm/thirdparty/lodepng/CMakeLists.txt @@ -13,8 +13,12 @@ set(headers set(sources vtkmlodepng/lodepng.cpp ) -# vtkm_library(NAME vtkm_lodepng HEADERS ${headers} SOURCES ${sources}) + +# Mark this lib as STATIC for usage in Windows without requiring dll_export +# if a SHARED lib is ever required you will need to generate the export +# headers and add them to the lodepng functions that should be shared add_library(vtkm_lodepng STATIC ${headers} ${sources}) + if(DEFINED VTKm_CUSTOM_LIBRARY_SUFFIX) set(_lib_suffix "${VTKm_CUSTOM_LIBRARY_SUFFIX}") else() @@ -29,14 +33,16 @@ set_target_properties(vtkm_lodepng VERSION 1 SOVERSION 1 ) -vtkm_generate_export_header(vtkm_lodepng) target_include_directories(vtkm_lodepng INTERFACE $ $ ) -install(DIRECTORY vtkmlodepng - DESTINATION "${VTKm_INSTALL_INCLUDE_DIR}/vtkm/thirdparty/lodepng" -) + +if(NOT VTKm_INSTALL_ONLY_LIBRARIES) + install(DIRECTORY vtkmlodepng + DESTINATION "${VTKm_INSTALL_INCLUDE_DIR}/vtkm/thirdparty/lodepng/" + ) +endif() install(TARGETS vtkm_lodepng EXPORT ${VTKm_EXPORT_NAME}