소스 검색

Initial CMake conversion attempt

tags/r14.0.0
Timothy Pearson 7 년 전
부모
커밋
01adb8f0d2
6개의 변경된 파일281개의 추가작업 그리고 97개의 파일을 삭제
  1. 1
    0
      AUTHORS
  2. 86
    53
      CMakeLists.txt
  3. 65
    0
      CMakeLists.txt.orig
  4. 59
    0
      ConfigureChecks.cmake
  5. 38
    21
      kdialogd3/CMakeLists.txt
  6. 32
    23
      qt3/CMakeLists.txt

+ 1
- 0
AUTHORS 파일 보기

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

+ 86
- 53
CMakeLists.txt 파일 보기

@@ -1,5 +1,22 @@
1
-project(KGtk)
2
-cmake_minimum_required(VERSION 2.4.0)
1
+#################################################
2
+#
3
+#  (C) 2011 Timothy Pearson
4
+#  kb9vqf (AT) pearsoncomputing.net
5
+#
6
+#  Improvements and feedback are welcome
7
+#
8
+#  This file is released under GPL >= 2
9
+#
10
+#################################################
11
+
12
+cmake_minimum_required( VERSION 2.8 )
13
+
14
+
15
+##### general package setup #####################
16
+
17
+project( kgtk )
18
+
19
+##### set up cpack ##############################
3 20
 
4 21
 set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README")
5 22
 set(CPACK_GENERATOR "TBZ2")
@@ -12,54 +29,70 @@ set(KGTK_VERSION_FULL "${KGTK_VERSION}.${CPACK_PACKAGE_VERSION_PATCH}")
12 29
 set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${KGTK_VERSION_FULL}")
13 30
 include(CPack)
14 31
 
15
-set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
16
-include(CheckFunctionExists)
17
-check_function_exists(getpeereid HAVE_GETPEEREID)
18
-
19
-SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I/usr/include/tqt -include tqt.h -DTQT_THREAD_SUPPORT")
20
-SET(QT_UIC_EXECUTABLE "/usr/bin/uic-tqt")
21
-#SET(QT_MOC_EXECUTABLE "/usr/bin/tmoc")
22
-
23
-if (NOT "${KGTK_KDE3}" MATCHES "false")
24
-    add_subdirectory(kdialogd3)
25
-endif (NOT "${KGTK_KDE3}" MATCHES "false")
26
-
27
-if (NOT "${KGTK_GTK2}" MATCHES "false")
28
-    # Check if we have dlvsym...
29
-    find_library(LIBDLVSYM_LIBRARY
30
-                 NAMES dl
31
-                 PATHS /lib /usr/lib /usr/X11R6/lib /usr/local/lib)
32
-
33
-    if(LIBDLVSYM_LIBRARY)
34
-        set(HAVE_DLVSYM 1)
35
-        # Determine version of dlsym...
36
-        find_library(LIBDL_LIBRARY
37
-                     NAMES dl
38
-                     PATHS /lib /usr/lib /usr/X11R6/lib /usr/local/lib)
39
-
40
-        if(LIBDL_LIBRARY)
41
-            execute_process(COMMAND objdump --dynamic-syms ${LIBDL_LIBRARY}
42
-                            COMMAND grep dlsym
43
-                            OUTPUT_VARIABLE DLSYM_DATA)
44
-            separate_arguments(DLSYM_DATA)
45
-            if (${CMAKE_MAJOR_VERSION} GREATER 2 OR ${CMAKE_MINOR_VERSION} GREATER 4)
46
-                cmake_policy(SET CMP0007 OLD)
47
-            endif (${CMAKE_MAJOR_VERSION} GREATER 2 OR ${CMAKE_MINOR_VERSION} GREATER 4)
48
-            list(GET DLSYM_DATA 4 KGTK_DLSYM_VERSION)
49
-        endif(LIBDL_LIBRARY)
50
-    else(LIBDLVSYM_LIBRARY)
51
-        message("** INFORMATION: You're libdl does not contain dlvsym - SWT apps will not be supported")
52
-    endif(LIBDLVSYM_LIBRARY)
53
-
54
-    add_subdirectory(gtk2)
55
-endif (NOT "${KGTK_GTK2}" MATCHES "false")
56
-
57
-if (NOT "${KGTK_QT3}" MATCHES "false")
58
-    add_subdirectory(qt3)
59
-endif (NOT "${KGTK_QT3}" MATCHES "false")
60
-
61
-install(PROGRAMS ${CMAKE_SOURCE_DIR}/kdialogd-wrapper DESTINATION bin)
62
-install(PROGRAMS ${CMAKE_SOURCE_DIR}/kgtk-wrapper DESTINATION bin)
63
-
64
-message("** INFORMATION: Using installation prefix: ${CMAKE_INSTALL_PREFIX}")
65
-configure_file (config.h.cmake ${CMAKE_BINARY_DIR}/config.h)
32
+##### include essential cmake modules ###########
33
+
34
+include( CheckCXXSourceCompiles )
35
+include( CheckFunctionExists )
36
+include( CheckIncludeFileCXX )
37
+include( CheckLibraryExists )
38
+include( CheckStructHasMember )
39
+include( CheckSymbolExists )
40
+include( CheckTypeSize )
41
+include( FindPkgConfig )
42
+
43
+
44
+##### include our cmake modules #################
45
+
46
+set( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" )
47
+include( TDEMacros )
48
+
49
+
50
+##### setup install paths #######################
51
+
52
+include( TDESetupPaths )
53
+tde_setup_paths( )
54
+
55
+
56
+##### user requested modules ####################
57
+
58
+option( BUILD_ALL "Build all" OFF )
59
+option( BUILD_KGTK_TQT "Include TQT support" ${BUILD_ALL} )
60
+option( BUILD_KGTK_TDE "Include TDE support" ${BUILD_ALL} )
61
+option( BUILD_KGTK_GTK2 "Include GTK2 support" ${BUILD_ALL} )
62
+option( BUILD_DOC "Build doc" ${BUILD_ALL} )
63
+option( BUILD_TRANSLATIONS "Build translations" ${BUILD_ALL} )
64
+
65
+
66
+##### configure checks ##########################
67
+
68
+include( ConfigureChecks.cmake )
69
+
70
+
71
+###### global compiler settings #################
72
+
73
+add_definitions(
74
+  -DHAVE_CONFIG_H
75
+)
76
+
77
+set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TQT_CXX_FLAGS}" )
78
+set( CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined" )
79
+set( CMAKE_MODULE_LINKER_FLAGS "-Wl,--no-undefined" )
80
+
81
+
82
+##### source directories ########################
83
+
84
+add_subdirectory( src )
85
+tde_conditional_add_subdirectory( BUILD_KGTK_TQT qt3 )
86
+tde_conditional_add_subdirectory( BUILD_KGTK_TDE kdialogd3 )
87
+tde_conditional_add_subdirectory( BUILD_KGTK_GTK2 gtk2 )
88
+tde_conditional_add_subdirectory( BUILD_DOC doc )
89
+tde_conditional_add_subdirectory( BUILD_TRANSLATIONS po )
90
+
91
+##### write configure files #####################
92
+
93
+configure_file( config.h.cmake config.h @ONLY )
94
+
95
+##### install global wrapper scripts ############
96
+
97
+install(PROGRAMS ${CMAKE_SOURCE_DIR}/kdialogd-wrapper DESTINATION ${BIN_INSTALL_DIR})
98
+install(PROGRAMS ${CMAKE_SOURCE_DIR}/kgtk-wrapper DESTINATION ${BIN_INSTALL_DIR})

+ 65
- 0
CMakeLists.txt.orig 파일 보기

@@ -0,0 +1,65 @@
1
+project(KGtk)
2
+cmake_minimum_required(VERSION 2.4.0)
3
+
4
+set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README")
5
+set(CPACK_GENERATOR "TBZ2")
6
+set(CPACK_SOURCE_GENERATOR "TBZ2")
7
+set(CPACK_PACKAGE_VERSION_MAJOR "0")
8
+set(CPACK_PACKAGE_VERSION_MINOR "10")
9
+set(CPACK_PACKAGE_VERSION_PATCH "1")
10
+set(KGTK_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}")
11
+set(KGTK_VERSION_FULL "${KGTK_VERSION}.${CPACK_PACKAGE_VERSION_PATCH}")
12
+set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${KGTK_VERSION_FULL}")
13
+include(CPack)
14
+
15
+set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
16
+include(CheckFunctionExists)
17
+check_function_exists(getpeereid HAVE_GETPEEREID)
18
+
19
+SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I/usr/include/tqt -include tqt.h -DTQT_THREAD_SUPPORT")
20
+SET(QT_UIC_EXECUTABLE "/usr/bin/uic-tqt")
21
+#SET(QT_MOC_EXECUTABLE "/usr/bin/tmoc")
22
+
23
+if (NOT "${KGTK_KDE3}" MATCHES "false")
24
+    add_subdirectory(kdialogd3)
25
+endif (NOT "${KGTK_KDE3}" MATCHES "false")
26
+
27
+if (NOT "${KGTK_GTK2}" MATCHES "false")
28
+    # Check if we have dlvsym...
29
+    find_library(LIBDLVSYM_LIBRARY
30
+                 NAMES dl
31
+                 PATHS /lib /usr/lib /usr/X11R6/lib /usr/local/lib)
32
+
33
+    if(LIBDLVSYM_LIBRARY)
34
+        set(HAVE_DLVSYM 1)
35
+        # Determine version of dlsym...
36
+        find_library(LIBDL_LIBRARY
37
+                     NAMES dl
38
+                     PATHS /lib /usr/lib /usr/X11R6/lib /usr/local/lib)
39
+
40
+        if(LIBDL_LIBRARY)
41
+            execute_process(COMMAND objdump --dynamic-syms ${LIBDL_LIBRARY}
42
+                            COMMAND grep dlsym
43
+                            OUTPUT_VARIABLE DLSYM_DATA)
44
+            separate_arguments(DLSYM_DATA)
45
+            if (${CMAKE_MAJOR_VERSION} GREATER 2 OR ${CMAKE_MINOR_VERSION} GREATER 4)
46
+                cmake_policy(SET CMP0007 OLD)
47
+            endif (${CMAKE_MAJOR_VERSION} GREATER 2 OR ${CMAKE_MINOR_VERSION} GREATER 4)
48
+            list(GET DLSYM_DATA 4 KGTK_DLSYM_VERSION)
49
+        endif(LIBDL_LIBRARY)
50
+    else(LIBDLVSYM_LIBRARY)
51
+        message("** INFORMATION: You're libdl does not contain dlvsym - SWT apps will not be supported")
52
+    endif(LIBDLVSYM_LIBRARY)
53
+
54
+    add_subdirectory(gtk2)
55
+endif (NOT "${KGTK_GTK2}" MATCHES "false")
56
+
57
+if (NOT "${KGTK_QT3}" MATCHES "false")
58
+    add_subdirectory(qt3)
59
+endif (NOT "${KGTK_QT3}" MATCHES "false")
60
+
61
+install(PROGRAMS ${CMAKE_SOURCE_DIR}/kdialogd-wrapper DESTINATION bin)
62
+install(PROGRAMS ${CMAKE_SOURCE_DIR}/kgtk-wrapper DESTINATION bin)
63
+
64
+message("** INFORMATION: Using installation prefix: ${CMAKE_INSTALL_PREFIX}")
65
+configure_file (config.h.cmake ${CMAKE_BINARY_DIR}/config.h)

+ 59
- 0
ConfigureChecks.cmake 파일 보기

@@ -0,0 +1,59 @@
1
+#################################################
2
+#
3
+#  (C) 2010 Serghei Amelian
4
+#  serghei (DOT) amelian (AT) gmail.com
5
+#
6
+#  Improvements and feedback are welcome
7
+#
8
+#  This file is released under GPL >= 2
9
+#
10
+#################################################
11
+
12
+if( BUILD_TRANSLATIONS AND NOT DEFINED MSGFMT_EXECUTABLE )
13
+  find_program( MSGFMT_EXECUTABLE msgfmt )
14
+  if( NOT MSGFMT_EXECUTABLE )
15
+    tde_message_fatal( "msgfmt program is required, but was not found on your system" )
16
+  endif( )
17
+endif( )
18
+
19
+check_type_size( "int" SIZEOF_INT BUILTIN_TYPES_ONLY )
20
+check_type_size( "long" SIZEOF_LONG BUILTIN_TYPES_ONLY )
21
+
22
+check_include_file( stdint.h HAVE_STDINT_H )
23
+check_include_file( systems.h HAVE_SYSTEMS_H )
24
+check_include_file( linux/inotify.h HAVE_INOTIFY )
25
+
26
+check_function_exists( statvfs HAVE_STATVFS )
27
+check_function_exists( getpeereid HAVE_GETPEEREID )
28
+
29
+if ( BUILD_KGTK_GTK2 )
30
+    # Check if we have dlvsym...
31
+    find_library(LIBDLVSYM_LIBRARY
32
+                 NAMES dl
33
+                 PATHS /lib /usr/lib /usr/X11R6/lib /usr/local/lib)
34
+
35
+    if(LIBDLVSYM_LIBRARY)
36
+        set(HAVE_DLVSYM 1)
37
+        # Determine version of dlsym...
38
+        find_library(LIBDL_LIBRARY
39
+                     NAMES dl
40
+                     PATHS /lib /usr/lib /usr/X11R6/lib /usr/local/lib)
41
+
42
+        if(LIBDL_LIBRARY)
43
+            execute_process(COMMAND objdump --dynamic-syms ${LIBDL_LIBRARY}
44
+                            COMMAND grep dlsym
45
+                            OUTPUT_VARIABLE DLSYM_DATA)
46
+            separate_arguments(DLSYM_DATA)
47
+            if (${CMAKE_MAJOR_VERSION} GREATER 2 OR ${CMAKE_MINOR_VERSION} GREATER 4)
48
+                cmake_policy(SET CMP0007 OLD)
49
+            endif (${CMAKE_MAJOR_VERSION} GREATER 2 OR ${CMAKE_MINOR_VERSION} GREATER 4)
50
+            list(GET DLSYM_DATA 4 KGTK_DLSYM_VERSION)
51
+        endif(LIBDL_LIBRARY)
52
+    else(LIBDLVSYM_LIBRARY)
53
+        message("** INFORMATION: You're libdl does not contain dlvsym - SWT apps will not be supported")
54
+    endif(LIBDLVSYM_LIBRARY)
55
+endif ()
56
+
57
+# common required stuff
58
+find_package( TQt )
59
+find_package( TDE )

+ 38
- 21
kdialogd3/CMakeLists.txt 파일 보기

@@ -1,23 +1,40 @@
1
-set(QT_MT_REQUIRED TRUE)
2
-find_package(KDE3)
3
-find_package(Qt3)
1
+#################################################
2
+#
3
+#  (C) 2011 Timothy Pearson
4
+#  kb9vqf (AT) pearsoncomputing.net
5
+#
6
+#  Improvements and feedback are welcome
7
+#
8
+#  This file is released under GPL >= 2
9
+#
10
+#################################################
4 11
 
5
-if (NOT QT_INCLUDE_DIR)
6
-    MESSAGE(STATUS_ERROR "Qt3 package not found--assuming TQt4")
7
-    SET(QT_INCLUDE_DIR "/usr/include/qt4" CACHE PATH "" FORCE)
8
-endif (NOT QT_INCLUDE_DIR)
12
+include_directories(
13
+  ${TQT_INCLUDE_DIRS}
14
+  ${TDE_INCLUDE_DIR}
15
+  ${CMAKE_BINARY_DIR}
16
+  ${CMAKE_SOURCE_DIR}
17
+  ${CMAKE_SOURCE_DIR}/common
18
+)
9 19
 
10
-if (KDE3_INCLUDE_DIR)
11
-    message("** INFORMATION: KDialogD for KDE3 will be built.")
12
-    link_directories(${KDE3_LIB_DIR})
13
-    include_directories (${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_SOURCE_DIR}/common ${CMAKE_BINARY_DIR} ${KDE3_INCLUDE_DIR} ${QT_INCLUDE_DIR})
14
-    set(kdialogd3_SRCS kdialogd.cpp)
15
-    SET(QT_MOC_EXECUTABLE "/usr/bin/tmoc")
16
-    kde3_automoc(${kdialogd3_SRCS})
17
-    add_executable(kdialogd3 ${kdialogd3_SRCS})
18
-    target_link_libraries(kdialogd3 qt-mt tdeui kio tdecore)
19
-    install_targets(/bin kdialogd3)
20
-    add_subdirectory(po)
21
-else (KDE3_INCLUDE_DIR)
22
-    message("** ERROR      : Could not locate Qt3/KDE3 headers, KDialogD for KDE3 will not be built.")
23
-endif (KDE3_INCLUDE_DIR)
20
+link_directories(
21
+  ${TQT_LIBRARY_DIRS}
22
+  ${TDE_LIBRARY_DIRS}
23
+)
24
+
25
+message("** INFORMATION: KDialogD for TDE will be built.")
26
+add_subdirectory(po)
27
+
28
+##### kdialogd3 (executable) #################
29
+
30
+set( target kdialogd3 )
31
+
32
+set( ${target}_SRCS
33
+  kdialogd.cpp
34
+)
35
+
36
+tde_add_executable( ${target} AUTOMOC
37
+  SOURCES ${${target}_SRCS}
38
+  LINK tdecore-shared tdeui-shared
39
+  DESTINATION ${BIN_INSTALL_DIR}
40
+)

+ 32
- 23
qt3/CMakeLists.txt 파일 보기

@@ -1,29 +1,38 @@
1
-set(QT_MT_REQUIRED TRUE)
2
-find_package(Qt3)
1
+#################################################
2
+#
3
+#  (C) 2011 Timothy Pearson
4
+#  kb9vqf (AT) pearsoncomputing.net
5
+#
6
+#  Improvements and feedback are welcome
7
+#
8
+#  This file is released under GPL >= 2
9
+#
10
+#################################################
3 11
 
4
-if (NOT QT_INCLUDE_DIR)
5
-    MESSAGE(STATUS_ERROR "Qt3 package not found--assuming TQt4")
6
-    SET(QT_INCLUDE_DIR "/usr/include/qt4" CACHE PATH "" FORCE)
7
-endif (NOT QT_INCLUDE_DIR)
12
+include_directories(
13
+  ${TQT_INCLUDE_DIRS}
14
+  ${CMAKE_BINARY_DIR}
15
+  ${CMAKE_SOURCE_DIR}
16
+  ${CMAKE_SOURCE_DIR}/common
17
+)
8 18
 
9
-if (QT_INCLUDE_DIR)
10
-    message("** INFORMATION: Qt3 LD_PRELOAD library will be built.")
19
+link_directories(
20
+  ${TQT_LIBRARY_DIRS}
21
+)
11 22
 
12
-    # set(LIB_SUFFIX "" CACHE STRING "Define suffix of directory name (32/64)" )
13
-    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)
23
+message("** INFORMATION: Qt3 LD_PRELOAD library will be built.")
14 24
 
15
-    ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/mangled.h
16
-                    COMMAND ${CMAKE_SOURCE_DIR}/mangled.sh ${CMAKE_CXX_COMPILER} ${CMAKE_CURRENT_BINARY_DIR}/mangled.h)
25
+# set(LIB_SUFFIX "" CACHE STRING "Define suffix of directory name (32/64)" )
26
+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)
17 27
 
18
-    include_directories (${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_SOURCE_DIR}/common ${CMAKE_BINARY_DIR} ${QT_INCLUDE_DIR})
19
-    set(kqt3_SRCS kqt3.cpp mangled.h)
20
-    add_definitions(${QT_DEFINITIONS} -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT)
21
-    add_library(kqt3 SHARED ${kqt3_SRCS})
22
-    target_link_libraries(kqt3 ${QT_LIBRARIES} -lc -ldl)
23
-    install(TARGETS kqt3 LIBRARY DESTINATION ${LIB_INSTALL_DIR}/kgtk)
28
+ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/mangled.h
29
+		COMMAND ${CMAKE_SOURCE_DIR}/mangled.sh ${CMAKE_CXX_COMPILER} ${CMAKE_CURRENT_BINARY_DIR}/mangled.h)
24 30
 
25
-    configure_file (kqt3-wrapper.cmake ${CMAKE_CURRENT_BINARY_DIR}/kqt3-wrapper @ONLY)
26
-    install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/kqt3-wrapper DESTINATION bin)
27
-else (QT_INCLUDE_DIR)
28
-    message("** ERROR      : Could not locate Qt3 headers, Qt3 LD_PRELOAD library will not be built.")
29
-endif (QT_INCLUDE_DIR)
31
+set(kqt3_SRCS kqt3.cpp mangled.h)
32
+add_definitions(${QT_DEFINITIONS} -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT)
33
+add_library(kqt3 SHARED ${kqt3_SRCS})
34
+target_link_libraries(kqt3 ${TQT_LIBRARIES} -lc -ldl)
35
+install(TARGETS kqt3 LIBRARY DESTINATION ${LIB_INSTALL_DIR}/kgtk)
36
+
37
+configure_file (kqt3-wrapper.cmake ${CMAKE_CURRENT_BINARY_DIR}/kqt3-wrapper @ONLY)
38
+install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/kqt3-wrapper DESTINATION ${BIN_INSTALL_DIR})

Loading…
취소
저장