From: <ibr...@us...> - 2010-03-14 19:37:40
|
Revision: 3465 http://tora.svn.sourceforge.net/tora/?rev=3465&view=rev Author: ibre5041 Date: 2010-03-14 19:37:30 +0000 (Sun, 14 Mar 2010) Log Message: ----------- sync with trunk, logging Modified Paths: -------------- branches/tora-trotl/CMakeLists.txt branches/tora-trotl/cmake/modules/FindOracle.cmake branches/tora-trotl/cmake/modules/PCHSupport_26.cmake branches/tora-trotl/doc/help/database.html branches/tora-trotl/doc/help/database.texi branches/tora-trotl/doc/help/debugger.texi branches/tora-trotl/doc/help/images/addwatch.png branches/tora-trotl/doc/help/images/changewatch.png branches/tora-trotl/doc/help/images/database.png branches/tora-trotl/doc/help/images/debugger.png branches/tora-trotl/src/CMakeLists.txt branches/tora-trotl/src/qscintilla2/Qt4/PlatQt.cpp branches/tora-trotl/src/qscintilla2/Qt4/Qsci/qsciglobal.h branches/tora-trotl/src/qscintilla2/Qt4/Qsci/qsciscintilla.h branches/tora-trotl/src/qscintilla2/Qt4/qscidocument.cpp branches/tora-trotl/src/qscintilla2/Qt4/qsciscintilla.cpp branches/tora-trotl/src/tobrowser.cpp branches/tora-trotl/src/tobrowserbasewidget.cpp branches/tora-trotl/src/tobrowsertable.cpp branches/tora-trotl/src/toconf.h branches/tora-trotl/src/toconfiguration.cpp branches/tora-trotl/src/toconfiguration.h branches/tora-trotl/src/toconnectionpool.cpp branches/tora-trotl/src/toconnectionpool.h branches/tora-trotl/src/todatabasesettingui.ui branches/tora-trotl/src/todebug.cpp branches/tora-trotl/src/todebugtext.cpp branches/tora-trotl/src/toglobalsetting.cpp branches/tora-trotl/src/tohighlightedtext.cpp branches/tora-trotl/src/tohighlightedtext.h branches/tora-trotl/src/toinvalid.cpp branches/tora-trotl/src/tolinechart.h branches/tora-trotl/src/tomain.cpp branches/tora-trotl/src/tomarkedtext.cpp branches/tora-trotl/src/tonoblockquery.cpp branches/tora-trotl/src/tooracleconnection.cpp branches/tora-trotl/src/toplsqleditor.cpp branches/tora-trotl/src/toplsqltext.cpp branches/tora-trotl/src/toqsqlconnection.cpp branches/tora-trotl/src/toresult.cpp branches/tora-trotl/src/toscheduler.cpp branches/tora-trotl/src/toscript.cpp branches/tora-trotl/src/toscriptschemawidget.cpp branches/tora-trotl/src/toscripttreemodel.cpp branches/tora-trotl/src/tosearchreplace.cpp branches/tora-trotl/src/tosqlparse.cpp branches/tora-trotl/src/tosqlparse.h branches/tora-trotl/src/tothread.cpp branches/tora-trotl/src/toworksheet.cpp branches/tora-trotl/src/toworksheet.h branches/tora-trotl/src/trotl/src/trotl_stat.cpp branches/tora-trotl/src/trotl_test3.cpp Added Paths: ----------- branches/tora-trotl/cmake/modules/FindDB2.cmake branches/tora-trotl/src/db2/ branches/tora-trotl/src/db2/db2connectionsub.cpp branches/tora-trotl/src/db2/db2connectionsub.h branches/tora-trotl/src/db2/db2provider.cpp branches/tora-trotl/src/db2/db2provider.h branches/tora-trotl/src/db2/db2query.cpp branches/tora-trotl/src/db2/db2query.h branches/tora-trotl/src/db2/todb2connection.cpp branches/tora-trotl/src/db2/todb2connection.h branches/tora-trotl/src/precompiled.h branches/tora-trotl/src/tosqlparsetest.cpp Removed Paths: ------------- branches/tora-trotl/src/db2/db2connectionsub.cpp branches/tora-trotl/src/db2/db2connectionsub.h branches/tora-trotl/src/db2/db2provider.cpp branches/tora-trotl/src/db2/db2provider.h branches/tora-trotl/src/db2/db2query.cpp branches/tora-trotl/src/db2/db2query.h branches/tora-trotl/src/db2/todb2connection.cpp branches/tora-trotl/src/db2/todb2connection.h Property Changed: ---------------- branches/tora-trotl/ Property changes on: branches/tora-trotl ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/tora:3191-3418 + /trunk/tora:3191-3464 Modified: branches/tora-trotl/CMakeLists.txt =================================================================== --- branches/tora-trotl/CMakeLists.txt 2010-03-14 11:24:22 UTC (rev 3464) +++ branches/tora-trotl/CMakeLists.txt 2010-03-14 19:37:30 UTC (rev 3465) @@ -4,8 +4,9 @@ # options available for user's input OPTION(WANT_DEBUG "Set the debug build and possible additional outputs" OFF) OPTION(WANT_INTERNAL_QSCINTILLA "Use internal/bundled QScintilla2 source" OFF) -OPTION(ENABLE_ORACLE "Disable Oracle support at all. Including detection" ON) -OPTION(ENABLE_PGSQL "Disable PostgreSQL support. Including detection" ON) +OPTION(ENABLE_ORACLE "Enable/Disable Oracle support at all. Including detection" ON) +OPTION(ENABLE_PGSQL "Enable/Disable PostgreSQL support. Including detection" ON) +OPTION(ENABLE_DB2 "Enable/Disable DB2 support. Including detection" ON) OPTION(WANT_RPM "Enable additional RPM related stuff. Additional make package_rpm target" ON) OPTION(WANT_BUNDLE "Enable Mac OS X bundle build" OFF) OPTION(WANT_BUNDLE_STANDALONE "Do not copy required libs and tools into bundle (WANT_BUNDLE)" ON) @@ -226,7 +227,7 @@ MESSAGE(" ") MESSAGE(WARNING " No PostgreSQL environment has been found.") MESSAGE(WARNING " Specify -DPOSTGRESQL_PATH_INCLUDES=path") - MESSAGE(WARNING " and -DPOSTGRESQL_PATH_LIB manually") + MESSAGE(WARNING " and -DPOSTGRESQL_PATH_LIB=path manually") #MESSAGE (STATUS "PostgreSQL includes: ${POSTGRESQL_INCLUDE_DIR} vs. ${POSTGRESQL_PATH_INCLUDES}") #MESSAGE (STATUS "PostgreSQL libs: ${POSTGRESQL_LIBRARIES} vs. ${POSTGRESQL_PATH_LIB}") MESSAGE(" ") @@ -235,6 +236,24 @@ ENDIF (NOT ENABLE_PGSQL) +IF (NOT ENABLE_DB2) + MESSAGE(STATUS "DB2 support is disabled by user choice") +ELSE (NOT ENABLE_DB2) + + FIND_PACKAGE(DB2) + IF (DB2_FOUND) + ADD_DEFINITIONS(-DHAVE_DB2) + ELSE (DB2_FOUND) + MESSAGE(" ") + MESSAGE(WARNING " No DB2 client libraries have been found.") + MESSAGE(WARNING " TOra can be build without it - without DB2 support.") + MESSAGE(WARNING " Specify -DDB2_PATH_INCLUDES=path") + MESSAGE(WARNING " and -DDB2_PATH_LIB=path manually") + MESSAGE(" ") + ENDIF (DB2_FOUND) + +ENDIF (NOT ENABLE_DB2) + ############################################################################################################## ########## Include Setup ########## Copied: branches/tora-trotl/cmake/modules/FindDB2.cmake (from rev 3463, trunk/tora/cmake/modules/FindDB2.cmake) =================================================================== --- branches/tora-trotl/cmake/modules/FindDB2.cmake (rev 0) +++ branches/tora-trotl/cmake/modules/FindDB2.cmake 2010-03-14 19:37:30 UTC (rev 3465) @@ -0,0 +1,69 @@ +# TOra: Configure DB2 libraries +# +# DB2_FOUND - system has a DB2 client +# DB2_INCLUDES - where to find header files +# DB2_LIBRARIES - the libraries to link against to use Oracle OCI +# +# copyright (c) 2009 Petr Vanek <pe...@sc...> +# Redistribution and use is allowed according to the terms of the BSD license. +# + +SET(DB2_FOUND "NO") + + +IF (DB2_PATH_INCLUDES) + SET (DB2_INCLUDES_LOCATION ${DB2_PATH_INCLUDES}) +ELSE (DB2_PATH_INCLUDES) + SET (DB2_INCLUDES_LOCATION + $ENV{HOME}/sqllib/include/ + ) +ENDIF (DB2_PATH_INCLUDES) + + +# DB2 has really strange lib32/lib64 directories +IF (LIB_SUFFIX STREQUAL "64") + SET(DB2_LIB_SUFFIX 64) +ELSE () + SET(DB2_LIB_SUFFIX 32) +ENDIF () + +IF (DB2_PATH_LIB) + SET (DB2_LIB_LOCATION ${DB2_PATH_LIB}) +ELSE (DB2_PATH_LIB) + SET (DB2_LIB_LOCATION + $ENV{HOME}/sqllib/lib${DB2_LIB_SUFFIX} + ) +ENDIF (DB2_PATH_LIB) + +FIND_PATH( + DB2_INCLUDES + sqlcli1.h + ${DB2_INCLUDES_LOCATION} +) + +FIND_LIBRARY( + DB2_LIBRARY_LIBDB2 + NAMES libdb2 db2 + PATHS ${DB2_LIB_LOCATION} +) + +SET (DB2_LIBRARIES ${DB2_LIBRARY_LIBDB2}) + + +IF (DB2_LIBRARIES AND DB2_INCLUDES) + SET(DB2_FOUND "YES") +ENDIF (DB2_LIBRARIES AND DB2_INCLUDES) + +IF (DB2_FOUND) + MESSAGE(STATUS "Found DB2: ${DB2_LIBRARIES}") +ELSE (DB2_FOUND) + MESSAGE(STATUS "DB2 not found.") + MESSAGE(STATUS "DB2: You can specify includes: -DDB2_PATH_INCLUDES=/opt/db2/V9.5/includes") + MESSAGE(STATUS " currently found includes: ${DB2_INCLUDES}") + MESSAGE(STATUS "DB2: You can specify libs: -DDB2_PATH_LIB=/opt/db2/V9.5/lib64") + MESSAGE(STATUS " currently found libs: ${DB2_LIBRARIES}") + IF (DB2_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "Could not find DB2 library") + ENDIF (DB2_FIND_REQUIRED) +ENDIF (DB2_FOUND) + Modified: branches/tora-trotl/cmake/modules/FindOracle.cmake =================================================================== --- branches/tora-trotl/cmake/modules/FindOracle.cmake 2010-03-14 11:24:22 UTC (rev 3464) +++ branches/tora-trotl/cmake/modules/FindOracle.cmake 2010-03-14 19:37:30 UTC (rev 3465) @@ -107,7 +107,6 @@ ${CMAKE_SOURCE_DIR}/cmake/modules/OCIVersion.c CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:STRING=${ORACLE_INCLUDES}" OUTPUT_VARIABLE OCIVER) - MESSAGE(STATUS "-- OCI Client version: ${OCIVER}") IF (${OCIVER_TYPE} GREATER "110") SET(ORACLE_OCI_VERSION "11G") Modified: branches/tora-trotl/cmake/modules/PCHSupport_26.cmake =================================================================== --- branches/tora-trotl/cmake/modules/PCHSupport_26.cmake 2010-03-14 11:24:22 UTC (rev 3464) +++ branches/tora-trotl/cmake/modules/PCHSupport_26.cmake 2010-03-14 19:37:30 UTC (rev 3465) @@ -1,331 +1,331 @@ -# - Try to find precompiled headers support for GCC 3.4 and 4.x -# Once done this will define: -# -# Variable: -# PCHSupport_FOUND -# -# Macro: -# ADD_PRECOMPILED_HEADER _targetName _input _dowarn -# ADD_PRECOMPILED_HEADER_TO_TARGET _targetName _input _pch_output_to_use _dowarn -# ADD_NATIVE_PRECOMPILED_HEADER _targetName _input _dowarn -# GET_NATIVE_PRECOMPILED_HEADER _targetName _input - -IF(CMAKE_COMPILER_IS_GNUCXX) - - EXEC_PROGRAM( - ${CMAKE_CXX_COMPILER} - ARGS ${CMAKE_CXX_COMPILER_ARG1} -dumpversion - OUTPUT_VARIABLE gcc_compiler_version) - #MESSAGE("GCC Version: ${gcc_compiler_version}") - IF(gcc_compiler_version MATCHES "4\\.[0-9]\\.[0-9]") - SET(PCHSupport_FOUND TRUE) - ELSE(gcc_compiler_version MATCHES "4\\.[0-9]\\.[0-9]") - IF(gcc_compiler_version MATCHES "3\\.4\\.[0-9]") - SET(PCHSupport_FOUND TRUE) - ENDIF(gcc_compiler_version MATCHES "3\\.4\\.[0-9]") - ENDIF(gcc_compiler_version MATCHES "4\\.[0-9]\\.[0-9]") - - SET(_PCH_include_prefix "-I") - -ELSE(CMAKE_COMPILER_IS_GNUCXX) - IF(WIN32) - SET(PCHSupport_FOUND TRUE) # for experimental msvc support - SET(_PCH_include_prefix "/I") - ELSE(WIN32) - SET(PCHSupport_FOUND FALSE) - ENDIF(WIN32) -ENDIF(CMAKE_COMPILER_IS_GNUCXX) - - -MACRO(_PCH_GET_COMPILE_FLAGS _out_compile_flags) - - - STRING(TOUPPER "CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}" _flags_var_name) - SET(${_out_compile_flags} ${${_flags_var_name}} ) - - IF(CMAKE_COMPILER_IS_GNUCXX) - - GET_TARGET_PROPERTY(_targetType ${_PCH_current_target} TYPE) - IF(${_targetType} STREQUAL SHARED_LIBRARY) - LIST(APPEND ${_out_compile_flags} "${${_out_compile_flags}} -fPIC") - ENDIF(${_targetType} STREQUAL SHARED_LIBRARY) - - ELSE(CMAKE_COMPILER_IS_GNUCXX) - ## TODO ... ? or does it work out of the box - ENDIF(CMAKE_COMPILER_IS_GNUCXX) - - GET_DIRECTORY_PROPERTY(DIRINC INCLUDE_DIRECTORIES ) - FOREACH(item ${DIRINC}) - LIST(APPEND ${_out_compile_flags} "${_PCH_include_prefix}${item}") - ENDFOREACH(item) - - SET(_build_type "${CMAKE_BUILD_TYPE}") - # MESSAGE(STATUS "build type: `${CMAKE_BUILD_TYPE}'") - IF (NOT _build_type) - SET(_build_type "Debug") - ENDIF (NOT _build_type) - string(TOUPPER ${_build_type} _build_type) - SET(_def_name "COMPILE_DEFINITIONS_${_build_type}") - GET_DIRECTORY_PROPERTY(_directory_flags ${_def_name}) - FOREACH(item ${_directory_flags}) - LIST(APPEND ${_out_compile_flags} "-D${item}") - ENDFOREACH(item) - # MESSAGE("_directory_flags ${_directory_flags}" ) - GET_DIRECTORY_PROPERTY(_directory_flags DEFINITIONS) - #MESSAGE("_directory_flags ${_directory_flags}" ) - LIST(APPEND ${_out_compile_flags} ${_directory_flags}) - LIST(APPEND ${_out_compile_flags} ${CMAKE_CXX_FLAGS} ) - - SEPARATE_ARGUMENTS(${_out_compile_flags}) - -ENDMACRO(_PCH_GET_COMPILE_FLAGS) - - -MACRO(_PCH_WRITE_PCHDEP_CXX _targetName _include_file _dephelp) - - SET(${_dephelp} ${CMAKE_CURRENT_BINARY_DIR}/${_targetName}_pch_dephelp.cxx) - FILE(WRITE ${${_dephelp}} -"#include \"${_include_file}\" -int testfunction() -{ - return 0; -} -" - ) - -ENDMACRO(_PCH_WRITE_PCHDEP_CXX ) - -MACRO(_PCH_GET_COMPILE_COMMAND out_command _input _output) - - FILE(TO_NATIVE_PATH ${_input} _native_input) - FILE(TO_NATIVE_PATH ${_output} _native_output) - - - IF(CMAKE_COMPILER_IS_GNUCXX) - IF(CMAKE_CXX_COMPILER_ARG1) - # remove leading space in compiler argument - STRING(REGEX REPLACE "^ +" "" pchsupport_compiler_cxx_arg1 ${CMAKE_CXX_COMPILER_ARG1}) - - SET(${out_command} - ${CMAKE_CXX_COMPILER} ${pchsupport_compiler_cxx_arg1} ${_compile_FLAGS} -x c++-header -o ${_output} ${_input} - ) - ELSE(CMAKE_CXX_COMPILER_ARG1) - SET(${out_command} - ${CMAKE_CXX_COMPILER} ${_compile_FLAGS} -x c++-header -o ${_output} ${_input} - ) - ENDIF(CMAKE_CXX_COMPILER_ARG1) - ELSE(CMAKE_COMPILER_IS_GNUCXX) - - SET(_dummy_str "#include <${_input}>") - FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/pch_dummy.cpp ${_dummy_str}) - - SET(${out_command} - ${CMAKE_CXX_COMPILER} ${_compile_FLAGS} /c /Fp${_native_output} /Yc${_native_input} pch_dummy.cpp - ) - #/out:${_output} - - ENDIF(CMAKE_COMPILER_IS_GNUCXX) - -ENDMACRO(_PCH_GET_COMPILE_COMMAND ) - - - -MACRO(_PCH_GET_TARGET_COMPILE_FLAGS _cflags _header_name _pch_path _dowarn ) - - FILE(TO_NATIVE_PATH ${_pch_path} _native_pch_path) - - IF(CMAKE_COMPILER_IS_GNUCXX) - # for use with distcc and gcc >4.0.1 if preprocessed files are accessible - # on all remote machines set - # PCH_ADDITIONAL_COMPILER_FLAGS to -fpch-preprocess - # if you want warnings for invalid header files (which is very inconvenient - # if you have different versions of the headers for different build types - # you may set _pch_dowarn - IF (_dowarn) - SET(${_cflags} "${PCH_ADDITIONAL_COMPILER_FLAGS} -include ${CMAKE_CURRENT_BINARY_DIR}/${_header_name} -Winvalid-pch " ) - ELSE (_dowarn) - SET(${_cflags} "${PCH_ADDITIONAL_COMPILER_FLAGS} -include ${CMAKE_CURRENT_BINARY_DIR}/${_header_name} " ) - ENDIF (_dowarn) - ELSE(CMAKE_COMPILER_IS_GNUCXX) - - set(${_cflags} "/Fp\"${_native_pch_path}\" /Yu\"${_header_name}\" /FI\"${_header_name}\" " ) - - ENDIF(CMAKE_COMPILER_IS_GNUCXX) - -ENDMACRO(_PCH_GET_TARGET_COMPILE_FLAGS ) - -MACRO(GET_PRECOMPILED_HEADER_OUTPUT _targetName _input _output) - GET_FILENAME_COMPONENT(_name ${_input} NAME) - GET_FILENAME_COMPONENT(_path ${_input} PATH) - SET(_output "${CMAKE_CURRENT_BINARY_DIR}/${_name}.gch/${_targetName}_${CMAKE_BUILD_TYPE}.h++") -ENDMACRO(GET_PRECOMPILED_HEADER_OUTPUT _targetName _input) - - -MACRO(ADD_PRECOMPILED_HEADER_TO_TARGET _targetName _input _pch_output_to_use ) - - # to do: test whether compiler flags match between target _targetName - # and _pch_output_to_use - GET_FILENAME_COMPONENT(_name ${_input} NAME) - - IF( "${ARGN}" STREQUAL "0") - SET(_dowarn 0) - ELSE( "${ARGN}" STREQUAL "0") - SET(_dowarn 1) - ENDIF("${ARGN}" STREQUAL "0") - - - _PCH_GET_TARGET_COMPILE_FLAGS(_target_cflags ${_name} ${_pch_output_to_use} ${_dowarn}) - # MESSAGE("Add flags ${_target_cflags} to ${_targetName} " ) - SET_TARGET_PROPERTIES(${_targetName} - PROPERTIES - COMPILE_FLAGS ${_target_cflags} - ) - - ADD_CUSTOM_TARGET(pch_Generate_${_targetName} - DEPENDS ${_pch_output_to_use} - ) - - ADD_DEPENDENCIES(${_targetName} pch_Generate_${_targetName} ) - -ENDMACRO(ADD_PRECOMPILED_HEADER_TO_TARGET) - -MACRO(ADD_PRECOMPILED_HEADER _targetName _input) - - SET(_PCH_current_target ${_targetName}) - - IF(NOT CMAKE_BUILD_TYPE) - MESSAGE(FATAL_ERROR - "This is the ADD_PRECOMPILED_HEADER macro. " - "You must set CMAKE_BUILD_TYPE!" - ) - ENDIF(NOT CMAKE_BUILD_TYPE) - - IF( "${ARGN}" STREQUAL "0") - SET(_dowarn 0) - ELSE( "${ARGN}" STREQUAL "0") - SET(_dowarn 1) - ENDIF("${ARGN}" STREQUAL "0") - - - GET_FILENAME_COMPONENT(_name ${_input} NAME) - GET_FILENAME_COMPONENT(_path ${_input} PATH) - GET_PRECOMPILED_HEADER_OUTPUT( ${_targetName} ${_input} _output) - - GET_FILENAME_COMPONENT(_outdir ${_output} PATH ) - - GET_TARGET_PROPERTY(_targetType ${_PCH_current_target} TYPE) - _PCH_WRITE_PCHDEP_CXX(${_targetName} ${_input} _pch_dephelp_cxx) - - IF(${_targetType} STREQUAL SHARED_LIBRARY) - ADD_LIBRARY(${_targetName}_pch_dephelp SHARED ${_pch_dephelp_cxx} ) - ELSE(${_targetType} STREQUAL SHARED_LIBRARY) - ADD_LIBRARY(${_targetName}_pch_dephelp STATIC ${_pch_dephelp_cxx}) - ENDIF(${_targetType} STREQUAL SHARED_LIBRARY) - - FILE(MAKE_DIRECTORY ${_outdir}) - - - _PCH_GET_COMPILE_FLAGS(_compile_FLAGS) - - #MESSAGE("_compile_FLAGS: ${_compile_FLAGS}") - #message("COMMAND ${CMAKE_CXX_COMPILER} ${_compile_FLAGS} -x c++-header -o ${_output} ${_input}") - SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/${_name} PROPERTIES GENERATED 1) - ADD_CUSTOM_COMMAND( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_name} - COMMAND ${CMAKE_COMMAND} -E copy ${_input} ${CMAKE_CURRENT_BINARY_DIR}/${_name} # ensure same directory! Required by gcc - DEPENDS ${_input} - ) - - #message("_command ${_input} ${_output}") - _PCH_GET_COMPILE_COMMAND(_command ${CMAKE_CURRENT_BINARY_DIR}/${_name} ${_output} ) - - #message(${_input} ) - #message("_output ${_output}") - - ADD_CUSTOM_COMMAND( - OUTPUT ${_output} - COMMAND ${_command} - DEPENDS ${_input} ${CMAKE_CURRENT_BINARY_DIR}/${_name} ${_targetName}_pch_dephelp - ) - - - ADD_PRECOMPILED_HEADER_TO_TARGET(${_targetName} ${_input} ${_output} ${_dowarn}) -ENDMACRO(ADD_PRECOMPILED_HEADER) - - -# Generates the use of precompiled in a target, -# without using depency targets (2 extra for each target) -# Using Visual, must also add ${_targetName}_pch to sources -# Not needed by Xcode - -MACRO(GET_NATIVE_PRECOMPILED_HEADER _targetName _input) - - if(CMAKE_GENERATOR MATCHES Visual*) - - SET(_dummy_str "#include \"${_input}\"\n" - "// This is required to suppress LNK4221. Very annoying.\n" - "void *g_${_targetName}Dummy = 0\;\n") - - # Use of cxx extension for generated files (as Qt does) - SET(${_targetName}_pch ${CMAKE_CURRENT_BINARY_DIR}/${_targetName}_pch.cxx) - if(EXISTS ${${_targetName}_pch}) - # Check if contents is the same, if not rewrite - # todo - else(EXISTS ${${_targetName}_pch}) - FILE(WRITE ${${_targetName}_pch} ${_dummy_str}) - endif(EXISTS ${${_targetName}_pch}) - endif(CMAKE_GENERATOR MATCHES Visual*) - -ENDMACRO(GET_NATIVE_PRECOMPILED_HEADER) - - -MACRO(ADD_NATIVE_PRECOMPILED_HEADER _targetName _input) - - IF( "${ARGN}" STREQUAL "0") - SET(_dowarn 0) - ELSE( "${ARGN}" STREQUAL "0") - SET(_dowarn 1) - ENDIF("${ARGN}" STREQUAL "0") - - if(CMAKE_GENERATOR MATCHES Visual*) - # Auto include the precompile (useful for moc processing, since the use of - # precompiled is specified at the target level - # and I don't want to specifiy /F- for each moc/res/ui generated files (using Qt) - - GET_TARGET_PROPERTY(oldProps ${_targetName} COMPILE_FLAGS) - if (${oldProps} MATCHES NOTFOUND) - SET(oldProps "") - endif(${oldProps} MATCHES NOTFOUND) - - SET(newProperties "${oldProps} /Yu\"${_input}\" /FI\"${_input}\"") - SET_TARGET_PROPERTIES(${_targetName} PROPERTIES COMPILE_FLAGS "${newProperties}") - - #also inlude ${oldProps} to have the same compile options - SET_SOURCE_FILES_PROPERTIES(${${_targetName}_pch} PROPERTIES COMPILE_FLAGS "${oldProps} /Yc\"${_input}\"") - - else(CMAKE_GENERATOR MATCHES Visual*) - - if (CMAKE_GENERATOR MATCHES Xcode) - # For Xcode, cmake needs my patch to process - # GCC_PREFIX_HEADER and GCC_PRECOMPILE_PREFIX_HEADER as target properties - - GET_TARGET_PROPERTY(oldProps ${_targetName} COMPILE_FLAGS) - if (${oldProps} MATCHES NOTFOUND) - SET(oldProps "") - endif(${oldProps} MATCHES NOTFOUND) - - # When buiding out of the tree, precompiled may not be located - # Use full path instead. - GET_FILENAME_COMPONENT(fullPath ${_input} ABSOLUTE) - - SET_TARGET_PROPERTIES(${_targetName} PROPERTIES XCODE_ATTRIBUTE_GCC_PREFIX_HEADER "${fullPath}") - SET_TARGET_PROPERTIES(${_targetName} PROPERTIES XCODE_ATTRIBUTE_GCC_PRECOMPILE_PREFIX_HEADER "YES") - - else (CMAKE_GENERATOR MATCHES Xcode) - - #Fallback to the "old" precompiled suppport - #ADD_PRECOMPILED_HEADER(${_targetName} ${_input} ${_dowarn}) - endif(CMAKE_GENERATOR MATCHES Xcode) - endif(CMAKE_GENERATOR MATCHES Visual*) - -ENDMACRO(ADD_NATIVE_PRECOMPILED_HEADER) +# - Try to find precompiled headers support for GCC 3.4 and 4.x +# Once done this will define: +# +# Variable: +# PCHSupport_FOUND +# +# Macro: +# ADD_PRECOMPILED_HEADER _targetName _input _dowarn +# ADD_PRECOMPILED_HEADER_TO_TARGET _targetName _input _pch_output_to_use _dowarn +# ADD_NATIVE_PRECOMPILED_HEADER _targetName _input _dowarn +# GET_NATIVE_PRECOMPILED_HEADER _targetName _input + +IF(CMAKE_COMPILER_IS_GNUCXX) + + EXEC_PROGRAM( + ${CMAKE_CXX_COMPILER} + ARGS ${CMAKE_CXX_COMPILER_ARG1} -dumpversion + OUTPUT_VARIABLE gcc_compiler_version) + #MESSAGE("GCC Version: ${gcc_compiler_version}") + IF(gcc_compiler_version MATCHES "4\\.[0-9]\\.[0-9]") + SET(PCHSupport_FOUND TRUE) + ELSE(gcc_compiler_version MATCHES "4\\.[0-9]\\.[0-9]") + IF(gcc_compiler_version MATCHES "3\\.4\\.[0-9]") + SET(PCHSupport_FOUND TRUE) + ENDIF(gcc_compiler_version MATCHES "3\\.4\\.[0-9]") + ENDIF(gcc_compiler_version MATCHES "4\\.[0-9]\\.[0-9]") + + SET(_PCH_include_prefix "-I") + +ELSE(CMAKE_COMPILER_IS_GNUCXX) + IF(WIN32) + SET(PCHSupport_FOUND TRUE) # for experimental msvc support + SET(_PCH_include_prefix "/I") + ELSE(WIN32) + SET(PCHSupport_FOUND FALSE) + ENDIF(WIN32) +ENDIF(CMAKE_COMPILER_IS_GNUCXX) + + +MACRO(_PCH_GET_COMPILE_FLAGS _out_compile_flags) + + + STRING(TOUPPER "CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}" _flags_var_name) + SET(${_out_compile_flags} ${${_flags_var_name}} ) + + IF(CMAKE_COMPILER_IS_GNUCXX) + + GET_TARGET_PROPERTY(_targetType ${_PCH_current_target} TYPE) + IF(${_targetType} STREQUAL SHARED_LIBRARY) + LIST(APPEND ${_out_compile_flags} "${${_out_compile_flags}} -fPIC") + ENDIF(${_targetType} STREQUAL SHARED_LIBRARY) + + ELSE(CMAKE_COMPILER_IS_GNUCXX) + ## TODO ... ? or does it work out of the box + ENDIF(CMAKE_COMPILER_IS_GNUCXX) + + GET_DIRECTORY_PROPERTY(DIRINC INCLUDE_DIRECTORIES ) + FOREACH(item ${DIRINC}) + LIST(APPEND ${_out_compile_flags} "${_PCH_include_prefix}${item}") + ENDFOREACH(item) + + SET(_build_type "${CMAKE_BUILD_TYPE}") + # MESSAGE(STATUS "build type: `${CMAKE_BUILD_TYPE}'") + IF (NOT _build_type) + SET(_build_type "Debug") + ENDIF (NOT _build_type) + string(TOUPPER ${_build_type} _build_type) + SET(_def_name "COMPILE_DEFINITIONS_${_build_type}") + GET_DIRECTORY_PROPERTY(_directory_flags ${_def_name}) + FOREACH(item ${_directory_flags}) + LIST(APPEND ${_out_compile_flags} "-D${item}") + ENDFOREACH(item) + # MESSAGE("_directory_flags ${_directory_flags}" ) + GET_DIRECTORY_PROPERTY(_directory_flags DEFINITIONS) + #MESSAGE("_directory_flags ${_directory_flags}" ) + LIST(APPEND ${_out_compile_flags} ${_directory_flags}) + LIST(APPEND ${_out_compile_flags} ${CMAKE_CXX_FLAGS} ) + + SEPARATE_ARGUMENTS(${_out_compile_flags}) + +ENDMACRO(_PCH_GET_COMPILE_FLAGS) + + +MACRO(_PCH_WRITE_PCHDEP_CXX _targetName _include_file _dephelp) + + SET(${_dephelp} ${CMAKE_CURRENT_BINARY_DIR}/${_targetName}_pch_dephelp.cxx) + FILE(WRITE ${${_dephelp}} +"#include \"${_include_file}\" +int testfunction() +{ + return 0; +} +" + ) + +ENDMACRO(_PCH_WRITE_PCHDEP_CXX ) + +MACRO(_PCH_GET_COMPILE_COMMAND out_command _input _output) + + FILE(TO_NATIVE_PATH ${_input} _native_input) + FILE(TO_NATIVE_PATH ${_output} _native_output) + + + IF(CMAKE_COMPILER_IS_GNUCXX) + IF(CMAKE_CXX_COMPILER_ARG1) + # remove leading space in compiler argument + STRING(REGEX REPLACE "^ +" "" pchsupport_compiler_cxx_arg1 ${CMAKE_CXX_COMPILER_ARG1}) + + SET(${out_command} + ${CMAKE_CXX_COMPILER} ${pchsupport_compiler_cxx_arg1} ${_compile_FLAGS} -x c++-header -o ${_output} ${_input} + ) + ELSE(CMAKE_CXX_COMPILER_ARG1) + SET(${out_command} + ${CMAKE_CXX_COMPILER} ${_compile_FLAGS} -x c++-header -o ${_output} ${_input} + ) + ENDIF(CMAKE_CXX_COMPILER_ARG1) + ELSE(CMAKE_COMPILER_IS_GNUCXX) + + SET(_dummy_str "#include <${_input}>") + FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/pch_dummy.cpp ${_dummy_str}) + + SET(${out_command} + ${CMAKE_CXX_COMPILER} ${_compile_FLAGS} /c /Fp${_native_output} /Yc${_native_input} pch_dummy.cpp + ) + #/out:${_output} + + ENDIF(CMAKE_COMPILER_IS_GNUCXX) + +ENDMACRO(_PCH_GET_COMPILE_COMMAND ) + + + +MACRO(_PCH_GET_TARGET_COMPILE_FLAGS _cflags _header_name _pch_path _dowarn ) + + FILE(TO_NATIVE_PATH ${_pch_path} _native_pch_path) + + IF(CMAKE_COMPILER_IS_GNUCXX) + # for use with distcc and gcc >4.0.1 if preprocessed files are accessible + # on all remote machines set + # PCH_ADDITIONAL_COMPILER_FLAGS to -fpch-preprocess + # if you want warnings for invalid header files (which is very inconvenient + # if you have different versions of the headers for different build types + # you may set _pch_dowarn + IF (_dowarn) + SET(${_cflags} "${PCH_ADDITIONAL_COMPILER_FLAGS} -include ${CMAKE_CURRENT_BINARY_DIR}/${_header_name} -Winvalid-pch " ) + ELSE (_dowarn) + SET(${_cflags} "${PCH_ADDITIONAL_COMPILER_FLAGS} -include ${CMAKE_CURRENT_BINARY_DIR}/${_header_name} " ) + ENDIF (_dowarn) + ELSE(CMAKE_COMPILER_IS_GNUCXX) + + set(${_cflags} "/Fp\"${_native_pch_path}\" /Yu\"${_header_name}\" /FI\"${_header_name}\" " ) + + ENDIF(CMAKE_COMPILER_IS_GNUCXX) + +ENDMACRO(_PCH_GET_TARGET_COMPILE_FLAGS ) + +MACRO(GET_PRECOMPILED_HEADER_OUTPUT _targetName _input _output) + GET_FILENAME_COMPONENT(_name ${_input} NAME) + GET_FILENAME_COMPONENT(_path ${_input} PATH) + SET(_output "${CMAKE_CURRENT_BINARY_DIR}/${_name}.gch/${_targetName}_${CMAKE_BUILD_TYPE}.h++") +ENDMACRO(GET_PRECOMPILED_HEADER_OUTPUT _targetName _input) + + +MACRO(ADD_PRECOMPILED_HEADER_TO_TARGET _targetName _input _pch_output_to_use ) + + # to do: test whether compiler flags match between target _targetName + # and _pch_output_to_use + GET_FILENAME_COMPONENT(_name ${_input} NAME) + + IF( "${ARGN}" STREQUAL "0") + SET(_dowarn 0) + ELSE( "${ARGN}" STREQUAL "0") + SET(_dowarn 1) + ENDIF("${ARGN}" STREQUAL "0") + + + _PCH_GET_TARGET_COMPILE_FLAGS(_target_cflags ${_name} ${_pch_output_to_use} ${_dowarn}) + # MESSAGE("Add flags ${_target_cflags} to ${_targetName} " ) + SET_TARGET_PROPERTIES(${_targetName} + PROPERTIES + COMPILE_FLAGS ${_target_cflags} + ) + + ADD_CUSTOM_TARGET(pch_Generate_${_targetName} + DEPENDS ${_pch_output_to_use} + ) + + ADD_DEPENDENCIES(${_targetName} pch_Generate_${_targetName} ) + +ENDMACRO(ADD_PRECOMPILED_HEADER_TO_TARGET) + +MACRO(ADD_PRECOMPILED_HEADER _targetName _input) + + SET(_PCH_current_target ${_targetName}) + + IF(NOT CMAKE_BUILD_TYPE) + MESSAGE(FATAL_ERROR + "This is the ADD_PRECOMPILED_HEADER macro. " + "You must set CMAKE_BUILD_TYPE!" + ) + ENDIF(NOT CMAKE_BUILD_TYPE) + + IF( "${ARGN}" STREQUAL "0") + SET(_dowarn 0) + ELSE( "${ARGN}" STREQUAL "0") + SET(_dowarn 1) + ENDIF("${ARGN}" STREQUAL "0") + + + GET_FILENAME_COMPONENT(_name ${_input} NAME) + GET_FILENAME_COMPONENT(_path ${_input} PATH) + GET_PRECOMPILED_HEADER_OUTPUT( ${_targetName} ${_input} _output) + + GET_FILENAME_COMPONENT(_outdir ${_output} PATH ) + + GET_TARGET_PROPERTY(_targetType ${_PCH_current_target} TYPE) + _PCH_WRITE_PCHDEP_CXX(${_targetName} ${_input} _pch_dephelp_cxx) + + IF(${_targetType} STREQUAL SHARED_LIBRARY) + ADD_LIBRARY(${_targetName}_pch_dephelp SHARED ${_pch_dephelp_cxx} ) + ELSE(${_targetType} STREQUAL SHARED_LIBRARY) + ADD_LIBRARY(${_targetName}_pch_dephelp STATIC ${_pch_dephelp_cxx}) + ENDIF(${_targetType} STREQUAL SHARED_LIBRARY) + + FILE(MAKE_DIRECTORY ${_outdir}) + + + _PCH_GET_COMPILE_FLAGS(_compile_FLAGS) + + #MESSAGE("_compile_FLAGS: ${_compile_FLAGS}") + #message("COMMAND ${CMAKE_CXX_COMPILER} ${_compile_FLAGS} -x c++-header -o ${_output} ${_input}") + SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/${_name} PROPERTIES GENERATED 1) + ADD_CUSTOM_COMMAND( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_name} + COMMAND ${CMAKE_COMMAND} -E copy ${_input} ${CMAKE_CURRENT_BINARY_DIR}/${_name} # ensure same directory! Required by gcc + DEPENDS ${_input} + ) + + #message("_command ${_input} ${_output}") + _PCH_GET_COMPILE_COMMAND(_command ${CMAKE_CURRENT_BINARY_DIR}/${_name} ${_output} ) + + #message(${_input} ) + #message("_output ${_output}") + + ADD_CUSTOM_COMMAND( + OUTPUT ${_output} + COMMAND ${_command} + DEPENDS ${_input} ${CMAKE_CURRENT_BINARY_DIR}/${_name} ${_targetName}_pch_dephelp + ) + + + ADD_PRECOMPILED_HEADER_TO_TARGET(${_targetName} ${_input} ${_output} ${_dowarn}) +ENDMACRO(ADD_PRECOMPILED_HEADER) + + +# Generates the use of precompiled in a target, +# without using depency targets (2 extra for each target) +# Using Visual, must also add ${_targetName}_pch to sources +# Not needed by Xcode + +MACRO(GET_NATIVE_PRECOMPILED_HEADER _targetName _input) + + if(CMAKE_GENERATOR MATCHES Visual*) + + SET(_dummy_str "#include \"${_input}\"\n" + "// This is required to suppress LNK4221. Very annoying.\n" + "void *g_${_targetName}Dummy = 0\;\n") + + # Use of cxx extension for generated files (as Qt does) + SET(${_targetName}_pch ${CMAKE_CURRENT_BINARY_DIR}/${_targetName}_pch.cxx) + if(EXISTS ${${_targetName}_pch}) + # Check if contents is the same, if not rewrite + # todo + else(EXISTS ${${_targetName}_pch}) + FILE(WRITE ${${_targetName}_pch} ${_dummy_str}) + endif(EXISTS ${${_targetName}_pch}) + endif(CMAKE_GENERATOR MATCHES Visual*) + +ENDMACRO(GET_NATIVE_PRECOMPILED_HEADER) + + +MACRO(ADD_NATIVE_PRECOMPILED_HEADER _targetName _input) + + IF( "${ARGN}" STREQUAL "0") + SET(_dowarn 0) + ELSE( "${ARGN}" STREQUAL "0") + SET(_dowarn 1) + ENDIF("${ARGN}" STREQUAL "0") + + if(CMAKE_GENERATOR MATCHES Visual*) + # Auto include the precompile (useful for moc processing, since the use of + # precompiled is specified at the target level + # and I don't want to specifiy /F- for each moc/res/ui generated files (using Qt) + + GET_TARGET_PROPERTY(oldProps ${_targetName} COMPILE_FLAGS) + if (${oldProps} MATCHES NOTFOUND) + SET(oldProps "") + endif(${oldProps} MATCHES NOTFOUND) + + SET(newProperties "${oldProps} /Yu\"${_input}\" /FI\"${_input}\"") + SET_TARGET_PROPERTIES(${_targetName} PROPERTIES COMPILE_FLAGS "${newProperties}") + + #also inlude ${oldProps} to have the same compile options + SET_SOURCE_FILES_PROPERTIES(${${_targetName}_pch} PROPERTIES COMPILE_FLAGS "${oldProps} /Yc\"${_input}\"") + + else(CMAKE_GENERATOR MATCHES Visual*) + + if (CMAKE_GENERATOR MATCHES Xcode) + # For Xcode, cmake needs my patch to process + # GCC_PREFIX_HEADER and GCC_PRECOMPILE_PREFIX_HEADER as target properties + + GET_TARGET_PROPERTY(oldProps ${_targetName} COMPILE_FLAGS) + if (${oldProps} MATCHES NOTFOUND) + SET(oldProps "") + endif(${oldProps} MATCHES NOTFOUND) + + # When buiding out of the tree, precompiled may not be located + # Use full path instead. + GET_FILENAME_COMPONENT(fullPath ${_input} ABSOLUTE) + + SET_TARGET_PROPERTIES(${_targetName} PROPERTIES XCODE_ATTRIBUTE_GCC_PREFIX_HEADER "${fullPath}") + SET_TARGET_PROPERTIES(${_targetName} PROPERTIES XCODE_ATTRIBUTE_GCC_PRECOMPILE_PREFIX_HEADER "YES") + + else (CMAKE_GENERATOR MATCHES Xcode) + + #Fallback to the "old" precompiled suppport + #ADD_PRECOMPILED_HEADER(${_targetName} ${_input} ${_dowarn}) + endif(CMAKE_GENERATOR MATCHES Xcode) + endif(CMAKE_GENERATOR MATCHES Visual*) + +ENDMACRO(ADD_NATIVE_PRECOMPILED_HEADER) Modified: branches/tora-trotl/doc/help/database.html =================================================================== --- branches/tora-trotl/doc/help/database.html 2010-03-14 11:24:22 UTC (rev 3464) +++ branches/tora-trotl/doc/help/database.html 2010-03-14 19:37:30 UTC (rev 3465) @@ -63,7 +63,12 @@ <br><dt><strong>Maximum size display</strong><dd> The maximum width a list column will get automatically regardless of how large the content is. This is so you can still see the rest of the columns even if one of the first can contain very large values. You can always resize the column by hand afterwards. -<br><dt><strong>Firewall mode.</strong><dd> TODO. +<br><dt><strong>Firewall mode.</strong><dd> Makes each connection in connection pool to run extra queries (selecting sysdate from dual) at specified + interval (see "Connection test interval" option). This could be useful if there is a firewall between + TOra and database and firewall is dropping connections if there is no traffic. + + <p><strong>Note!</strong> If you change this option, you have to reconnect in order to make it effective. +<br><dt><strong>Connection test interval</strong><dd> Interval in seconds at which TOra should be sending dummy queries to database (see "Firewall mode"). <br><dt><strong>Indicate empty values as ”.</strong><dd> TODO. <br><dt><strong>Number format.</strong><dd> TODO. </dl> Modified: branches/tora-trotl/doc/help/database.texi =================================================================== --- branches/tora-trotl/doc/help/database.texi 2010-03-14 11:24:22 UTC (rev 3464) +++ branches/tora-trotl/doc/help/database.texi 2010-03-14 19:37:30 UTC (rev 3465) @@ -34,7 +34,13 @@ you can still see the rest of the columns even if one of the first can contain very large values. You can always resize the column by hand afterwards. @item @strong{Firewall mode.} - TODO. + Makes each connection in connection pool to run extra queries (selecting sysdate from dual) at specified + interval (see "Connection test interval" option). This could be useful if there is a firewall between + TOra and database and firewall is dropping connections if there is no traffic. + + @strong{Note!} If you change this option, you have to reconnect in order to make it effective. +@item @strong{Connection test interval} + Interval in seconds at which TOra should be sending dummy queries to database (see "Firewall mode"). @item @strong{Indicate empty values as ''.} TODO. @item @strong{Number format.} Modified: branches/tora-trotl/doc/help/debugger.texi =================================================================== --- branches/tora-trotl/doc/help/debugger.texi 2010-03-14 11:24:22 UTC (rev 3464) +++ branches/tora-trotl/doc/help/debugger.texi 2010-03-14 19:37:30 UTC (rev 3465) @@ -114,7 +114,7 @@ Watches are a way to inspect the contents of variables in a running program. When you add a watch using the @strong{add watch} command you are presented with the following dialog. -@image{images/addwatch,4cm} +@image{images/addwatch,5cm} First of all you need to select the scope the variable is declared in. The @strong{local} scope is variables only declared in the current context, like for instance this function or procedure. The @strong{head} and @strong{body} are variables declared in packages. Variables in packages are usually also available in the global scope. When you declare a watch in any scope except for @strong{local} you should also indicate the object in which the variable is declared in the format schema.object.variable. The current object is prepended to the variable name when you select anything but the @strong{local} scope. @@ -128,7 +128,7 @@ You can also change the content of a watch. First you select the watch you want to change in the watch list, then you select the @strong{change watch} command. You will be shown this dialog. -@image{images/changewatch,10cm} +@image{images/changewatch,7cm} If you have selected the parent of an array watch you will be able to select the index you want to assign a new value with the @strong{index} indicator to right. Then you enter the new value in the text field or check the @strong{NULL} indicator to set the value to NULL. Modified: branches/tora-trotl/doc/help/images/addwatch.png =================================================================== --- branches/tora-trotl/doc/help/images/addwatch.png 2010-03-14 11:24:22 UTC (rev 3464) +++ branches/tora-trotl/doc/help/images/addwatch.png 2010-03-14 19:37:30 UTC (rev 3465) @@ -1,42 +1,170 @@ \x89PNG |