Permalink
Browse files

CMAKE: Fix building on Windows with VS 2015

See https://msdn.microsoft.com/library/bb531344.aspx.

Signed-off-by: Thomas Braun <thomas.braun@byte-physics.de>
  • Loading branch information...
t-b committed Jul 27, 2016
1 parent ff7d28b commit 6b80cc4181dc73a061b049e3283e6e2d8a4e5346
Showing with 9 additions and 0 deletions.
  1. +9 −0 cmake/FindIconv.cmake
@@ -71,6 +71,11 @@ endif()
set(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_DIR})
set(CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARY})
if(MSVC_VERSION GREATER 1800)
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} legacy_stdio_definitions.lib)
endif()
check_cxx_source_compiles(
"#include <iconv.h>
int main() {
@@ -91,6 +96,10 @@ if(ICONV_FOUND)
set(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_DIR})
set(CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARIES})
if(MSVC_VERSION GREATER 1800)
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} legacy_stdio_definitions.lib)
endif()
if (NOT DEFINED ICONV_ACCEPTS_NONCONST_INPUT)
# Display a useful message first time we come through here
message(STATUS "One (and only one) of the ICONV_ACCEPTS_... tests must pass")

0 comments on commit 6b80cc4

Please sign in to comment.