[Kst] branches/work/kst/portto4/kst/cmake

Peter Kümmel syntheticpp at gmx.net
Sun Dec 5 18:40:44 CET 2010


SVN commit 1203923 by kuemmel:

cmake: gcc fixes

 M  +15 -9     modules/KstMacros.cmake  
 M  +2 -2      src/kst/CMakeLists.txt  
 M  +6 -4      src/libkst/CMakeLists.txt  


--- branches/work/kst/portto4/kst/cmake/modules/KstMacros.cmake #1203922:1203923
@@ -4,6 +4,7 @@
 macro(kst_init name)
 	set(kst_name ${name})
 	set(kst_${kst_name}_dont_merge)
+	set(kst_${kst_name}_ignore)
 endmacro()
 
 
@@ -13,13 +14,16 @@
 	file(GLOB _sources_cpp ${_folder}/*.cpp)
 	file(GLOB _headers     ${_folder}/*.h)
 	file(GLOB _ui_files    ${_folder}/*.ui)
+	set(kst_${kst_name}_folder  ${_folder})
+	kst_files_remove(_sources     ${kst_${kst_name}_ignore})
+	kst_files_remove(_sources_cpp ${kst_${kst_name}_ignore})
+	kst_files_remove(_headers     ${kst_${kst_name}_ignore})
 	set(_mocs)
 	qt4_wrap_cpp(_mocs ${_headers} OPTIONS "-nw")
 	set(_uis)
 	qt4_wrap_ui(_uis ${_ui_files})
 	set(kst_${kst_name}_sources ${_sources} ${_sources_cpp} ${_mocs} ${_uis})
 	set(kst_${kst_name}_headers ${_headers})
-	set(kst_${kst_name}_folder  ${_folder})
 	set(kst_${kst_name}_mocs    ${_mocs})
 	set(kst_${kst_name}_ui_files ${_ui_files})
 	set(kst_${kst_name}_uis     ${_uis})
@@ -28,6 +32,7 @@
 	source_group("Generated" FILES ${_mocs} ${_uis})
 endmacro()
 
+
 macro(kst_dont_merge)
 	set(kst_${kst_name}_dont_merge)
 	foreach(_it ${ARGV})
@@ -35,6 +40,7 @@
 	endforeach()
 endmacro()
 
+
 macro(kst_add_library type)
 	include_directories(${kst_${kst_name}_folder} ${CMAKE_CURRENT_BINARY_DIR})
 	string(TOUPPER BUILD_${kst_name} _build_macro)
@@ -89,17 +95,17 @@
 endmacro()
 
 
-macro(kst_files_remove)	
+macro(kst_files_ignore)	
+	set(kst_${kst_name}_ignore ${kst_${kst_name}_ignore} ${ARGV})
+endmacro()
+
+
+macro(kst_files_remove list)	
 	foreach(_item ${ARGN})
 		set(_file ${kst_${kst_name}_folder}/${_item})
-		set(_moc)
-		qt4_wrap_cpp(_moc ${_file}.h)
-		if(kst_${kst_name}_sources)
-			list(REMOVE_ITEM kst_${kst_name}_sources ${_file}.cpp ${_file}.c ${_moc})
+		if(${list})
+			list(REMOVE_ITEM ${list} ${_file}.cpp ${_file}.c ${_file}.h)
 		endif()
-		if(kst_${kst_name}_headers)
-			list(REMOVE_ITEM kst_${kst_name}_headers ${_file}.h)
-		endif()
 	endforeach()
 endmacro()
 
--- branches/work/kst/portto4/kst/cmake/src/kst/CMakeLists.txt #1203922:1203923
@@ -1,9 +1,9 @@
 kst_init(kst)
 
+kst_files_ignore(main-vld)
+
 kst_files_find(src/kst)
 
-kst_files_remove(main-vld)
-
 if(MSVC)
 	set(rc_file ${KST_DIR}/src/kst/kst_icon.rc)
 endif()
--- branches/work/kst/portto4/kst/cmake/src/libkst/CMakeLists.txt #1203922:1203923
@@ -1,12 +1,14 @@
 kst_init(kstcore)
 
-kst_files_find(src/libkst)
+kst_files_ignore(stdinsource timezones)
 
-kst_files_remove(stdinsource timezones)
-
 if(WIN32 OR APPLE )
-	kst_files_remove(sysinfo psversion)
+	kst_files_ignore(sysinfo psversion)
 endif()
 
+kst_files_find(src/libkst)
+
+kst_dont_merge(sysinfo.c psversion.c)
+
 kst_add_library(SHARED)
 


More information about the Kst mailing list