2014-10-15 17:32:46 +04:00
|
|
|
INCLUDE (FindVala)
|
|
|
|
INCLUDE (UseVala)
|
|
|
|
INCLUDE (CFlags)
|
|
|
|
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 ${VALA_DEBUG} --vapi=${LibName}-${MAJOR}.vapi
|
|
|
|
CUSTOM_VAPIS ${LibCustomVapis}
|
|
|
|
GENERATE_VAPI
|
|
|
|
GENERATE_HEADER ${LibName}-${MAJOR}
|
|
|
|
)
|
2014-10-26 16:08:20 +03:00
|
|
|
PKG_CHECK_MODULES (PKGS REQUIRED ${LibPkgModules})
|
2014-10-15 17:32:46 +04:00
|
|
|
INCLUDE_DIRECTORIES (${PKGS_INCLUDE_DIRS})
|
|
|
|
ADD_LIBRARY (${LibName} SHARED ${VALA_C} ${LibExtraSources})
|
2014-10-26 16:18:42 +03:00
|
|
|
ADD_DEFINITIONS (-DGETTEXT_PACKAGE="${PROJECT_LOWERCASE_NAME}-${MAJOR}")
|
2014-10-15 17:32:46 +04:00
|
|
|
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}.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)
|