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>

@ -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_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}")
include(CPack)
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
##### include essential cmake modules ###########
include( CheckCXXSourceCompiles )
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)
include( CheckIncludeFileCXX )
include( CheckLibraryExists )
include( CheckStructHasMember )
include( CheckSymbolExists )
include( CheckTypeSize )
include( FindPkgConfig )
##### include our cmake modules #################
set( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" )
include( TDEMacros )
##### setup install paths #######################
include( TDESetupPaths )
tde_setup_paths( )
##### user requested modules ####################
option( BUILD_ALL "Build all" OFF )
option( BUILD_KGTK_TQT "Include TQT support" ${BUILD_ALL} )
option( BUILD_KGTK_TDE "Include TDE support" ${BUILD_ALL} )
option( BUILD_KGTK_GTK2 "Include GTK2 support" ${BUILD_ALL} )
option( BUILD_DOC "Build doc" ${BUILD_ALL} )
option( BUILD_TRANSLATIONS "Build translations" ${BUILD_ALL} )
##### configure checks ##########################
include( ConfigureChecks.cmake )
###### global compiler settings #################
add_definitions(
-DHAVE_CONFIG_H
)
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TQT_CXX_FLAGS}" )
set( CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined" )
set( CMAKE_MODULE_LINKER_FLAGS "-Wl,--no-undefined" )
##### 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)
MESSAGE(STATUS_ERROR "Qt3 package not found--assuming TQt4")
SET(QT_INCLUDE_DIR "/usr/include/qt4" CACHE PATH "" FORCE)
endif (NOT QT_INCLUDE_DIR)
include_directories(
${TQT_INCLUDE_DIRS}
${TDE_INCLUDE_DIR}
${CMAKE_BINARY_DIR}
${CMAKE_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/common
)
if (KDE3_INCLUDE_DIR)
message("** INFORMATION: KDialogD for KDE3 will be built.")
link_directories(${KDE3_LIB_DIR})
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")
kde3_automoc(${kdialogd3_SRCS})
add_executable(kdialogd3 ${kdialogd3_SRCS})
target_link_libraries(kdialogd3 qt-mt tdeui kio tdecore)
install_targets(/bin kdialogd3)
link_directories(
${TQT_LIBRARY_DIRS}
${TDE_LIBRARY_DIRS}
)
message("** INFORMATION: KDialogD for TDE will be built.")
add_subdirectory(po)
else (KDE3_INCLUDE_DIR)
message("** ERROR : Could not locate Qt3/KDE3 headers, KDialogD for KDE3 will not be built.")
endif (KDE3_INCLUDE_DIR)
##### kdialogd3 (executable) #################
set( target kdialogd3 )
set( ${target}_SRCS
kdialogd.cpp
)
tde_add_executable( ${target} AUTOMOC
SOURCES ${${target}_SRCS}
LINK tdecore-shared tdeui-shared
DESTINATION ${BIN_INSTALL_DIR}
)

@ -1,12 +1,25 @@
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)
MESSAGE(STATUS_ERROR "Qt3 package not found--assuming TQt4")
SET(QT_INCLUDE_DIR "/usr/include/qt4" CACHE PATH "" FORCE)
endif (NOT QT_INCLUDE_DIR)
include_directories(
${TQT_INCLUDE_DIRS}
${CMAKE_BINARY_DIR}
${CMAKE_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/common
)
link_directories(
${TQT_LIBRARY_DIRS}
)
if (QT_INCLUDE_DIR)
message("** INFORMATION: Qt3 LD_PRELOAD library will be built.")
# set(LIB_SUFFIX "" CACHE STRING "Define suffix of directory name (32/64)" )
@ -15,15 +28,11 @@ if (QT_INCLUDE_DIR)
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)
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)
add_definitions(${QT_DEFINITIONS} -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT)
add_library(kqt3 SHARED ${kqt3_SRCS})
target_link_libraries(kqt3 ${QT_LIBRARIES} -lc -ldl)
target_link_libraries(kqt3 ${TQT_LIBRARIES} -lc -ldl)
install(TARGETS kqt3 LIBRARY DESTINATION ${LIB_INSTALL_DIR}/kgtk)
configure_file (kqt3-wrapper.cmake ${CMAKE_CURRENT_BINARY_DIR}/kqt3-wrapper @ONLY)
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/kqt3-wrapper DESTINATION bin)
else (QT_INCLUDE_DIR)
message("** ERROR : Could not locate Qt3 headers, Qt3 LD_PRELOAD library will not be built.")
endif (QT_INCLUDE_DIR)
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/kqt3-wrapper DESTINATION ${BIN_INSTALL_DIR})
Loading…
Cancel
Save