Make focus_size depend on allocation size
[gregoa/zavai.git] / gtkfisheyelist / CMakeLists.txt
index 5549f3ab851ffd88203c1e7017943c60c844e395..05d24c8dfeedb6a137d2e6497946ce6f8ff86928 100644 (file)
@@ -1,46 +1,27 @@
 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 gtkfisheye*.vala)
-file(RELATIVE_PATH fesrc ${gtkfisheyelist_SOURCE_DIR} ${fevala})
-string(REGEX REPLACE "\\.vala$" ".c" fesrc ${fesrc})
-
-file(GLOB demovala demo*.vala)
-file(RELATIVE_PATH demosrc ${gtkfisheyelist_SOURCE_DIR} ${demovala})
-string(REGEX REPLACE "\\.vala$" ".c" demosrc ${demosrc})
+add_packages(GFEL ${VALA_PACKAGES})
 
-add_custom_command(
-    DEPENDS ${fevala}
-    OUTPUT ${fesrc} gtkfisheyelist.h gtkfisheyelist.vapi
-    COMMAND ${VALAC} ${VFLAGS} -H gtkfisheyelist.h --library=gtkfisheyelist ${fevala}
-)
+set(VFLAGS --vapidir=${gtkfisheyelist_BINARY_DIR})
+add_definitions(-Wall -Werror -I${gtkfisheyelist_BINARY_DIR})
 
-add_custom_command(
-    DEPENDS ${demovala}
-    OUTPUT ${demosrc} ${demohdr}
-    COMMAND ${VALAC} ${VFLAGS} --pkg=gtkfisheyelist --vapidir=${gtkfisheyelist_BINARY_DIR} ${demovala}
-)
 
-add_definitions(-Wall -Werror ${GTK_CFLAGS} -I${gtkfisheyelist_BINARY_DIR})
-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)
 
-add_executable(gtkfisheyedemo ${demosrc})
+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}")
@@ -49,11 +30,11 @@ 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)