grim/gplate

the start of the cmake transition

2010-06-26, Gary Kramlich
cc54f0826630
Parents 3ab8d04e9c94
Children 658bfafc88c5
the start of the cmake transition

the main library is built correctly, but all the other stuff needs to be converted as well

refs #11
--- a/.hgignore Sat Jun 19 21:23:50 2010 -0500
+++ b/.hgignore Sat Jun 26 10:56:18 2010 -0500
@@ -1,9 +1,6 @@
syntax: glob
*.a
*.bz2
-*.gcda
-*.gcno
-*.gcov
*.gz
*.la
*.lai
@@ -15,10 +12,12 @@
*.so*
*.zip
.*.swp
+CMakeCache.txt
+CMakeFiles
+cmake_install.cmake
doc/gplate/tmpl/*.bak
INSTALL
Makefile
-Makefile.in
syntax: regexp
.deps/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/CMakeLists.txt Sat Jun 26 10:56:18 2010 -0500
@@ -0,0 +1,42 @@
+cmake_minimum_required(VERSION 2.8)
+
+set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules)
+
+include(FindGlib)
+
+project(gplate)
+
+include_directories(gplate
+ ${CMAKE_SOURCE_DIR}
+ ${GLIB_INCLUDE_DIRS}
+ ${GMODULE_INCLUDE_DIRS}
+)
+
+link_directories(
+ ${GLIB_LIBRARY_DIRS}
+ ${GMODULE_LIBRARY_DIRS}
+)
+
+add_definitions(
+ -DGETTEXT_PACKAGE="gplate"
+ -DDATADIR="${CMAKE_INSTALL_PREFIX}/share"
+ -DLIBDIR="${CMAKE_INSTALL_PREFIX}/lib"
+ -DLOCALEDIR="${CMAKE_INSTALL_PREFIX}/locale"
+ -fPIC
+ -g -g3 -Wall
+)
+
+set(GPLATE_MAJOR_VERSION 0)
+set(GPLATE_MINOR_VERSION 0)
+set(GPLATE_MICRO_VERSION 3)
+set(GPLATE_EXTRA_VERSION dev)
+
+set(VERSION ${GPLATE_MAJOR_VERSION}.${GPLATE_MINOR_VERSION}.${GPLATE_MICRO_VERSION})
+if(GPLATE_EXTRA_VERSION)
+ set(VERSION ${VERSION}.${GPLATE_EXTRA_VERSION})
+endif(GPLATE_EXTRA_VERSION)
+
+configure_file(gplate.pc.in gplate.pc @ONLY)
+
+add_subdirectory(gplate)
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/cmake/Modules/FindGlib.cmake Sat Jun 26 10:56:18 2010 -0500
@@ -0,0 +1,34 @@
+include(FindPkgConfig)
+
+pkg_check_modules(GLIB REQUIRED
+ glib-2.0>=2.16.0
+ gobject-2.0>=2.16.0
+ gthread-2.0>=2.16.0
+)
+
+# we need glib-genmarshal and glib-mkenums
+find_program(GLIB_GENMARSHAL
+ NAMES glib-genmarshal
+ DOC "glib-genmarshal executable"
+)
+mark_as_advanced(GLIB_GENMARSHAL)
+
+find_program(GLIB_MKENUMS
+ NAMES glib-mkenums
+ DOC "glib-mkenums executable"
+)
+mark_as_advanced(GLIB_MKENUMS)
+
+# gmodule is in a separate variable so that our helper apps don't get linked to
+# it.
+pkg_check_modules(GMODULE REQUIRED
+ gmodule-2.0>=2.16.0
+)
+
+# now we need to find gtester
+find_program(GTESTER
+ NAMES gtester
+ DOC "gtester executable"
+)
+#add_executable("${GTESTER}" IMPORTED)
+#mark_as_advanced(GTESTER)
--- a/gplate.pc.in Sat Jun 19 21:23:50 2010 -0500
+++ b/gplate.pc.in Sat Jun 26 10:56:18 2010 -0500
@@ -1,4 +1,4 @@
-prefix=@prefix@
+prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include/gplate-1.0
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gplate/CMakeLists.txt Sat Jun 26 10:56:18 2010 -0500
@@ -0,0 +1,39 @@
+add_subdirectory(functions)
+add_subdirectory(tags)
+add_subdirectory(variables)
+
+set(GPLATE_HEADERS
+ gplate.h
+ gplate-collection.h
+ gplate-config.h
+ gplate-errors.h
+ gplate-function.h
+ gplate-iterator.h
+ gplate-library.h
+ gplate-tag.h
+ gplate-template.h
+ gplate-util.h
+ gplate-variable.h
+)
+
+add_library(gplate SHARED
+ gplate-collection.c
+ gplate-config.c
+ gplate-errors.c
+ gplate-function.c
+ gplate-iterator.c
+ gplate-library.c
+ gplate-tag.c
+ gplate-template.c
+ gplate-util.c
+ gplate-variable.c
+)
+
+target_link_libraries(gplate
+ ${GLIB_LIBRARIES}
+ ${GMODULE_LIBRARIES}
+ gplate-functions
+ gplate-tags
+ gplate-variables
+)
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gplate/functions/CMakeLists.txt Sat Jun 26 10:56:18 2010 -0500
@@ -0,0 +1,16 @@
+set(GPLATE_FUNCTIONS_HEADERS
+ gplate-for-function.h
+ gplate-include-function.h
+ gplate-noop-function.h
+ gplate-print-function.h
+ gplate-text-function.h
+)
+
+add_library(gplate-functions STATIC
+ gplate-for-function.c
+ gplate-include-function.c
+ gplate-noop-function.c
+ gplate-print-function.c
+ gplate-text-function.c
+)
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gplate/tags/CMakeLists.txt Sat Jun 26 10:56:18 2010 -0500
@@ -0,0 +1,14 @@
+set(GPLATE_TAGS_HEADERS
+ gplate-code-tag.h
+ gplate-comment-tag.h
+ gplate-text-tag.h
+ gplate-variable-tag.h
+)
+
+add_library(gplate-tags STATIC
+ gplate-code-tag.c
+ gplate-comment-tag.c
+ gplate-text-tag.c
+ gplate-variable-tag.c
+)
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gplate/variables/CMakeLists.txt Sat Jun 26 10:56:18 2010 -0500
@@ -0,0 +1,14 @@
+set(GPLATE_VARIABLES_HEADERS
+ gplate-dictionary-variable.h
+ gplate-directory-variable.h
+ gplate-file-variable.h
+ gplate-object-variable.h
+)
+
+add_library(gplate-variables STATIC
+ gplate-dictionary-variable.c
+ gplate-directory-variable.c
+ gplate-file-variable.c
+ gplate-object-variable.c
+)
+