[evolution-data-server/wip/cmake] art + examples
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server/wip/cmake] art + examples
- Date: Fri, 23 Sep 2016 11:40:41 +0000 (UTC)
commit 70087e9bfc6e19e10c277b2c668aec1fa9747627
Author: Milan Crha <mcrha redhat com>
Date: Fri Sep 23 13:40:39 2016 +0200
art + examples
CMakeLists.txt | 9 +++--
art/CMakeLists.txt | 24 ++++++++++++++++
camel/tests/lib/CMakeLists.txt | 6 ++-
cmake/modules/GLibTools.cmake | 20 +++++++++++++
examples/CMakeLists.txt | 1 +
examples/cursor/CMakeLists.txt | 60 ++++++++++++++++++++++++++++++++++++++++
6 files changed, 114 insertions(+), 6 deletions(-)
---
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 769839a..4cf1335 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -862,7 +862,7 @@ print_build_options()
add_pkgconfig_file(evolution-data-server.pc.in evolution-data-server-${API_VERSION}.pc)
-#add_subdirectory(art)
+add_subdirectory(art)
add_subdirectory(addressbook)
add_subdirectory(calendar)
add_subdirectory(camel)
@@ -882,9 +882,10 @@ endif(HAVE_GTK)
#if(ENABLE_GTK_DOC)
# add_subdirectory(doc)
#endif(ENABLE_GTK_DOC)
-#if(ENABLE_EXAMPLES)
-# add_subdirectory(examples)
-#endif(ENABLE_EXAMPLES)
+
+if(ENABLE_EXAMPLES)
+ add_subdirectory(examples)
+endif(ENABLE_EXAMPLES)
#if(ENABLE_VALA_BINDINGS)
# add_subdirectory(vala)
diff --git a/art/CMakeLists.txt b/art/CMakeLists.txt
new file mode 100644
index 0000000..d74da56
--- /dev/null
+++ b/art/CMakeLists.txt
@@ -0,0 +1,24 @@
+set(IMAGES
+ category_birthday_16.png
+ category_business_16.png
+ category_favorites_16.png
+ category_gifts_16.png
+ category_goals_16.png
+ category_holiday_16.png
+ category_holiday-cards_16.png
+ category_hot-contacts_16.png
+ category_ideas_16.png
+ category_international_16.png
+ category_key-customer_16.png
+ category_miscellaneous_16.png
+ category_personal_16.png
+ category_phonecalls_16.png
+ category_status_16.png
+ category_strategies_16.png
+ category_suppliers_16.png
+ category_time-and-expenses_16.png
+)
+
+install(FILES ${IMAGES}
+ DESTINATION ${imagesdir}
+)
diff --git a/camel/tests/lib/CMakeLists.txt b/camel/tests/lib/CMakeLists.txt
index 92bff2c..ad70e44 100644
--- a/camel/tests/lib/CMakeLists.txt
+++ b/camel/tests/lib/CMakeLists.txt
@@ -12,7 +12,9 @@ set(SOURCES
address-data.h
)
-add_library(cameltest STATIC ${SOURCES})
+add_library(cameltest STATIC EXCLUDE_FROM_ALL
+ ${SOURCES}
+)
add_dependencies(cameltest camel)
@@ -38,7 +40,7 @@ target_link_libraries(cameltest
${CAMEL_LDFLAGS}
)
-add_library(cameltest-provider STATIC
+add_library(cameltest-provider STATIC EXCLUDE_FROM_ALL
camel-test-provider.c
camel-test-provider.h
)
diff --git a/cmake/modules/GLibTools.cmake b/cmake/modules/GLibTools.cmake
index 393a91c..d150ad3 100644
--- a/cmake/modules/GLibTools.cmake
+++ b/cmake/modules/GLibTools.cmake
@@ -194,3 +194,23 @@ endmacro(add_gsettings_schemas)
# execute_process(COMMAND cmake -E chdir . \"${GLIB_COMPILE_SCHEMAS}\"
\"${GSETTINGS_SCHEMAS_DIR}\")")
# endif(ENABLE_SCHEMAS_COMPILE)
#endmacro(compile_gsettings_schemas)
+
+find_program(GLIB_COMPILE_RESOURCES glib-compile-resources)
+if(NOT GLIB_COMPILE_RESOURCES)
+ message(FATAL_ERROR "Cannot find glib-compile-resources, which is required to build ${PROJECT_NAME}")
+endif(NOT GLIB_COMPILE_RESOURCES)
+
+macro(glib_compile_resources _outputprefix _cname _inxml)
+ add_custom_command(
+ OUTPUT ${_outputprefix}.h
+ COMMAND ${GLIB_COMPILE_RESOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/${_inxml}
--target=${_outputprefix}.h --sourcedir=${CMAKE_CURRENT_SOURCE_DIR} --c-name ${_cname} --generate-header
+ DEPENDS ${_inxml} ${ARGN}
+ VERBATIM
+ )
+ add_custom_command(
+ OUTPUT ${_outputprefix}.c
+ COMMAND ${GLIB_COMPILE_RESOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/${_inxml}
--target=${_outputprefix}.c --sourcedir=${CMAKE_CURRENT_SOURCE_DIR} --c-name ${_cname} --generate-source
+ DEPENDS ${_inxml} ${ARGN}
+ VERBATIM
+ )
+endmacro(glib_compile_resources)
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
new file mode 100644
index 0000000..6e75abc
--- /dev/null
+++ b/examples/CMakeLists.txt
@@ -0,0 +1 @@
+add_subdirectory(cursor)
\ No newline at end of file
diff --git a/examples/cursor/CMakeLists.txt b/examples/cursor/CMakeLists.txt
new file mode 100644
index 0000000..b7c6497
--- /dev/null
+++ b/examples/cursor/CMakeLists.txt
@@ -0,0 +1,60 @@
+set(DEPENDENCIES
+ ebook
+ ebook-contacts
+ edataserver
+)
+
+set(SOURCES
+ cursor-data.c
+ cursor-data.h
+ cursor-example.c
+ cursor-example.h
+ cursor-navigator.c
+ cursor-navigator.h
+ cursor-search.c
+ cursor-search.h
+ cursor-slot.c
+ cursor-slot.h
+ main.c
+ ${CMAKE_CURRENT_BINARY_DIR}/cursor-example-resources.c
+ ${CMAKE_CURRENT_BINARY_DIR}/cursor-example-resources.h
+)
+
+add_executable(cursor-example
+ ${SOURCES}
+)
+
+add_dependencies(cursor-example
+ ${DEPENDENCIES}
+)
+
+target_compile_definitions(cursor-example PRIVATE
+ -DG_LOG_DOMAIN=\"cursor-example\"
+ -DSRCDIR=\"${CMAKE_CURRENT_SOURCE_DIR}\"
+)
+
+target_compile_options(cursor-example PUBLIC
+ ${EXAMPLES_CFLAGS}
+)
+
+target_include_directories(cursor-example PUBLIC
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}/addressbook
+ ${CMAKE_SOURCE_DIR}
+ ${CMAKE_SOURCE_DIR}/addressbook
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${EXAMPLES_INCLUDE_DIRS}
+)
+
+target_link_libraries(cursor-example
+ ${DEPENDENCIES}
+ ${EXAMPLES_LDFLAGS}
+)
+
+set(UI_FILES
+ cursor-example.ui
+ cursor-search.ui
+ cursor-slot.ui
+)
+
+glib_compile_resources(cursor-example-resources _cursor_example cursor-example.gresources.xml ${UI_FILES})
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]