Permalink
Browse files

Convert to use cmake-modules-webos

Open-webOS-DCO-1.0-Signed-off-by: Sapna Todwal <sapna.todwal@palm.com>

Change-Id: I610ff756a4821ff830c313058bd4a10a01b3271c
  • Loading branch information...
1 parent e6012b6 commit 1bc8d001d567ef6645fed2c0b81283aa9ac122a2 Sapna Todwal committed Oct 4, 2012
Showing with 142 additions and 87 deletions.
  1. +16 −18 .gitignore
  2. +40 −4 CMakeLists.txt
  3. +49 −46 README.md
  4. +6 −6 doc/client_api.doxy.in
  5. +6 −6 doc/module_api.doxy.in
  6. +25 −7 files/pkgconfig/nyx.pc.in
  7. 0 src/{config → core}/nyx_config.h.in
View
@@ -1,6 +1,6 @@
# @@@LICENSE
#
-# Copyright (c) 2010-2012 Hewlett-Packard Development Company, L.P.
+# Copyright (c) 2012 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -16,22 +16,20 @@
#
# LICENSE@@@
-cscope.out
-*.so
-*.o
-*.d
-*.so
-.cscope.files
-.sc_status
-*.swp
-/Debug
+# .gitignore for components that enforce "out-of-source" builds, (e.g. ones that
+# use "cmake-modules-webos")
+#
+# @@@VERSION
+# r3
+# VERSION@@@
+
+# Common Eclipse project files
.project
.cproject
-/patches
-/build*
-/BUILD*
-/doc
-*.DS_Store
-include/nyx/common/nyx_version.h
-src/config/nyx_config.h
-src/config/nyx.pc
+
+# Directory created by OpenEmbedded
+patches/
+
+# Ignore all build directories and their trees. This should exclude all
+# build artifacts.
+BUILD*/
View
@@ -16,12 +16,48 @@
#
# LICENSE@@@
-cmake_minimum_required(VERSION 2.6)
+cmake_minimum_required(VERSION 2.8.7)
-project(Nyx)
+project(nyx)
-set(NYX_LIBRARY_VERSION "2.0.0")
set(NYX_API_VERSION_MAJOR 2)
set(NYX_API_VERSION_MINOR 0)
-add_subdirectory(src)
+include(webOS/webOS)
+webos_modules_init(1 0 0 QUALIFIER RC4)
+webos_component(${NYX_API_VERSION_MAJOR} ${NYX_API_VERSION_MINOR} 0)
+
+set(NYX_MODULE_DIR ${WEBOS_INSTALL_LIBDIR}/nyx/modules CACHE PATH "Nyx modules directory path")
+set(NYX_MODULE_MOCK_DIR ${WEBOS_INSTALL_LIBDIR}/nyx/modules.mock CACHE PATH "Nyx mock modules directory path")
+
+webos_add_linker_options(ALL --no-undefined --as-needed)
+webos_add_compiler_flags(ALL -Wall -g -std=c99)
+webos_add_compiler_flags(ALL -D_GNU_SOURCE=1)
+webos_add_compiler_flags(DEBUG -O0 -DDEBUG -D_DEBUG)
+webos_add_compiler_flags(RELEASE -DNDEBUG)
+
+add_definitions(-DNYX_MODULE_PREFIX=\"${CMAKE_SHARED_MODULE_PREFIX}\")
+add_definitions(-DNYX_MODULE_SUFFIX=\"${CMAKE_SHARED_MODULE_SUFFIX}\")
+add_definitions(-DNYX_MODULE_DIR=\"${NYX_MODULE_DIR}\")
+add_definitions(-DNYX_MODULE_MOCK_DIR=\"${NYX_MODULE_MOCK_DIR}\")
+
+include(FindPkgConfig)
+
+#Check that we have glib-2.0
+pkg_check_modules(GLIB2 REQUIRED glib-2.0)
+include_directories(${GLIB2_INCLUDE_DIRS})
+webos_add_compiler_flags(ALL ${GLIB2_CFLAGS_OTHER})
+
+webos_configure_header_files(src/core)
+webos_configure_header_files(include/public INSTALL)
+
+include_directories(include/public src/core)
+
+file(GLOB NYX_SOURCE src/core/*.c src/device/*.c src/utils/*.c)
+add_library(nyx SHARED ${NYX_SOURCE})
+target_link_libraries(nyx ${GLIB2_LIBRARIES} dl pthread rt)
+
+webos_build_pkgconfig()
+webos_build_library()
+
+webos_config_build_doxygen(doc module_api.doxy client_api.doxy)
View
@@ -1,5 +1,11 @@
nyx-lib
=======
+Summary
+-------
+Open webOS Platform Portability Layer
+
+Description
+-----------
Nyx is the platform portability layer used to isolate the remainder of
Open webOS from dependencies on the hardware and core OS upon which it
@@ -14,87 +20,83 @@ How to Build on Linux
## Dependencies
-Below are the tools and library (and their minimum versions) required to
-build nyx-lib:
+Below are the tools and libraries (and their minimum versions) required to build nyx-lib:
-* cmake 2.6
-* gcc 4.3
-* glib-2.0 2.16
+* cmake (version required by openwebos/cmake-modules-webos)
+* gcc 4.6.3
+* glib-2.0 2.32.1
* make (any version)
-* pkg-config 0.22
+* openwebos/cmake-modules-webos 1.0.0 RC3
+* pkg-config 0.26
## Building
-Once you have downloaded the source, execute the following to build it:
+Once you have downloaded the source, enter the following to build it (after
+changing into the directory under which it was downloaded):
$ mkdir BUILD
$ cd BUILD
$ cmake ..
$ make
$ sudo make install
-The header files will be installed under
+The directory under which the files are installed defaults to `/usr/local/webos`.
+You can install them elsewhere by supplying a value for `WEBOS_INSTALL_ROOT`
+when invoking `cmake`. For example:
- /usr/local/include/nyx
+ $ cmake -D WEBOS_INSTALL_ROOT:PATH=$HOME/projects/openwebos ..
+ $ make
+ $ make install
-and the libraries under
+will install the files in subdirectories of `$HOME/projects/openwebos`.
- /usr/local/lib
+Specifying `WEBOS_INSTALL_ROOT` also causes `pkg-config` to look in that tree
+first before searching the standard locations. You can specify additional
+directories to be searched prior to this one by setting the `PKG_CONFIG_PATH`
+environment variable.
-You can install it elsewhere by supplying a value for _CMAKE\_INSTALL\_PREFIX_
-when invoking _cmake_. For example:
+If not specified, `WEBOS_INSTALL_ROOT` defaults to `/usr/local/webos`.
- $ cmake -D CMAKE_INSTALL_PREFIX:STRING=$HOME/projects/openwebos ..
- $ make
- $ make install
-
-will install the header files under
+To configure for a debug build, enter:
- $HOME/projects/openwebos/include/nyx
-
-and the libraries under
+ $ cmake -D CMAKE_BUILD_TYPE:STRING=Debug ..
- $HOME/projects/openwebos/lib
-
-directory.
+To see a list of the make targets that `cmake` has generated, enter:
-## Generating documentation
+ $ make help
-Nyx generates two sets of documentation, reflecting that fact that it the APIs
-it presents to application and module writers are different.
+## Uninstalling
-The tool required to generate the documentation is:
+From the directory where you originally ran `make install`, enter:
-* doxygen 1.6.3
-* graphviz 2.20.2
+ $ [sudo] make uninstall
-Once you have run cmake, execute the following to generate the documentation:
+You will need to use `sudo` if you did not specify `WEBOS_INSTALL_ROOT`.
-$ make docs
+## Generating documentation
-To view the generated HTML documentation, point your browser to either of the
-following
+## Generating Documentation
- doc/module_api/html/index.html
- doc/client_api/html/index.html
+The tools required to generate the documentation are:
-in your build directory.
+- doxygen 1.7.6.1
+- graphviz 2.26.3
-Just as you can do out-of-tree builds, Nyx allows you to place the documentation
-files anywhere you wish by overriding the NYX_DOC_LOCATION variable on the cmake
-command line. For example,
+Once you have run `cmake`, enter the following to generate the documentation:
- $ cmake -D NYX_DOC_LOCATION:PATH=$HOME/documentation/nyx-lib ..
$ make docs
-will place the documentation directories (module_api and client_api) under the
+To view the generated HTML documentation, point your browser to
+`Documentation/<project-name>/html/index.html`
- $HOME/documentation/nyx-lib
+To install the generated documentation, enter:
-directory.
+ $ [sudo] make install-docs
-The provided path may be absolute or relative. Relative paths are 'relative' to
-the build directory.
+The documentation will be installed to `usr/share/doc/<project-name>/html` under
+the tree defined by the value of `WEBOS_INSTALL_ROOT` (or its default).
+
+You will need to use `sudo` if you did not specify `WEBOS_INSTALL_ROOT`.
# Copyright and License Information
@@ -117,3 +119,4 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
+
View
@@ -43,19 +43,19 @@ DOXYFILE_ENCODING = UTF-8
# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
# by quotes) that should identify the project.
-PROJECT_NAME = "@CMAKE_PROJECT_NAME@ (For Library Clients)"
+PROJECT_NAME = "@CMAKE_PROJECT_NAME@ (For library clients)"
# The PROJECT_NUMBER tag can be used to enter a project or revision number.
# This could be handy for archiving the generated documentation or
# if some version control system is used.
-PROJECT_NUMBER = @NYX_LIBRARY_VERSION@
+PROJECT_NUMBER = @WEBOS_COMPONENT_VERSION@
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer
# a quick idea about the purpose of the project. Keep the description short.
-PROJECT_BRIEF = "Nyx is the webOS portability layer used to isolate the remainder of webOS from dependencies on the hardware and core OS upon which it is running."
+PROJECT_BRIEF = @WEBOS_PROJECT_SUMMARY@
# With the PROJECT_LOGO tag one can specify an logo or icon that is
# included in the documentation. The maximum height of the logo should not
@@ -630,8 +630,8 @@ WARN_LOGFILE =
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
-INPUT = @CMAKE_SOURCE_DIR@/include/nyx/client \
- @CMAKE_SOURCE_DIR@/include/nyx/common
+INPUT = @CMAKE_SOURCE_DIR@/include/public/nyx/client \
+ @CMAKE_SOURCE_DIR@/include/public/nyx/common
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
@@ -1423,7 +1423,7 @@ SEARCH_INCLUDES = YES
# contain include files that are not input files but should be processed by
# the preprocessor.
-INCLUDE_PATH = @CMAKE_SOURCE_DIR@/include/nyx
+INCLUDE_PATH = @CMAKE_SOURCE_DIR@/include/public/nyx
# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
# patterns (like *.h and *.hpp) to filter out the header-files in the
View
@@ -43,19 +43,19 @@ DOXYFILE_ENCODING = UTF-8
# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
# by quotes) that should identify the project.
-PROJECT_NAME = "@CMAKE_PROJECT_NAME@ (For Module Authors)"
+PROJECT_NAME = "@CMAKE_PROJECT_NAME@ (For module authors)"
# The PROJECT_NUMBER tag can be used to enter a project or revision number.
# This could be handy for archiving the generated documentation or
# if some version control system is used.
-PROJECT_NUMBER = @NYX_LIBRARY_VERSION@
+PROJECT_NUMBER = @WEBOS_COMPONENT_VERSION@
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer
# a quick idea about the purpose of the project. Keep the description short.
-PROJECT_BRIEF = "Nyx is the webOS portability layer used to isolate the remainder of webOS from dependencies on the hardware and core OS upon which it is running."
+PROJECT_BRIEF = @WEBOS_PROJECT_SUMMARY@
# With the PROJECT_LOGO tag one can specify an logo or icon that is
# included in the documentation. The maximum height of the logo should not
@@ -630,8 +630,8 @@ WARN_LOGFILE =
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
-INPUT = @CMAKE_SOURCE_DIR@/include/nyx/module \
- @CMAKE_SOURCE_DIR@/include/nyx/common
+INPUT = @CMAKE_SOURCE_DIR@/include/public/nyx/module \
+ @CMAKE_SOURCE_DIR@/include/public/nyx/common
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
@@ -1423,7 +1423,7 @@ SEARCH_INCLUDES = YES
# contain include files that are not input files but should be processed by
# the preprocessor.
-INCLUDE_PATH = @CMAKE_SOURCE_DIR@/include/nyx
+INCLUDE_PATH = @CMAKE_SOURCE_DIR@/include/public/nyx
# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
# patterns (like *.h and *.hpp) to filter out the header-files in the
View
@@ -1,10 +1,28 @@
-prefix=@CMAKE_INSTALL_PREFIX@
-exec_prefix=${prefix}
-libdir=${exec_prefix}/lib
-includedir=${prefix}/include
+# @@@LICENSE
+#
+# Copyright (c) 2010-2012 Hewlett-Packard Development Company, L.P.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# LICENSE@@@
+
+libdir=@WEBOS_INSTALL_LIBDIR@
+includedir=@WEBOS_INSTALL_INCLUDEDIR@
+nyx_module_dir=@NYX_MODULE_DIR@
+nyx_module_mock_dir=@NYX_MODULE_MOCK_DIR@
Name: Nyx
-Description: Open webOS Portability Layer
-Version: @NYX_LIBRARY_VERSION@
-Libs: -L${libdir} -lnyx
+Description: @WEBOS_PROJECT_SUMMARY@
+Version: @WEBOS_COMPONENT_VERSION@
+Libs: -L${libdir} -l@CMAKE_PROJECT_NAME@
Cflags: -I${includedir}
File renamed without changes.

0 comments on commit 1bc8d00

Please sign in to comment.