[Kst] branches/work/kst/portto4/kst
Peter Kümmel
syntheticpp at gmx.net
Thu Jan 13 15:24:49 CET 2011
SVN commit 1214206 by kuemmel:
cmake: add version to .so, also install gyrodata, cleanup
M +1 -1 INSTALL
M +5 -27 cmake/CMakeLists.txt
M +35 -4 cmake/misc/CMakeLists.txt
M +11 -7 cmake/modules/KstMacros.cmake
--- branches/work/kst/portto4/kst/INSTALL #1214205:1214206
@@ -131,4 +131,4 @@
- install on Mac
- add package rules
- add support for pre-compiled headers
- - have a look at kst1's cmake files, especially the 3rd party lib code
+
--- branches/work/kst/portto4/kst/cmake/CMakeLists.txt #1214205:1214206
@@ -10,7 +10,8 @@
set(kst_version 2.0.3)
include(SubversionHeader)
-SubversionHeader(${kst_dir} Revision ${CMAKE_BINARY_DIR}/svnrevision.h _modified)
+kst_revision_project_name(Revision)
+SubversionHeader(${kst_dir} ${kst_revision_project} ${CMAKE_BINARY_DIR}/svnrevision.h _modified)
message(STATUS)
@@ -122,38 +123,15 @@
message(STATUS "-----------------------------------------------")
message(STATUS)
-add_subdirectory(misc)
+
add_subdirectory(src)
+
if(kst_test)
enable_testing()
add_subdirectory(tests)
endif()
+add_subdirectory(misc)
-if(WIN32)
- install(FILES
- ${QT_BINARY_DIR}/QtCore4.dll
- ${QT_BINARY_DIR}/QtGui4.dll
- ${QT_BINARY_DIR}/QtXml4.dll
- ${QT_BINARY_DIR}/QtOpenGL4.dll
- ${QT_BINARY_DIR}/QtSvg4.dll
- DESTINATION bin
- CONFIGURATIONS Release)
- install(FILES
- ${QT_BINARY_DIR}/QtCored4.dll
- ${QT_BINARY_DIR}/QtGuid4.dll
- ${QT_BINARY_DIR}/QtXmld4.dll
- ${QT_BINARY_DIR}/QtOpenGLd4.dll
- ${QT_BINARY_DIR}/QtSvgd4.dll
- DESTINATION bin
- CONFIGURATIONS Debug)
-endif()
-if(MINGW)
- get_filename_component(MINGW_BIN_PATH ${CMAKE_CXX_COMPILER} PATH)
- install(FILES
- ${MINGW_BIN_PATH}/libgcc_s_dw2-1.dll
- ${MINGW_BIN_PATH}/mingwm10.dll
- DESTINATION bin)
-endif()
--- branches/work/kst/portto4/kst/cmake/misc/CMakeLists.txt #1214205:1214206
@@ -1,5 +1,34 @@
+# install runtime files
if(WIN32)
+ install(FILES
+ ${QT_BINARY_DIR}/QtCore4.dll
+ ${QT_BINARY_DIR}/QtGui4.dll
+ ${QT_BINARY_DIR}/QtXml4.dll
+ ${QT_BINARY_DIR}/QtOpenGL4.dll
+ ${QT_BINARY_DIR}/QtSvg4.dll
+ DESTINATION bin
+ CONFIGURATIONS Release)
+ install(FILES
+ ${QT_BINARY_DIR}/QtCored4.dll
+ ${QT_BINARY_DIR}/QtGuid4.dll
+ ${QT_BINARY_DIR}/QtXmld4.dll
+ ${QT_BINARY_DIR}/QtOpenGLd4.dll
+ ${QT_BINARY_DIR}/QtSvgd4.dll
+ DESTINATION bin
+ CONFIGURATIONS Debug)
+endif()
+
+if(MINGW)
+ get_filename_component(MINGW_BIN_PATH ${CMAKE_CXX_COMPILER} PATH)
+ install(FILES
+ ${MINGW_BIN_PATH}/libgcc_s_dw2-1.dll
+ ${MINGW_BIN_PATH}/mingwm10.dll
+ DESTINATION bin)
+endif()
+
+
+if(WIN32)
set(color_folder colors)
set(tutorial_folder tutorial)
set(font_folder fonts)
@@ -12,12 +41,14 @@
# install data files
if(UNIX)
- #configure_file(${kst_dir}/misc/tutorial/gyrodata.dat.gz ${CMAKE_BINARY_DIR} COPYONLY)
- #add_cusom_command(PRE_BUILD OUTPUT gyrodata.dat COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/gyrodata.dat.sh ${CMAKE_SOURCE_DIR})
- #ADD_CUSTOM_TARGET("gyrodata" ALL DEPENDS gyrodata.dat)
+ if(NOT gyrodata)
+ configure_file(${kst_dir}/misc/tutorial/gyrodata.dat.gz ${CMAKE_BINARY_DIR}/gyrodata.dat.gz COPYONLY)
+ execute_process(WORKING_DIRECTORY ${CMAKE_BINARY_DIR} COMMAND gunzip gyrodata.dat.gz)
+ set(gyrodata ${CMAKE_BINARY_DIR}/gyrodata.dat CACHE STRING "gyrodata decompressed")
endif()
+endif()
file(GLOB dat_files ${kst_dir}/misc/tutorial/*.dat)
-install(FILES ${dat_files} DESTINATION ${tutorial_folder})
+install(FILES ${dat_files} ${gyrodata} DESTINATION ${tutorial_folder})
# install colors
--- branches/work/kst/portto4/kst/cmake/modules/KstMacros.cmake #1214205:1214206
@@ -9,6 +9,11 @@
endmacro()
+macro(kst_revision_project_name name)
+ set(kst_revision_project ${name})
+endmacro()
+
+
macro(kst_files_find folder)
set(_folder ${kst_dir}/${folder})
file(GLOB _sources ${_folder}/*.c)
@@ -45,15 +50,16 @@
macro(kst_set_target_properties)
set_property(TARGET ${kst_name} PROPERTY DEBUG_POSTFIX ${kst_debug_postfix})
- #set_target_properties(${kst_name} PROPERTIES VERSION ${kst_version} SOVERSION 2)
+ set_target_properties(${kst_name} PROPERTIES VERSION ${kst_version} SOVERSION 2)
endmacro()
+
macro(kst_add_executable)
include_directories(${kst_${kst_name}_folder} ${CMAKE_CURRENT_BINARY_DIR})
add_executable(${kst_name} ${ARGN} ${kst_${kst_name}_sources} ${kst_${kst_name}_headers} ${kst_${kst_name}_info_files})
target_link_libraries(${kst_name} ${kst_qtmain_library})
kst_set_target_properties()
- add_dependencies(${kst_name} Revision)
+ add_dependencies(${kst_name} ${kst_revision_project})
endmacro()
@@ -91,7 +97,7 @@
add_library(${kst_name} ${type} ${kst_${kst_name}_sources} ${kst_${kst_name}_headers} ${svnversion_h})
endif()
kst_set_target_properties()
- add_dependencies(${kst_name} Revision)
+ add_dependencies(${kst_name} ${kst_revision_project})
if(WIN32)
install(TARGETS ${kst_name} RUNTIME DESTINATION bin
ARCHIVE DESTINATION lib)
@@ -121,10 +127,7 @@
kst_files_find(${kst_plugin_dir}/${folder}/${name})
add_library(${kst_name} MODULE ${kst_${kst_name}_sources} ${kst_${kst_name}_headers})
kst_link(kstcore kstmath kstwidgets)
- install(TARGETS ${kst_name}
- LIBRARY DESTINATION plugin
- #TODO ${INSTALL_TARGETS_DEFAULT_ARGS}
- )
+ install(TARGETS ${kst_name} LIBRARY DESTINATION plugin)
# TODO install(FILES *.desktop DESTINATION share/services/kst)
if(kst_verbose)
message(STATUS "Building plugin ${kst_name}")
@@ -149,6 +152,7 @@
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})
More information about the Kst
mailing list