From 1893b05eedac1b5374f01ce0c5db1e7865fafe52 Mon Sep 17 00:00:00 2001
From: Martin Beseda <martinbeseda@seznam.cz>
Date: Thu, 13 Sep 2018 14:42:08 +0200
Subject: [PATCH] FIX: Trying to fix Exprtk compilation with MSCV

---
 Findexprtk.cmake   |  2 --
 src/CMakeLists.txt | 19 ++++++++++++++++---
 2 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/Findexprtk.cmake b/Findexprtk.cmake
index f23d05cf..4b84c47d 100644
--- a/Findexprtk.cmake
+++ b/Findexprtk.cmake
@@ -46,5 +46,3 @@ ENDIF(EXPRTK_FOUND)
 
 # Advanced options for not cluttering the cmake UIs:
 MARK_AS_ADVANCED(EXPRTK_INCLUDE_DIR)
-
-include_directories(${EXPRTK_INCLUDE_DIRS})
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index e0144312..47e64b15 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -54,10 +54,9 @@ if ("${BUILD_LIB}" STREQUAL "yes")
     )
 
     set(PREFIX "")
-    if(WIN32)
+#    if(WIN32)
 #        set(PREFIX "lib")
-    endif()
-
+#    endif()
 	if(WIN32 AND "${DEPENDENCIES_LINK_TYPE}" STREQUAL "shared")
         message(FATAL_ERROR "Only static linking of external dependencies is supported for Windows systems now!")
     elseif("${DEPENDENCIES_LINK_TYPE}" STREQUAL "static")
@@ -75,5 +74,19 @@ if ("${BUILD_LIB}" STREQUAL "yes")
             ${Boost_INCLUDE_DIRS}
     )
 
+    target_include_directories(
+        ${PREFIX}exprtk
+
+        PRIVATE
+            ${EXPRTK_INCLUDE_DIR}
+    )
+
+    target_compile_definitions(
+        ${PREFIX}exprtk
+
+        PRIVATE
+            _ITERATOR_DEBUG_LEVEL=0
+    )
+
 endif ()
 
-- 
GitLab