cmake support
authordmacvicar <dmacvicar@e0cc52ee-31ee-0310-8b87-e83c4596d67c>
Tue, 13 Nov 2007 13:13:03 +0000 (13:13 +0000)
committerdmacvicar <dmacvicar@e0cc52ee-31ee-0310-8b87-e83c4596d67c>
Tue, 13 Nov 2007 13:13:03 +0000 (13:13 +0000)
git-svn-id: http://svn.opensuse.org/svn/yast/branches/tmp/sh/mod-ui/web-wt@42008 e0cc52ee-31ee-0310-8b87-e83c4596d67c

CMakeLists.txt [new file with mode: 0644]
VERSION.cmake [new file with mode: 0644]
cmake/modules/FindWt.cmake [new file with mode: 0644]
cmake/modules/FindYast.cmake [new file with mode: 0644]
src/CMakeLists.txt [new file with mode: 0644]

diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644 (file)
index 0000000..812b731
--- /dev/null
@@ -0,0 +1,82 @@
+PROJECT(yast2-webui)
+
+SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O3 -Wall -Woverloaded-virtual" )
+SET( CMAKE_C_FLAGS   "${CMAKE_C_FLAGS}   -g -O3 -Wall" )
+
+# Library
+IF ( DEFINED LIB )
+  SET ( LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${LIB}" )
+ELSE ( DEFINED  LIB )
+  IF (CMAKE_SIZEOF_VOID_P MATCHES "8")
+    SET( LIB_SUFFIX "64" )
+  ENDIF(CMAKE_SIZEOF_VOID_P MATCHES "8")
+  SET ( LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}" )
+ENDIF ( DEFINED  LIB )
+MESSAGE(STATUS "Libraries will be installed in ${LIB_INSTALL_DIR}" )
+
+# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked
+SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH})
+#SET(CMAKE_MODULE_PATH ${CMAKE_INSTALL_PREFIX}/share/cmake/Modules ${CMAKE_MODULE_PATH})
+
+SET( PACKAGE "yast2-web" )
+INCLUDE(${CMAKE_SOURCE_DIR}/VERSION.cmake)
+SET ( VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}" )
+
+SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Web UI for YaST")
+SET(CPACK_PACKAGE_VENDOR "Novell Inc.")
+#SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/ReadMe.txt")
+#SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt")
+SET(CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR})
+SET(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR})
+SET(CPACK_PACKAGE_VERSION_PATCH ${VERSION_PATCH})
+
+SET( CPACK_GENERATOR "TBZ2")
+SET( CPACK_SOURCE_GENERATOR "TBZ2")
+SET( CPACK_SOURCE_PACKAGE_FILE_NAME "${PACKAGE}-${VERSION}" )
+
+# The following components are regex's to match anywhere (unless anchored)
+# in absolute path + filename to find files or directories to be excluded
+# from source tarball.
+SET (CPACK_SOURCE_IGNORE_FILES
+"/CVS/;/.svn/;/.libs/;/.deps/;.swp$;.#;/#;/build/"
+"~$"
+"\\\\.cvsignore$"
+"/package"
+"Makefile\\\\.in$"
+)
+
+INCLUDE(CPack)
+
+FIND_PACKAGE(Wt REQUIRED)
+FIND_PACKAGE(Yast REQUIRED)
+
+####################################################################
+# RPM SPEC                                                         #
+####################################################################
+MESSAGE(STATUS "Writing spec file...")
+CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/${PACKAGE}.spec.in ${CMAKE_BINARY_DIR}/package/${PACKAGE}.spec @ONLY)
+
+ADD_SUBDIRECTORY(src)
+
+INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
+
+ADD_CUSTOM_TARGET( svncheck
+  COMMAND cd $(CMAKE_SOURCE_DIR) && ! LC_ALL=C svn status --show-updates --quiet | grep -v '^Status against revision'
+)
+
+SET( AUTOBUILD_COMMAND
+  COMMAND ${CMAKE_MAKE_PROGRAM} package_source
+  COMMAND ${CMAKE_COMMAND} -E copy ${CPACK_SOURCE_PACKAGE_FILE_NAME}.tar.bz2 ${CMAKE_BINARY_DIR}/package
+  COMMAND ${CMAKE_COMMAND} -E remove ${CPACK_SOURCE_PACKAGE_FILE_NAME}.tar.bz2
+  COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_SOURCE_DIR}/package/${PACKAGE}.changes" "${CMAKE_BINARY_DIR}/package/${PACKAGE}.changes"
+)
+
+ADD_CUSTOM_TARGET( autobuild_local
+  ${AUTOBUILD_COMMAND}
+)
+
+ADD_CUSTOM_TARGET( autobuild
+  COMMAND ${CMAKE_MAKE_PROGRAM} svncheck
+  ${AUTOBUILD_COMMAND}
+)
+
diff --git a/VERSION.cmake b/VERSION.cmake
new file mode 100644 (file)
index 0000000..2d03438
--- /dev/null
@@ -0,0 +1,3 @@
+SET(VERSION_MAJOR "0")
+SET(VERSION_MINOR "1")
+SET(VERSION_PATCH "0")
\ No newline at end of file
diff --git a/cmake/modules/FindWt.cmake b/cmake/modules/FindWt.cmake
new file mode 100644 (file)
index 0000000..0001e74
--- /dev/null
@@ -0,0 +1,37 @@
+
+if(WT_INCLUDE_DIR AND WT_LIBRARY AND WT_LIBRARY_HTTP)
+  # Already in cache, be silent
+  set(WT_FIND_QUIETLY TRUE)  
+endif(WT_INCLUDE_DIR AND WT_LIBRARY AND WT_LIBRARY_HTTP)
+
+set(WT_LIBRARY)
+set(WT_INCLUDE_DIR)
+set(WT_LIBRARY_HTTP)
+
+FIND_PATH(WT_INCLUDE_DIR WObject
+  ${CMAKE_INSTALL_PREFIX}/include
+  /usr/include
+  /usr/local/include
+)
+
+FIND_LIBRARY(WT_LIBRARY NAMES wt
+  PATHS
+  /usr/lib
+  /usr/local/lib
+)
+
+FIND_LIBRARY(WT_HTTP_LIBRARY NAMES wthttp
+  PATHS
+  /usr/lib
+  /usr/local/lib
+)
+
+
+if(WT_INCLUDE_DIR AND WT_LIBRARY AND WT_HTTP_LIBRARY)
+   MESSAGE( STATUS "Wt found: includes in ${WT_INCLUDE_DIR}, library in ${WT_LIBRARY}")
+   set(WT_FOUND TRUE)
+else(WT_INCLUDE_DIR AND WT_LIBRARY AND WT_HTTP_LIBRARY)
+   MESSAGE( STATUS "Wt not found")
+endif(WT_INCLUDE_DIR AND WT_LIBRARY AND WT_HTTP_LIBRARY)
+
+MARK_AS_ADVANCED(WT_INCLUDE_DIR WT_LIBRARY WT_HTTP_LIBRARY)
diff --git a/cmake/modules/FindYast.cmake b/cmake/modules/FindYast.cmake
new file mode 100644 (file)
index 0000000..af17e0a
--- /dev/null
@@ -0,0 +1,62 @@
+
+if(YAST_INCLUDE_DIR AND YAST_LIBRARY AND YAST_YCP_LIBRARY)
+  # Already in cache, be silent
+  set(YAST_FIND_QUIETLY TRUE)  
+endif(YAST_INCLUDE_DIR AND YAST_LIBRARY AND YAST_YCP_LIBRARY)
+
+set(YAST_LIBRARY)
+set(YAST_INCLUDE_DIR)
+set(YAST_YCP_LIBRARY)
+
+FIND_PATH(YAST_INCLUDE_DIR Y2.h
+  ${CMAKE_INSTALL_PREFIX}/include/YaST2
+  /usr/include/YaST2
+  /usr/local/include/YaST2
+)
+
+SET(YAST_PLUGIN_DIR ${LIB_INSTALL_DIR}/YaST2/plugin)
+
+FIND_LIBRARY(YAST_LIBRARY NAMES y2
+  PATHS
+  /usr/lib
+  /usr/local/lib
+)
+
+FIND_LIBRARY(YAST_YCP_LIBRARY NAMES ycp
+  PATHS
+  /usr/lib
+  /usr/local/lib
+)
+
+FIND_LIBRARY(YAST_PLUGIN_WFM_LIBRARY NAMES py2wfm
+  PATHS
+  /usr/lib/YaST2/plugin
+  ${YAST_PLUGIN_DIR}
+  /usr/lib
+  /usr/local/lib
+)
+
+FIND_LIBRARY(YAST_PLUGIN_UI_LIBRARY NAMES py2UI
+  PATHS
+  /usr/lib/YaST2/plugin
+  ${YAST_PLUGIN_DIR}
+  /usr/lib
+  /usr/local/lib
+)
+
+FIND_LIBRARY(YAST_PLUGIN_SCR_LIBRARY NAMES py2scr
+  PATHS
+  ${YAST_PLUGIN_DIR}
+  /usr/lib
+  /usr/local/lib
+)
+
+if(YAST_INCLUDE_DIR AND YAST_LIBRARY AND YAST_YCP_LIBRARY)
+   MESSAGE( STATUS "YaST2 found: includes in ${YAST_INCLUDE_DIR}, library in ${YAST_LIBRARY}")
+   MESSAGE( STATUS "             plugins in ${YAST_PLUGIN_DIR}")
+   set(YAST_FOUND TRUE)
+else(YAST_INCLUDE_DIR AND YAST_LIBRARY AND YAST_YCP_LIBRARY)
+   MESSAGE( STATUS "YaST2 not found")
+endif(YAST_INCLUDE_DIR AND YAST_LIBRARY AND YAST_YCP_LIBRARY)
+
+MARK_AS_ADVANCED(YAST_INCLUDE_DIR YAST_LIBRARY YAST_YCP_LIBRARY YAST_PLUGIN_WFM_LIBRARY YAST_PLUGIN_UI_LIBRARY )
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
new file mode 100644 (file)
index 0000000..1b37a3d
--- /dev/null
@@ -0,0 +1,32 @@
+
+ADD_DEFINITIONS(-DY2LOG=\\\"WEBUI\\\")
+
+SET(yast_web_module_SRCS
+  YCP.cc
+  Y2RubyTypeConv.cc
+  RubyLogger.cc
+  RubyLogger.h
+)
+
+SET(web_yast_plugin_SRCS
+  Y2CCWeb.cc YWebApplication.cc YWebUI_builtins.cc YWebUI_core.cc YWebUI_widgets.cc YWebWidgetFactory.cc
+)
+  
+SET(web_yast_plugin_HEADERS
+  Y2CCWeb.h YWebDialog.h YWebLabel.h YWebPushButton.h YWebSplit.h YWebUIComponent.h YWebUI.h YWebWidget.h
+)
+  
+INCLUDE_DIRECTORIES( ${WT_INCLUDE_PATH} )
+INCLUDE_DIRECTORIES( ${YAST_INCLUDE_DIR} )
+INCLUDE_DIRECTORIES( ${YAST_INCLUDE_DIR}/yui )
+
+ADD_LIBRARY( py2web SHARED ${web_yast_plugin_SRCS})
+TARGET_LINK_LIBRARIES( py2web ${YAST_LIBRARY} )
+TARGET_LINK_LIBRARIES( py2web ${YAST_YCP_LIBRARY} )
+TARGET_LINK_LIBRARIES( py2web ${YAST_PLUGIN_WFM_LIBRARY} )
+TARGET_LINK_LIBRARIES( py2web ${WT_LIBRARY} )
+TARGET_LINK_LIBRARIES( py2web ${YAST_PLUGIN_UI_LIBRARY} )
+INSTALL(TARGETS py2web LIBRARY DESTINATION ${YAST_PLUGIN_DIR} )
+
+#SET_TARGET_PROPERTIES( y2lang_web PROPERTIES PREFIX "" )
\ No newline at end of file