Make focus_size depend on allocation size
[gregoa/zavai.git] / gtkfisheyelist / CMakeLists.txt
index 6de6e7ee6d927f7dd5b804f9193fee82ffdc8de4..05d24c8dfeedb6a137d2e6497946ce6f8ff86928 100644 (file)
@@ -1,46 +1,40 @@
 project(gtkfisheyelist)
-
-include(FindPkgConfig)
+include(../vala.cmake)
 
 set(gtkfisheyelist_version 0.1)
-set(VFLAGS -C --pkg gtk+-2.0)
-
-pkg_check_modules(GTK REQUIRED gtk+-2.0)
 
-find_program(VALAC valac)
+set(VALA_PACKAGES gtk+-2.0)
 
-file(GLOB fevala *.vala)
-string(REGEX REPLACE "^.+/(.+)\\.vala$" "${gtkfisheyelist_BINARY_DIR}/\\1.c" fesrc ${fevala})
-string(REGEX REPLACE "^.+/(.+)\\.vala$" "${gtkfisheyelist_BINARY_DIR}/\\1.h" fehdr ${fevala})
+add_packages(GFEL ${VALA_PACKAGES})
 
-add_custom_command(
-    DEPENDS ${fevala}
-    OUTPUT ${fesrc} ${fehdr}
-    COMMAND ${VALAC} ${VFLAGS} ${fevala}
-)
+set(VFLAGS --vapidir=${gtkfisheyelist_BINARY_DIR})
+add_definitions(-Wall -Werror -I${gtkfisheyelist_BINARY_DIR})
 
-add_definitions(-Wall -Werror ${GTK_CFLAGS})
-link_libraries(${GTK_LDFLAGS})
 
-set_source_files_properties(${fesrc} PROPERTIES GENERATED 1)
-set_source_files_properties(${fehdr} PROPERTIES GENERATED 1)
-
-add_library(gtkfisheyelist SHARED ${fesrc})
-add_library(gtkfisheyelist-static STATIC ${fesrc})
+file(GLOB fevala gtkfisheye*.vala)
+add_vala_library(gtkfisheyelist ${fevala})
+add_library(gtkfisheyelist SHARED ${gtkfisheyelist_CSOURCES})
+add_library(gtkfisheyelist-static STATIC ${gtkfisheyelist_CSOURCES})
 set_target_properties(gtkfisheyelist PROPERTIES VERSION ${gtkfisheyelist_version} SOVERSION 0 CLEAN_DIRECT_OUTPUT 1)
 set_target_properties(gtkfisheyelist-static PROPERTIES VERSION ${gtkfisheyelist_version} SOVERSION 0 OUTPUT_NAME "gtkfisheyelist" CLEAN_DIRECT_OUTPUT 1)
 
+set(VALA_PACKAGES ${VALA_PACKAGES} gtkfisheyelist)
+file(GLOB demovala demo*.vala)
+add_vala_program(gtkfisheyedemo ${demovala})
+add_executable(gtkfisheyedemo ${gtkfisheyedemo_CSOURCES})
+target_link_libraries(gtkfisheyedemo gtkfisheyelist-static)
+
 set(prefix "${CMAKE_INSTALL_PREFIX}")
 set(exec_prefix "${prefix}/bin")
 set(libdir "${prefix}/lib")
 set(includedir "${prefix}/include")
 configure_file(${gtkfisheyelist_SOURCE_DIR}/libgtkfisheyelist.pc.in ${gtkfisheyelist_BINARY_DIR}/libgtkfisheyelist.pc @ONLY)
 
-install(TARGETS gtkfisheyelist gtkfisheyelist-static
-  LIBRARY DESTINATION lib
-  ARCHIVE DESTINATION lib)
+#install(TARGETS gtkfisheyelist gtkfisheyelist-static
+#  LIBRARY DESTINATION lib
+#  ARCHIVE DESTINATION lib)
 
-install(FILES ${fehdr} DESTINATION include/gtkfisheyelist)
+#install(FILES gtkfisheyelist.h DESTINATION include/gtkfisheyelist)
 
-install(FILES ${gtkfisheyelist_BINARY_DIR}/libgtkfisheyelist.pc DESTINATION lib/pkgconfig)
+#install(FILES ${gtkfisheyelist_BINARY_DIR}/libgtkfisheyelist.pc DESTINATION lib/pkgconfig)