INCLUDE (FindVala) INCLUDE (UseVala) INCLUDE (CFlagsCommonRules) FIND_PACKAGE (PkgConfig REQUIRED) IF (WIN32) SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/run") # Avoid of "dll not found" messages ENDIF (WIN32) VALA_PRECOMPILE (VALA_C ${LibSources} PACKAGES ${LibPackages} OPTIONS --thread ${LibValaOpts} ${VALA_DEBUG} --vapi=${LibName}-${MAJOR}.vapi CUSTOM_VAPIS ${LibCustomVapis} GENERATE_VAPI GENERATE_HEADER ${LibName}-${MAJOR} ) PKG_CHECK_MODULES (PKGS REQUIRED ${LibPkgModules}) INCLUDE_DIRECTORIES (${PKGS_INCLUDE_DIRS} ${CMAKE_BINARY_DIR}/po) ADD_LIBRARY (${LibName} SHARED ${VALA_C} ${LibExtraSources}) ADD_DEFINITIONS (-DGETTEXT_PACKAGE="${PROJECT_LOWERCASE_NAME}-${MAJOR}") TARGET_LINK_LIBRARIES (${LibName} ${PKGS_LIBRARIES} ${LibLinkLibs}) SET_TARGET_PROPERTIES (${LibName} PROPERTIES VERSION ${MAJOR}.${MINOR}.${PATCH}) SET_TARGET_PROPERTIES (${LibName} PROPERTIES SOVERSION ${MAJOR}) IF (WIN32) SET_TARGET_PROPERTIES (${LibName} PROPERTIES PREFIX "" IMPORT_PREFIX "" SUFFIX "-${MAJOR}.dll" IMPORT_SUFFIX "-${MAJOR}.dll.a") ENDIF (WIN32) IF (LibInstall) IF (UNIX) INSTALL (TARGETS ${LibName} DESTINATION lib) ELSEIF (WIN32) INSTALL (TARGETS ${LibName} RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) ENDIF (UNIX) INSTALL (FILES ${CMAKE_CURRENT_BINARY_DIR}/${LibName}-${MAJOR}.h DESTINATION include) INSTALL (FILES ${CMAKE_CURRENT_BINARY_DIR}/${LibName}-${MAJOR}.vapi DESTINATION share/vala/vapi) ENDIF (LibInstall) # Access to 'share' directory when debugging (Gettext, Glade, GSchema files, etc...) EXECUTE_PROCESS (COMMAND ln -sf ${CMAKE_BINARY_DIR}/share -t ${CMAKE_CURRENT_BINARY_DIR}/..)