changeset 381:347e4c7a9ba1

make QwtD compile on Windows@
author Eldar Insafutdinov <e.insafutdinov@gmail.com>
date Sun, 11 Jul 2010 01:59:42 +0100
parents beb04f46ef4a
children 1d56b2a2e10c
files CMakeLists.txt build/core.txt build/qwt.txt examples/qwt/simpleplot/build.bat examples/qwt/simpleplot/simple.d generator/main.h
diffstat 6 files changed, 22 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/CMakeLists.txt	Sat Jul 10 22:32:16 2010 +0100
+++ b/CMakeLists.txt	Sun Jul 11 01:59:42 2010 +0100
@@ -104,17 +104,19 @@
 endforeach()
 
 set(QWT_INCLUDE_PATH "/usr/include/qwt-qt4" CACHE STRING "Qwt include path")
-
+if(CMAKE_HOST_WIN32)
+    set(QWT_LIB_PATH "" CACHE STRING "Qwt lib path")
+endif()
 set(inc_paths "")
 
 if(CMAKE_HOST_WIN32)
-    set(sep ";")
+    set(sep "*")
 else()
     set(sep ":")
 endif()
 
 if(BUILD_QT_QWT)
-    set(inc_paths ${inc_paths}${sep}${QWT_INCLUDE_PATH})
+    set(inc_paths ${inc_paths}${sep}${QWT_INCLUDE_PATH}${sep})
 endif()
 
 add_subdirectory(generator)
@@ -169,7 +171,7 @@
 math(EXPR QTD_VERSION "(${QT_VERSION_MAJOR} << 16) + (${QT_VERSION_MINOR} << 8) + ${QT_VERSION_PATCH}")
 
 include_directories(${QT_INCLUDES} ${CMAKE_SOURCE_DIR}/include ${CMAKE_CURRENT_BINARY_DIR}/include)
-if(${BUILD_QT_QWT})
+if(BUILD_QT_QWT)
     include_directories(${QWT_INCLUDE_PATH})
 endif()
 
@@ -494,6 +496,18 @@
         string(TOLOWER ${req} req_lower)
         set(link_cpp ${link_cpp} cpp_${req_lower} ${QT_QT${req_upper}_LIBRARY})
     endforeach()
+
+    if(${package_big} STREQUAL "Qwt" AND CMAKE_HOST_WIN32)
+        set(qwt_release_lib ${QWT_LIB_PATH}/libqwt5.a)
+        set(qwt_debug_lib ${QWT_LIB_PATH}/libqwtd5.a)
+        if(EXISTS ${qwt_release_lib})
+            set(qwt_lib ${qwt_release_lib})
+        elseif(EXISTS ${qwt_debug_lib})
+            set(qwt_lib ${qwt_debug_lib})
+        endif()
+        set(link_cpp ${link_cpp} ${qwt_lib})
+    endif()
+
     target_link_libraries(cpp_${package} ${link_cpp} )
     set(d_objs ${d_objs} ${objects})
 
--- a/build/core.txt	Sat Jul 10 22:32:16 2010 +0100
+++ b/build/core.txt	Sun Jul 11 01:59:42 2010 +0100
@@ -39,7 +39,6 @@
     Array
     ArrayOpsPrimitive
     Atomic
-    Attribute
     Core
     Debug
     Marshal
--- a/build/qwt.txt	Sat Jul 10 22:32:16 2010 +0100
+++ b/build/qwt.txt	Sun Jul 11 01:59:42 2010 +0100
@@ -1,9 +1,9 @@
 set(required Core Gui)
 
 set(classes
+    QwtPlotItem
     QwtPlot
     QwtPlotDict
-    QwtPlotItem
     QwtLegendItemManager
     QwtText
     QwtLegend
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/qwt/simpleplot/build.bat	Sun Jul 11 01:59:42 2010 +0100
@@ -0,0 +1,1 @@
+dmd simple.d qtdcore.lib qtdgui.lib qtdqwt.lib -ofsimple
\ No newline at end of file
--- a/examples/qwt/simpleplot/simple.d	Sat Jul 10 22:32:16 2010 +0100
+++ b/examples/qwt/simpleplot/simple.d	Sun Jul 11 01:59:42 2010 +0100
@@ -16,6 +16,7 @@
 //      A simple example which shows how to use QwtPlot and QwtData
 //-----------------------------------------------------------------
 
+// hack to avoid linker error (undefined symbols), possibly a compiler bug
 real mysin(real arg)
 {
     return sin(arg);
--- a/generator/main.h	Sat Jul 10 22:32:16 2010 +0100
+++ b/generator/main.h	Sun Jul 11 01:59:42 2010 +0100
@@ -73,7 +73,7 @@
         includes << QString(".");
 
 #if defined(Q_OS_WIN32)
-        const char *path_splitter = ";";
+        const char *path_splitter = "*";
 #else
         const char *path_splitter = ":";
 #endif