[Kst] branches/work/kst/portto4/kst/cmake
Peter Kümmel
syntheticpp at gmx.net
Fri Jan 7 12:48:13 CET 2011
SVN commit 1212541 by kuemmel:
cmake: add non-C++ files (info, cmake's) to project so editing these becomes simpler
M +6 -0 CMakeLists.txt
M +22 -2 modules/KstMacros.cmake
M +10 -2 src/kst/CMakeLists.txt
--- branches/work/kst/portto4/kst/cmake/CMakeLists.txt #1212540:1212541
@@ -12,11 +12,17 @@
kst_option(merge_rebuild "Rebuild generated files from merged files build" OFF all)
message(STATUS "")
+
find_package(Qt4 REQUIRED)
include(${QT_USE_FILE})
+
+message(STATUS "")
+message(STATUS "3rd party libs for plugins:")
+message(STATUS "")
find_package(Getdata)
find_package(Gsl)
find_package(Netcdf)
+message(STATUS "")
set(KST_VERSION 2.0.3)
--- branches/work/kst/portto4/kst/cmake/modules/KstMacros.cmake #1212540:1212541
@@ -5,6 +5,7 @@
set(kst_name ${name})
set(kst_${kst_name}_dont_merge)
set(kst_${kst_name}_ignore)
+ set(kst_${kst_name}_info_files)
endmacro()
@@ -138,8 +139,27 @@
if(_msg)
string(SUBSTRING "kst_${_name} " 0 25 _var)
string(SUBSTRING "${kst_${_name}} " 0 4 _val)
- message(STATUS "${_var}: ${_val} (${_description})")
+ message(STATUS "${_var}= ${_val} : ${_description}")
endif()
endmacro()
-
\ No newline at end of file
+
+macro(kst_add_info_files group)
+ foreach(_it ${ARGN})
+ if(NOT IS_DIRECTORY ${_it})
+ get_filename_component(name ${_it} NAME)
+ if(NOT ${_it} MATCHES "^/\\\\..*$;~$")
+ set_source_files_properties(${_it} PROPERTIES HEADER_FILE_ONLY TRUE)
+ set(kst_${group}_info_files ${kst_${group}_info_files} ${_it})
+ endif()
+ endif()
+ endforeach()
+ source_group(${group} FILES ${kst_${group}_info_files})
+ set(kst_${kst_name}_info_files ${kst_${kst_name}_info_files} ${kst_${group}_info_files})
+endmacro()
+
+macro(kst_find_info_files group files)
+ file(GLOB _filelist ${files})
+ kst_add_info_files(${group} ${_filelist})
+endmacro()
+
--- branches/work/kst/portto4/kst/cmake/src/kst/CMakeLists.txt #1212540:1212541
@@ -12,6 +12,14 @@
kst_include_directories(kstapp)
-add_executable(kst ${kst_kst_sources} ${rc_file})
+kst_find_info_files(KstCMakeFiles ${KST_DIR}/cmake/*)
+kst_find_info_files(KstCMakeFiles ${KST_DIR}/cmake/modules/*)
-kst_link(kstcore kstmath kstapp kstwidgets ${QT_QTOPENGL_LIBRARY} ${QT_QTSVG_LIBRARY})
\ No newline at end of file
+kst_add_info_files(KstInfoFiles
+ ${KST_DIR}/INSTALL
+ ${KST_DIR}/NEWS
+ ${KST_DIR}/README)
+
+add_executable(kst ${kst_kst_sources} ${rc_file} ${kst_kst_info_files})
+
+kst_link(kstcore kstmath kstapp kstwidgets ${QT_QTOPENGL_LIBRARY} ${QT_QTSVG_LIBRARY})
More information about the Kst
mailing list