diff generator/CMakeLists.txt @ 378:7341c47790d4

binding of qwt
author Eldar Insafutdinov
date Sat, 10 Jul 2010 21:54:44 +0100
parents b460cd08041f
children d2f48c4cb3e3
line wrap: on
line diff
--- a/generator/CMakeLists.txt	Fri Jul 09 20:24:24 2010 +0100
+++ b/generator/CMakeLists.txt	Sat Jul 10 21:54:44 2010 +0100
@@ -140,7 +140,7 @@
 )
 
 ## Includes path.
-set(inc_paths
+set(inc_paths_for_build
     ${CMAKE_CURRENT_SOURCE_DIR}/../common 
     ${CMAKE_CURRENT_SOURCE_DIR}/parser
     ${CMAKE_CURRENT_SOURCE_DIR}
@@ -158,8 +158,8 @@
 
 include(${QT_USE_FILE} ${CMAKE_CURRENT_SOURCE_DIR}) 
 
-set(inc_paths
-    ${inc_paths}
+set(inc_paths_for_build
+    ${inc_paths_for_build}
     ${QT_INCLUDES} 
 )
 set(lib_paths
@@ -176,7 +176,7 @@
 set (all_srcs 
     ${srcs} ${moc_srcs} 
     ${res_wrapped_files}) 
-include_directories(${inc_paths})
+include_directories(${inc_paths_for_build})
 add_executable(generator ${all_srcs} )
 target_link_libraries(generator ${libs})
 
@@ -201,17 +201,23 @@
     file(REMOVE ${jambi_inc})
     file(APPEND ${dgen_build_conf} "<typesystem>\n")
     foreach(package_normal ${packages})
-	string(TOLOWER ${package_normal} package) 
-	string(TOUPPER ${package_normal} package_upper) 
-	file(APPEND ${dgen_build_conf} "	<load-typesystem name=\"typesystem_${package}.xml\" generate=\"yes\" />\n")
-	file(APPEND ${jambi_inc} "#include <${QT_QT${package_upper}_INCLUDE_DIR}/Qt${package_normal}>\n")
-    endforeach(package_normal ${packages})
+    	string(TOLOWER ${package_normal} package) 
+    	string(TOUPPER ${package_normal} package_upper) 
+    	file(APPEND ${dgen_build_conf} "	<load-typesystem name=\"typesystem_${package}.xml\" generate=\"yes\" />\n")
+    	# only append include if we have QT_QT${MODULE}_INCLUDE_DIR defined, otherwise handle customly
+    	if(NOT ${QT_QT${package_upper}_INCLUDE_DIR} STREQUAL "")
+        	file(APPEND ${jambi_inc} "#include <${QT_QT${package_upper}_INCLUDE_DIR}/Qt${package_normal}>\n")
+        endif()
+    endforeach()
     file(APPEND ${dgen_build_conf} "</typesystem>\n")
     set(packages_in_build_txt ${packages} CACHE INTERNAL "")
-endif(	NOT "${packages_in_build_txt}" STREQUAL "${packages}" 
-	OR NOT EXISTS ${dgen_build_conf}
-	OR NOT EXISTS ${jambi_inc})
-
+    # merge include file for Qwt
+    if(BUILD_QT_QWT)
+        file(READ "${CMAKE_SOURCE_DIR}/include/qwt_masterinclude.h" jambi_inc_qwt)
+        file(APPEND ${jambi_inc} ${jambi_inc_qwt})
+    endif()
+endif()
+    
 set(gen_sources)
 foreach(package_normal ${packages})
     string(TOLOWER ${package_normal} package)   
@@ -219,25 +225,22 @@
     set(d_inc_file_found d_inc_file_found-NOTFOUND) 
     find_file(d_inc_file_found typesystem_${package}-java.java PATHS ${CMAKE_CURRENT_SOURCE_DIR}/) 
     if(d_inc_file_found)
-	set(gen_sources ${gen_sources} ${d_inc_file_found})
-    endif(d_inc_file_found)
-endforeach(package_normal ${packages})
+	    set(gen_sources ${gen_sources} ${d_inc_file_found})
+    endif()
+endforeach()
 mark_as_advanced(d_inc_file_found)
 set(d_inc_file_found 1)
 	
-if(CMAKE_HOST_WIN32)
-    set(sep ";")
-else(CMAKE_HOST_WIN32)
-    set(sep ":")
-endif(CMAKE_HOST_WIN32)
 foreach(path ${QT_INCLUDES})
-    set(inc_paths ${path}${sep})
-endforeach(path ${QT_INCLUDES})
+    set(inc_paths_tmp ${path}${sep})
+endforeach()
+set(inc_paths ${inc_paths}${sep}${inc_paths_tmp})
+
 if(${CMAKE_BINARY_DIR} STREQUAL ${CMAKE_SOURCE_DIR})
     set(out_dir ${CMAKE_SOURCE_DIR})
-else(${CMAKE_BINARY_DIR} STREQUAL ${CMAKE_SOURCE_DIR})
+else()
     set(out_dir ${CMAKE_BINARY_DIR}/build)
-endif(${CMAKE_BINARY_DIR} STREQUAL ${CMAKE_SOURCE_DIR})
+endif()
 set(dgen_impl ${out_dir}/cpp/qt_core/ArrayOps_shell.cpp)
 add_custom_command(OUTPUT ${dgen_impl}
 	COMMAND ${CMAKE_COMMAND} -E remove -f ${dgen_impl}