Initial CMake conversion attempt

pull/1/head
Timothy Pearson 13 years ago
parent 23aab05bd5
commit 01adb8f0d2

@ -1 +1,2 @@
Timothy Pearson <kb9vqf@pearsoncomputing.net>
Craig Drummond <Craig.Drummond@lycos.co.uk> Craig Drummond <Craig.Drummond@lycos.co.uk>

@ -1,5 +1,22 @@
project(KGtk) #################################################
cmake_minimum_required(VERSION 2.4.0) #
# (C) 2011 Timothy Pearson
# kb9vqf (AT) pearsoncomputing.net
#
# Improvements and feedback are welcome
#
# This file is released under GPL >= 2
#
#################################################
cmake_minimum_required( VERSION 2.8 )
##### general package setup #####################
project( kgtk )
##### set up cpack ##############################
set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README") set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README")
set(CPACK_GENERATOR "TBZ2") set(CPACK_GENERATOR "TBZ2")
@ -12,54 +29,70 @@ set(KGTK_VERSION_FULL "${KGTK_VERSION}.${CPACK_PACKAGE_VERSION_PATCH}")
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${KGTK_VERSION_FULL}") set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${KGTK_VERSION_FULL}")
include(CPack) include(CPack)
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) ##### include essential cmake modules ###########
include(CheckFunctionExists)
check_function_exists(getpeereid HAVE_GETPEEREID) include( CheckCXXSourceCompiles )
include( CheckFunctionExists )
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I/usr/include/tqt -include tqt.h -DTQT_THREAD_SUPPORT") include( CheckIncludeFileCXX )
SET(QT_UIC_EXECUTABLE "/usr/bin/uic-tqt") include( CheckLibraryExists )
#SET(QT_MOC_EXECUTABLE "/usr/bin/tmoc") include( CheckStructHasMember )
include( CheckSymbolExists )
if (NOT "${KGTK_KDE3}" MATCHES "false") include( CheckTypeSize )
add_subdirectory(kdialogd3) include( FindPkgConfig )
endif (NOT "${KGTK_KDE3}" MATCHES "false")
if (NOT "${KGTK_GTK2}" MATCHES "false") ##### include our cmake modules #################
# Check if we have dlvsym...
find_library(LIBDLVSYM_LIBRARY set( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" )
NAMES dl include( TDEMacros )
PATHS /lib /usr/lib /usr/X11R6/lib /usr/local/lib)
if(LIBDLVSYM_LIBRARY) ##### setup install paths #######################
set(HAVE_DLVSYM 1)
# Determine version of dlsym... include( TDESetupPaths )
find_library(LIBDL_LIBRARY tde_setup_paths( )
NAMES dl
PATHS /lib /usr/lib /usr/X11R6/lib /usr/local/lib)
##### user requested modules ####################
if(LIBDL_LIBRARY)
execute_process(COMMAND objdump --dynamic-syms ${LIBDL_LIBRARY} option( BUILD_ALL "Build all" OFF )
COMMAND grep dlsym option( BUILD_KGTK_TQT "Include TQT support" ${BUILD_ALL} )
OUTPUT_VARIABLE DLSYM_DATA) option( BUILD_KGTK_TDE "Include TDE support" ${BUILD_ALL} )
separate_arguments(DLSYM_DATA) option( BUILD_KGTK_GTK2 "Include GTK2 support" ${BUILD_ALL} )
if (${CMAKE_MAJOR_VERSION} GREATER 2 OR ${CMAKE_MINOR_VERSION} GREATER 4) option( BUILD_DOC "Build doc" ${BUILD_ALL} )
cmake_policy(SET CMP0007 OLD) option( BUILD_TRANSLATIONS "Build translations" ${BUILD_ALL} )
endif (${CMAKE_MAJOR_VERSION} GREATER 2 OR ${CMAKE_MINOR_VERSION} GREATER 4)
list(GET DLSYM_DATA 4 KGTK_DLSYM_VERSION)
endif(LIBDL_LIBRARY) ##### configure checks ##########################
else(LIBDLVSYM_LIBRARY)
message("** INFORMATION: You're libdl does not contain dlvsym - SWT apps will not be supported") include( ConfigureChecks.cmake )
endif(LIBDLVSYM_LIBRARY)
add_subdirectory(gtk2) ###### global compiler settings #################
endif (NOT "${KGTK_GTK2}" MATCHES "false")
add_definitions(
if (NOT "${KGTK_QT3}" MATCHES "false") -DHAVE_CONFIG_H
add_subdirectory(qt3) )
endif (NOT "${KGTK_QT3}" MATCHES "false")
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TQT_CXX_FLAGS}" )
install(PROGRAMS ${CMAKE_SOURCE_DIR}/kdialogd-wrapper DESTINATION bin) set( CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined" )
install(PROGRAMS ${CMAKE_SOURCE_DIR}/kgtk-wrapper DESTINATION bin) set( CMAKE_MODULE_LINKER_FLAGS "-Wl,--no-undefined" )
message("** INFORMATION: Using installation prefix: ${CMAKE_INSTALL_PREFIX}")
configure_file (config.h.cmake ${CMAKE_BINARY_DIR}/config.h) ##### source directories ########################
add_subdirectory( src )
tde_conditional_add_subdirectory( BUILD_KGTK_TQT qt3 )
tde_conditional_add_subdirectory( BUILD_KGTK_TDE kdialogd3 )
tde_conditional_add_subdirectory( BUILD_KGTK_GTK2 gtk2 )
tde_conditional_add_subdirectory( BUILD_DOC doc )
tde_conditional_add_subdirectory( BUILD_TRANSLATIONS po )
##### write configure files #####################
configure_file( config.h.cmake config.h @ONLY )
##### install global wrapper scripts ############
install(PROGRAMS ${CMAKE_SOURCE_DIR}/kdialogd-wrapper DESTINATION ${BIN_INSTALL_DIR})
install(PROGRAMS ${CMAKE_SOURCE_DIR}/kgtk-wrapper DESTINATION ${BIN_INSTALL_DIR})

@ -0,0 +1,65 @@
project(KGtk)
cmake_minimum_required(VERSION 2.4.0)
set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README")
set(CPACK_GENERATOR "TBZ2")
set(CPACK_SOURCE_GENERATOR "TBZ2")
set(CPACK_PACKAGE_VERSION_MAJOR "0")
set(CPACK_PACKAGE_VERSION_MINOR "10")
set(CPACK_PACKAGE_VERSION_PATCH "1")
set(KGTK_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}")
set(KGTK_VERSION_FULL "${KGTK_VERSION}.${CPACK_PACKAGE_VERSION_PATCH}")
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${KGTK_VERSION_FULL}")
include(CPack)
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
include(CheckFunctionExists)
check_function_exists(getpeereid HAVE_GETPEEREID)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I/usr/include/tqt -include tqt.h -DTQT_THREAD_SUPPORT")
SET(QT_UIC_EXECUTABLE "/usr/bin/uic-tqt")
#SET(QT_MOC_EXECUTABLE "/usr/bin/tmoc")
if (NOT "${KGTK_KDE3}" MATCHES "false")
add_subdirectory(kdialogd3)
endif (NOT "${KGTK_KDE3}" MATCHES "false")
if (NOT "${KGTK_GTK2}" MATCHES "false")
# Check if we have dlvsym...
find_library(LIBDLVSYM_LIBRARY
NAMES dl
PATHS /lib /usr/lib /usr/X11R6/lib /usr/local/lib)
if(LIBDLVSYM_LIBRARY)
set(HAVE_DLVSYM 1)
# Determine version of dlsym...
find_library(LIBDL_LIBRARY
NAMES dl
PATHS /lib /usr/lib /usr/X11R6/lib /usr/local/lib)
if(LIBDL_LIBRARY)
execute_process(COMMAND objdump --dynamic-syms ${LIBDL_LIBRARY}
COMMAND grep dlsym
OUTPUT_VARIABLE DLSYM_DATA)
separate_arguments(DLSYM_DATA)
if (${CMAKE_MAJOR_VERSION} GREATER 2 OR ${CMAKE_MINOR_VERSION} GREATER 4)
cmake_policy(SET CMP0007 OLD)
endif (${CMAKE_MAJOR_VERSION} GREATER 2 OR ${CMAKE_MINOR_VERSION} GREATER 4)
list(GET DLSYM_DATA 4 KGTK_DLSYM_VERSION)
endif(LIBDL_LIBRARY)
else(LIBDLVSYM_LIBRARY)
message("** INFORMATION: You're libdl does not contain dlvsym - SWT apps will not be supported")
endif(LIBDLVSYM_LIBRARY)
add_subdirectory(gtk2)
endif (NOT "${KGTK_GTK2}" MATCHES "false")
if (NOT "${KGTK_QT3}" MATCHES "false")
add_subdirectory(qt3)
endif (NOT "${KGTK_QT3}" MATCHES "false")
install(PROGRAMS ${CMAKE_SOURCE_DIR}/kdialogd-wrapper DESTINATION bin)
install(PROGRAMS ${CMAKE_SOURCE_DIR}/kgtk-wrapper DESTINATION bin)
message("** INFORMATION: Using installation prefix: ${CMAKE_INSTALL_PREFIX}")
configure_file (config.h.cmake ${CMAKE_BINARY_DIR}/config.h)

@ -0,0 +1,59 @@
#################################################
#
# (C) 2010 Serghei Amelian
# serghei (DOT) amelian (AT) gmail.com
#
# Improvements and feedback are welcome
#
# This file is released under GPL >= 2
#
#################################################
if( BUILD_TRANSLATIONS AND NOT DEFINED MSGFMT_EXECUTABLE )
find_program( MSGFMT_EXECUTABLE msgfmt )
if( NOT MSGFMT_EXECUTABLE )
tde_message_fatal( "msgfmt program is required, but was not found on your system" )
endif( )
endif( )
check_type_size( "int" SIZEOF_INT BUILTIN_TYPES_ONLY )
check_type_size( "long" SIZEOF_LONG BUILTIN_TYPES_ONLY )
check_include_file( stdint.h HAVE_STDINT_H )
check_include_file( systems.h HAVE_SYSTEMS_H )
check_include_file( linux/inotify.h HAVE_INOTIFY )
check_function_exists( statvfs HAVE_STATVFS )
check_function_exists( getpeereid HAVE_GETPEEREID )
if ( BUILD_KGTK_GTK2 )
# Check if we have dlvsym...
find_library(LIBDLVSYM_LIBRARY
NAMES dl
PATHS /lib /usr/lib /usr/X11R6/lib /usr/local/lib)
if(LIBDLVSYM_LIBRARY)
set(HAVE_DLVSYM 1)
# Determine version of dlsym...
find_library(LIBDL_LIBRARY
NAMES dl
PATHS /lib /usr/lib /usr/X11R6/lib /usr/local/lib)
if(LIBDL_LIBRARY)
execute_process(COMMAND objdump --dynamic-syms ${LIBDL_LIBRARY}
COMMAND grep dlsym
OUTPUT_VARIABLE DLSYM_DATA)
separate_arguments(DLSYM_DATA)
if (${CMAKE_MAJOR_VERSION} GREATER 2 OR ${CMAKE_MINOR_VERSION} GREATER 4)
cmake_policy(SET CMP0007 OLD)
endif (${CMAKE_MAJOR_VERSION} GREATER 2 OR ${CMAKE_MINOR_VERSION} GREATER 4)
list(GET DLSYM_DATA 4 KGTK_DLSYM_VERSION)
endif(LIBDL_LIBRARY)
else(LIBDLVSYM_LIBRARY)
message("** INFORMATION: You're libdl does not contain dlvsym - SWT apps will not be supported")
endif(LIBDLVSYM_LIBRARY)
endif ()
# common required stuff
find_package( TQt )
find_package( TDE )

@ -1,23 +1,40 @@
set(QT_MT_REQUIRED TRUE) #################################################
find_package(KDE3) #
find_package(Qt3) # (C) 2011 Timothy Pearson
# kb9vqf (AT) pearsoncomputing.net
#
# Improvements and feedback are welcome
#
# This file is released under GPL >= 2
#
#################################################
if (NOT QT_INCLUDE_DIR) include_directories(
MESSAGE(STATUS_ERROR "Qt3 package not found--assuming TQt4") ${TQT_INCLUDE_DIRS}
SET(QT_INCLUDE_DIR "/usr/include/qt4" CACHE PATH "" FORCE) ${TDE_INCLUDE_DIR}
endif (NOT QT_INCLUDE_DIR) ${CMAKE_BINARY_DIR}
${CMAKE_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/common
)
if (KDE3_INCLUDE_DIR) link_directories(
message("** INFORMATION: KDialogD for KDE3 will be built.") ${TQT_LIBRARY_DIRS}
link_directories(${KDE3_LIB_DIR}) ${TDE_LIBRARY_DIRS}
include_directories (${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_SOURCE_DIR}/common ${CMAKE_BINARY_DIR} ${KDE3_INCLUDE_DIR} ${QT_INCLUDE_DIR}) )
set(kdialogd3_SRCS kdialogd.cpp)
SET(QT_MOC_EXECUTABLE "/usr/bin/tmoc") message("** INFORMATION: KDialogD for TDE will be built.")
kde3_automoc(${kdialogd3_SRCS}) add_subdirectory(po)
add_executable(kdialogd3 ${kdialogd3_SRCS})
target_link_libraries(kdialogd3 qt-mt tdeui kio tdecore) ##### kdialogd3 (executable) #################
install_targets(/bin kdialogd3)
add_subdirectory(po) set( target kdialogd3 )
else (KDE3_INCLUDE_DIR)
message("** ERROR : Could not locate Qt3/KDE3 headers, KDialogD for KDE3 will not be built.") set( ${target}_SRCS
endif (KDE3_INCLUDE_DIR) kdialogd.cpp
)
tde_add_executable( ${target} AUTOMOC
SOURCES ${${target}_SRCS}
LINK tdecore-shared tdeui-shared
DESTINATION ${BIN_INSTALL_DIR}
)

@ -1,29 +1,38 @@
set(QT_MT_REQUIRED TRUE) #################################################
find_package(Qt3) #
# (C) 2011 Timothy Pearson
# kb9vqf (AT) pearsoncomputing.net
#
# Improvements and feedback are welcome
#
# This file is released under GPL >= 2
#
#################################################
if (NOT QT_INCLUDE_DIR) include_directories(
MESSAGE(STATUS_ERROR "Qt3 package not found--assuming TQt4") ${TQT_INCLUDE_DIRS}
SET(QT_INCLUDE_DIR "/usr/include/qt4" CACHE PATH "" FORCE) ${CMAKE_BINARY_DIR}
endif (NOT QT_INCLUDE_DIR) ${CMAKE_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/common
)
if (QT_INCLUDE_DIR) link_directories(
message("** INFORMATION: Qt3 LD_PRELOAD library will be built.") ${TQT_LIBRARY_DIRS}
)
# set(LIB_SUFFIX "" CACHE STRING "Define suffix of directory name (32/64)" ) message("** INFORMATION: Qt3 LD_PRELOAD library will be built.")
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_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/mangled.h # 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_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/mangled.h
COMMAND ${CMAKE_SOURCE_DIR}/mangled.sh ${CMAKE_CXX_COMPILER} ${CMAKE_CURRENT_BINARY_DIR}/mangled.h) COMMAND ${CMAKE_SOURCE_DIR}/mangled.sh ${CMAKE_CXX_COMPILER} ${CMAKE_CURRENT_BINARY_DIR}/mangled.h)
include_directories (${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_SOURCE_DIR}/common ${CMAKE_BINARY_DIR} ${QT_INCLUDE_DIR}) set(kqt3_SRCS kqt3.cpp mangled.h)
set(kqt3_SRCS kqt3.cpp mangled.h) add_definitions(${QT_DEFINITIONS} -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT)
add_definitions(${QT_DEFINITIONS} -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT) add_library(kqt3 SHARED ${kqt3_SRCS})
add_library(kqt3 SHARED ${kqt3_SRCS}) target_link_libraries(kqt3 ${TQT_LIBRARIES} -lc -ldl)
target_link_libraries(kqt3 ${QT_LIBRARIES} -lc -ldl) install(TARGETS kqt3 LIBRARY DESTINATION ${LIB_INSTALL_DIR}/kgtk)
install(TARGETS kqt3 LIBRARY DESTINATION ${LIB_INSTALL_DIR}/kgtk)
configure_file (kqt3-wrapper.cmake ${CMAKE_CURRENT_BINARY_DIR}/kqt3-wrapper @ONLY) configure_file (kqt3-wrapper.cmake ${CMAKE_CURRENT_BINARY_DIR}/kqt3-wrapper @ONLY)
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/kqt3-wrapper DESTINATION bin) install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/kqt3-wrapper DESTINATION ${BIN_INSTALL_DIR})
else (QT_INCLUDE_DIR)
message("** ERROR : Could not locate Qt3 headers, Qt3 LD_PRELOAD library will not be built.")
endif (QT_INCLUDE_DIR)
Loading…
Cancel
Save