diff options
Diffstat (limited to 'tqt')
-rw-r--r-- | tqt/CMakeLists.txt | 52 | ||||
-rw-r--r-- | tqt/kqt3.cpp | 36 |
2 files changed, 61 insertions, 27 deletions
diff --git a/tqt/CMakeLists.txt b/tqt/CMakeLists.txt index 7dfc840..04f8279 100644 --- a/tqt/CMakeLists.txt +++ b/tqt/CMakeLists.txt @@ -21,19 +21,47 @@ link_directories( ${TQT_LIBRARY_DIRS} ) -message("** INFORMATION: Qt3 LD_PRELOAD library will be built.") -# set(LIB_SUFFIX "" CACHE STRING "Define suffix of directory name (32/64)" ) -set(LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}" CACHE PATH "The subdirectory relative to the install prefix where libraries will be installed (default is /lib${LIB_SUFFIX})" FORCE) +add_definitions( -DTQT_THREAD_SUPPORT ) -ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/mangled.h - COMMAND ${CMAKE_SOURCE_DIR}/mangled.sh ${CMAKE_CXX_COMPILER} ${CMAKE_CURRENT_BINARY_DIR}/mangled.h) -set(kqt3_SRCS kqt3.cpp mangled.h) -add_definitions(${QT_DEFINITIONS} -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT) -add_library(kqt3 SHARED ${kqt3_SRCS}) -target_link_libraries(kqt3 ${TQT_LIBRARIES} -lc -ldl) -install(TARGETS kqt3 LIBRARY DESTINATION ${LIB_INSTALL_DIR}/kgtk) +##### generate mangled.h -configure_file (kqt3-wrapper.cmake ${CMAKE_CURRENT_BINARY_DIR}/kqt3-wrapper @ONLY) -install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/kqt3-wrapper DESTINATION ${BIN_INSTALL_DIR})
\ No newline at end of file +add_custom_target( + mangled_header + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/mangled.h +) + +add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/mangled.h + COMMAND + ${CMAKE_SOURCE_DIR}/mangled.sh + ${CMAKE_CXX_COMPILER} + ${CMAKE_CURRENT_BINARY_DIR}/mangled.h +) + + +##### kqt3 (shared) + +tde_add_library( kqt3 SHARED NO_LIBTOOL_FILE + SOURCES + kqt3.cpp + + LINK + ${TQT_LIBRARIES} + ${CMAKE_DL_LIBS} + + DESTINATION ${LIB_INSTALL_DIR}/kgtk + + DEPENDENCIES mangled_header +) + + +##### other data + +configure_file( kqt3-wrapper.cmake kqt3-wrapper @ONLY ) + +install( + PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/kqt3-wrapper + DESTINATION ${BIN_INSTALL_DIR} +) diff --git a/tqt/kqt3.cpp b/tqt/kqt3.cpp index 8ceb265..2149882 100644 --- a/tqt/kqt3.cpp +++ b/tqt/kqt3.cpp @@ -120,19 +120,25 @@ static const char * getAppName(bool useTQt=true) int TQApplication::exec() { - static bool init=false; - - if(!init) - { - connectToKDialogD(getAppName(false)); - init=true; - } - - static int (*realFunction)(void *); - - if(!realFunction) - realFunction = (int (*)(void *)) dlsym(RTLD_NEXT, KQT_QAPPLICATION_EXEC); - return (int)realFunction(this); + static bool init=false; + + if(!init) + { + connectToKDialogD(getAppName(false)); + init=true; + } + + static int (*realFunction)(void *); + + if(!realFunction) + realFunction = (int (*)(void *)) dlsym(RTLD_NEXT, KQT_QAPPLICATION_EXEC); + if (realFunction) + return (int)realFunction(this); + else + { + tqWarning("kgtk-qt3 tqt TQApplication::exec() realFunction not found!!"); + return 255; + } }; static TQString qt2KdeFilter(const TQString &f) @@ -232,7 +238,7 @@ static const TQString getFilters(TQFileDialog *dlg, bool scribusSave=false) end(children.end()); for(; it!=end; ++it) - if(::tqqt_cast<TQComboBox *>(*it) && 0==qstrcmp((*it)->name(), "file types")) + if(::tqt_cast<TQComboBox *>(*it) && 0==qstrcmp((*it)->name(), "file types")) { TQComboBox *types=(TQComboBox *)(*it); TQTextOStream str(&filter); @@ -269,7 +275,7 @@ static TQString getCurrentFileName(TQFileDialog *dlg) end(children.end()); for(; it!=end; ++it) - if(::tqqt_cast<TQLineEdit *>(*it)) // && 0==qstrcmp((*it)->name(), "name/filter editor")) + if(::tqt_cast<TQLineEdit *>(*it)) // && 0==qstrcmp((*it)->name(), "name/filter editor")) return ((TQLineEdit *)(*it))->text(); } } |