Make liblxqt (original librazorqt) compiles independently.
authorHone Jen Yee (PCMan) <pcman.tw@gmail.com>
Tue, 6 Aug 2013 15:12:16 +0000 (23:12 +0800)
committerHone Jen Yee (PCMan) <pcman.tw@gmail.com>
Tue, 6 Aug 2013 15:12:16 +0000 (23:12 +0800)
CMakeLists.txt

index 6d47b72..05333e9 100644 (file)
@@ -1,4 +1,85 @@
+cmake_minimum_required( VERSION 2.6 )
+
 project(librazorqt)
+
+if (NOT CMAKE_BUILD_TYPE)
+    set ( CMAKE_BUILD_TYPE Release )
+endif (NOT CMAKE_BUILD_TYPE)
+
+if (CMAKE_BUILD_TYPE MATCHES [Dd]ebug)
+    message(STATUS "Debug build")
+    add_definitions(-DDEBUG)
+else()
+    message(STATUS "non-debug build")
+    add_definitions(-DNDEBUG)
+endif()
+
+if (NOT CMAKE_INSTALL_PREFIX)
+    message(FATAL_ERROR "CMAKE_INSTALL_PREFIX is not set but it has to be. Something is wrong.")
+endif ()
+
+set(MAJOR_VERSION 0)
+set(MINOR_VERSION 5)
+set(PATCH_VERSION 0)
+set(RAZOR_VERSION ${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION})
+add_definitions(-DRAZOR_VERSION=\"${RAZOR_VERSION}\")
+message(STATUS "")
+message(STATUS "Razor-qt version: ${RAZOR_VERSION}")
+message(STATUS "")
+
+link_directories(/usr/local/lib/)
+
+add_definitions ( -Wall )
+set( QT_USE_QTDBUS 1 )
+find_package ( Qt4 4.6.0 REQUIRED )
+include ( ${QT_USE_FILE} )
+include_directories (
+       ${QT_QTCORE_INCLUDE_DIR}
+       ${QT_QTGUI_INCLUDE_DIR}
+)
+
+# additional cmake files
+set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)
+# Qt *must* be detected before this one
+include(RazorInstallConfigPath)
+add_definitions(-DRAZOR_ETC_XDG_DIRECTORY=\"${RAZOR_ETC_XDG_DIRECTORY}\")
+include(RazorLibSuffix)
+
+# This allows to install and read the configs from non-standard locations
+add_definitions(-DSHARE_DIR=\"${CMAKE_INSTALL_PREFIX}/share/razor/\")
+
+message(STATUS "")
+get_filename_component(MAKE_PROGRAM_NAME ${CMAKE_MAKE_PROGRAM} NAME)
+message(STATUS "Developer documentation (doxygen) can be generated by '${MAKE_PROGRAM_NAME} doc'")
+message(STATUS "")
+
+message(STATUS "")
+message(STATUS "For building tests use -DBUILD_TESTS=Yes option.")
+message(STATUS "")
+
+########### Add uninstall target ###############
+CONFIGURE_FILE(
+    "${CMAKE_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
+    "${CMAKE_CURRENT_BINARY_DIR}/cmake/cmake_uninstall.cmake"
+    IMMEDIATE @ONLY)
+
+ADD_CUSTOM_TARGET(uninstall
+    "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake/cmake_uninstall.cmake")
+
+########## Add make dist target ################
+SET(CPACK_PACKAGE_VERSION "${RAZOR_VERSION}")
+SET(CPACK_SOURCE_GENERATOR "TBZ2")
+SET(CPACK_SOURCE_PACKAGE_FILE_NAME "razorqt-${CPACK_PACKAGE_VERSION}")
+SET(CPACK_IGNORE_FILES "/CVS/;/\\\\.git\;/\\\\.svn/;\\\\.swp$;\\\\.#;/#;\\\\.tar.gz$;/CMakeFiles/;CMakeCache.txt;refresh-copyright-and-license.pl")
+SET(CPACK_SOURCE_IGNORE_FILES ${CPACK_IGNORE_FILES})
+INCLUDE(CPack)
+# simulate autotools' "make dist"
+add_custom_target(dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source)
+
+# add_subdirectory( doxygen )
+
+# component specific part
+
 find_package(X11 REQUIRED)
 
 include_directories (
@@ -87,7 +168,7 @@ set(razorqt_MOCS
 )
 
 QT4_ADD_DBUS_INTERFACE(razorqt_SRCS
-    ../../razorqt-resources/dbus/org.freedesktop.Notifications.xml
+    dbus/org.freedesktop.Notifications.xml
     notifications_interface
 )
 
@@ -117,12 +198,9 @@ razor_translate_ts(RAZORQT_QM_FILES
 
 #************************************************
 
-
 QT4_WRAP_CPP(MOCS ${razorqt_MOCS})
 QT4_WRAP_UI(UIS ${razorqt_UIS})
 
-
-
 include(translatorsinfo/CMakeLists.txt)
 get_translatorsinfo_qrc(translatorsinfo_qrc)
 qt4_add_resources(QRC_CXX_SOURCES ${translatorsinfo_qrc})