aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRobert Tari <robert@tari.in>2021-06-08 15:51:25 +0200
committerRobert Tari <robert@tari.in>2021-06-08 15:51:25 +0200
commit54f117490ba595a437ea2255689127a9d118284c (patch)
tree0bfaabedaa2ecef44bca504840fc64d11f65e43c /src
parente11bf6e8d7795cb76fea3b83ed1d6fed5a86e1b9 (diff)
parent7f9c75d88fe6d9f710d60885253b0c748cf096d8 (diff)
downloadayatana-ido-54f117490ba595a437ea2255689127a9d118284c.tar.gz
ayatana-ido-54f117490ba595a437ea2255689127a9d118284c.tar.bz2
ayatana-ido-54f117490ba595a437ea2255689127a9d118284c.zip
Merge branch 'sunweaver-pr/conditional-build-of-GIR-and-VAPI'
Attributes GH PR #42: https://github.com/AyatanaIndicators/ayatana-ido/pull/42
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt159
1 files changed, 84 insertions, 75 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 36132fe..9894f90 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -7,14 +7,14 @@
# idotimeline.h
# libayatana-ido.h
-install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/ayatanamenuitemfactory.h" DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/libayatana-ido3-0.4/libayatana-ido")
-install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/idocalendarmenuitem.h" DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/libayatana-ido3-0.4/libayatana-ido")
-install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/idoentrymenuitem.h" DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/libayatana-ido3-0.4/libayatana-ido")
-install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/idorange.h" DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/libayatana-ido3-0.4/libayatana-ido")
-install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/idoscalemenuitem.h" DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/libayatana-ido3-0.4/libayatana-ido")
-install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/idoswitchmenuitem.h" DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/libayatana-ido3-0.4/libayatana-ido")
-install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/idotimeline.h" DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/libayatana-ido3-0.4/libayatana-ido")
-install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/libayatana-ido.h" DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/libayatana-ido3-0.4/libayatana-ido")
+install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/ayatanamenuitemfactory.h" DESTINATION "${CMAKE_INSTALL_FULL_INCLUDEDIR}/libayatana-ido3-0.4/libayatana-ido")
+install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/idocalendarmenuitem.h" DESTINATION "${CMAKE_INSTALL_FULL_INCLUDEDIR}/libayatana-ido3-0.4/libayatana-ido")
+install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/idoentrymenuitem.h" DESTINATION "${CMAKE_INSTALL_FULL_INCLUDEDIR}/libayatana-ido3-0.4/libayatana-ido")
+install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/idorange.h" DESTINATION "${CMAKE_INSTALL_FULL_INCLUDEDIR}/libayatana-ido3-0.4/libayatana-ido")
+install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/idoscalemenuitem.h" DESTINATION "${CMAKE_INSTALL_FULL_INCLUDEDIR}/libayatana-ido3-0.4/libayatana-ido")
+install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/idoswitchmenuitem.h" DESTINATION "${CMAKE_INSTALL_FULL_INCLUDEDIR}/libayatana-ido3-0.4/libayatana-ido")
+install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/idotimeline.h" DESTINATION "${CMAKE_INSTALL_FULL_INCLUDEDIR}/libayatana-ido3-0.4/libayatana-ido")
+install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/libayatana-ido.h" DESTINATION "${CMAKE_INSTALL_FULL_INCLUDEDIR}/libayatana-ido3-0.4/libayatana-ido")
set(HEADERS
idorange.h
@@ -102,75 +102,84 @@ target_include_directories("ayatana-ido3-0.4" PUBLIC ${PROJECT_DEPS_INCLUDE_DIRS
target_include_directories("ayatana-ido3-0.4" PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
target_include_directories("ayatana-ido3-0.4" PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_compile_definitions("ayatana-ido3-0.4" PUBLIC G_LOG_DOMAIN="IDO")
-install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libayatana-ido3-0.4.so" DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
-install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libayatana-ido3-0.4.so.0" DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
-install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libayatana-ido3-0.4.so.0.0.0" DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libayatana-ido3-0.4.so" DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}")
+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libayatana-ido3-0.4.so.0" DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}")
+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libayatana-ido3-0.4.so.0.0.0" DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}")
# ayatana-ido3-0.4.gir
-set(HEADERS
- idocalendarmenuitem.h
- idoentrymenuitem.h
- idorange.h
- idoscalemenuitem.h
- idoswitchmenuitem.h
- idotimeline.h
-)
-
find_package(GObjectIntrospection REQUIRED QUIET)
-add_custom_command(
- OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/AyatanaIdo3-0.4.gir"
- DEPENDS "ayatana-ido3-0.4"
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
- COMMAND
- ${INTROSPECTION_SCANNER}
- ${SOURCES} ${HEADERS}
- --symbol-prefix=ido
- --identifier-prefix=Ido
- --namespace=AyatanaIdo3
- --nsversion=0.4
- --quiet
- --pkg=gtk+-3.0
- --warn-all
- --include=Gtk-3.0
- --library="ayatana-ido3-0.4"
- --library-path=${CMAKE_CURRENT_BINARY_DIR}
- --output "${CMAKE_CURRENT_BINARY_DIR}/AyatanaIdo3-0.4.gir"
-)
-
-install(FILES "${CMAKE_CURRENT_BINARY_DIR}/AyatanaIdo3-0.4.gir" DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATADIR}/gir-1.0")
-
-# ayatana-ido3-0.4.typelib
-
-add_custom_command(
- OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/AyatanaIdo3-0.4.typelib"
- DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/AyatanaIdo3-0.4.gir"
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
- COMMAND
- ${INTROSPECTION_COMPILER}
- --includedir=${CMAKE_CURRENT_BINARY_DIR}
- ${CMAKE_CURRENT_BINARY_DIR}/AyatanaIdo3-0.4.gir
- -o "${CMAKE_CURRENT_BINARY_DIR}/AyatanaIdo3-0.4.typelib"
-)
-
-install(FILES "${CMAKE_CURRENT_BINARY_DIR}/AyatanaIdo3-0.4.typelib" DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/girepository-1.0")
-
-# ayatana-ido3-0.4.vapi
-
-find_package(Vala REQUIRED QUIET)
-
-add_custom_command(
- OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/AyatanaIdo3-0.4.vapi"
- DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/AyatanaIdo3-0.4.typelib"
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
- COMMAND
- ${VAPI_GEN}
- --library=AyatanaIdo3-0.4
- --pkg gtk+-3.0
- AyatanaIdo3-0.4.gir
-)
-
-install(FILES "${CMAKE_CURRENT_BINARY_DIR}/AyatanaIdo3-0.4.vapi" DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATADIR}/vala/vapi")
-
-add_custom_target("src" ALL DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/AyatanaIdo3-0.4.vapi")
+if (INTROSPECTION_FOUND)
+
+ set(HEADERS
+ idocalendarmenuitem.h
+ idoentrymenuitem.h
+ idorange.h
+ idoscalemenuitem.h
+ idoswitchmenuitem.h
+ idotimeline.h
+ )
+
+ add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/AyatanaIdo3-0.4.gir"
+ DEPENDS "ayatana-ido3-0.4"
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ COMMAND
+ ${INTROSPECTION_SCANNER}
+ ${SOURCES} ${HEADERS}
+ --symbol-prefix=ido
+ --identifier-prefix=Ido
+ --namespace=AyatanaIdo3
+ --nsversion=0.4
+ --quiet
+ --pkg=gtk+-3.0
+ --warn-all
+ --include=Gtk-3.0
+ --library="ayatana-ido3-0.4"
+ --library-path=${CMAKE_CURRENT_BINARY_DIR}
+ --output "${CMAKE_CURRENT_BINARY_DIR}/AyatanaIdo3-0.4.gir"
+ )
+
+ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/AyatanaIdo3-0.4.gir" DESTINATION "${CMAKE_INSTALL_FULL_DATADIR}/gir-1.0")
+
+ # ayatana-ido3-0.4.typelib
+
+ add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/AyatanaIdo3-0.4.typelib"
+ DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/AyatanaIdo3-0.4.gir"
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ COMMAND
+ ${INTROSPECTION_COMPILER}
+ --includedir=${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_CURRENT_BINARY_DIR}/AyatanaIdo3-0.4.gir
+ -o "${CMAKE_CURRENT_BINARY_DIR}/AyatanaIdo3-0.4.typelib"
+ )
+
+ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/AyatanaIdo3-0.4.typelib" DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}/girepository-1.0")
+
+
+ # ayatana-ido3-0.4.vapi
+
+ find_package(Vala REQUIRED QUIET)
+
+ if (VALA_FOUND)
+
+ add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/AyatanaIdo3-0.4.vapi"
+ DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/AyatanaIdo3-0.4.typelib"
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ COMMAND
+ ${VAPI_GEN}
+ --library=AyatanaIdo3-0.4
+ --pkg gtk+-3.0
+ AyatanaIdo3-0.4.gir
+ )
+
+ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/AyatanaIdo3-0.4.vapi" DESTINATION "${CMAKE_INSTALL_FULL_DATADIR}/vala/vapi")
+
+ add_custom_target("src" ALL DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/AyatanaIdo3-0.4.vapi")
+
+ endif ()
+
+endif ()