# Make a version file containing the current version from git.
include (GetGitRevisionDescription)
git_describe (VERSION "--tags")
-if ("x_${VERSION}" STREQUAL "x_GIT-NOTFOUND")
+if ("x_${VERSION}" STREQUAL "x_GIT-NOTFOUND" OR "x_${VERSION}" STREQUAL "x_HEAD-HASH-NOTFOUND")
message (WARNING " - Install git to compile a production libmraa!")
- set (VERSION "v0.6.2-dirty")
+ set (VERSION "v0.7.4-dirty")
endif ()
message (INFO " - libmraa Version ${VERSION}")
option (BUILDSWIG "Build swig modules." ON)
option (BUILDSWIGPYTHON "Build swig python modules." ON)
option (BUILDSWIGNODE "Build swig node modules." ON)
+option (BUILDSWIGJAVA "Build Java API." OFF)
option (IPK "Generate IPK using CPack" OFF)
+option (RPM "Generate RPM using CPack" OFF)
option (BUILDPYTHON3 "Use python3 for building/installing" OFF)
+option (ENABLEEXAMPLES "Disable building of examples" ON)
option (INSTALLGPIOTOOL "Install gpio tool" OFF)
option (BUILDARCH "Override architecture to build for - override" OFF)
option (TESTS "Override the addition of tests" ON)
+if (NOT BUILDSWIG)
+ set (BUILDSWIGPYTHON OFF)
+ set (BUILDSWIGNODE OFF)
+ set (BUILDSWIGJAVA OFF)
+endif()
+
if (NOT BUILDARCH)
include (TargetArch)
target_architecture (DETECTED_ARCH)
endif()
set(CPACK_PACKAGE_VERSION
"${mraa_VERSION_MAJOR}.${mraa_VERSION_MINOR}.${mraa_VERSION_PATCH}${mraa_PACKAGE_ON_TAG}${VERSION_COMMIT}")
- set(CPACK_PACKAGE_NAME "libmraa${mraa_VERSION_MAJOR}")
+ set(CPACK_PACKAGE_NAME "mraa")
set(CPACK_DEBIAN_PACKAGE_SECTION "libs")
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE ${TARGET_ARCH})
set(CPACK_SYSTEM_NAME ${TARGET_ARCH})
- set(CPACK_DEBIAN_PACKAGE_PROVIDES "libmraa-dev, libmraa-dbg, libmraa-doc")
- set(CPACK_DEBIAN_PACKAGE_REPLACES ${CPACK_DEBIAN_PACKAGE_PROVIDES})
+ set(CPACK_DEBIAN_PACKAGE_PROVIDES "mraa-dev, mraa-dbg, mraa-doc")
+ set(CPACK_DEBIAN_PACKAGE_REPLACES "${CPACK_DEBIAN_PACKAGE_PROVIDES}, libmraa, libmraa-dev, libmraa-doc")
set(CPACK_DEBIAN_PACKAGE_CONFLICTS ${CPACK_DEBIAN_PACKAGE_PROVIDES})
set(WDIR "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}")
include (CPack)
endif()
+if (RPM)
+ message (INFO " - Enabled RPM packaging for ${DETECTED_ARCH}")
+ set(CPACK_PACKAGE_VERSION ${VERSION})
+ set(CPACK_GENERATOR "RPM")
+ set(CPACK_PACKAGE_NAME "libmraa${mraa_VERSION_MAJOR}")
+ set(CPACK_PACKAGE_RELEASE 1)
+ set(CPACK_PACKAGE_VERSION
+ "${mraa_VERSION_MAJOR}.${mraa_VERSION_MINOR}.${mraa_VERSION_PATCH}${mraa_PACKAGE_ON_TAG}${VERSION_COMMIT}")
+ set(CPACK_PACKAGE_CONTACT "Intel IoT-Devkit")
+ set(CPACK_PACKAGE_VENDOR "Intel IoT-Devkit")
+ set(CPACK_RPM_PACKAGE_PROVIDES "${CPACK_PACKAGE_NAME}-devel")
+ EXECUTE_PROCESS(COMMAND rpm --showrc
+ COMMAND grep -E "dist[[:space:]]*\\."
+ COMMAND sed -e "s/^.*dist\\s*\\.//"
+ COMMAND tr \\n \\t
+ COMMAND sed -e s/\\t//
+ OUTPUT_VARIABLE DIST_TAG)
+ set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_PACKAGE_RELEASE}.${DIST_TAG}.${DETECTED_ARCH}")
+ include(CPack)
+endif()
+
add_subdirectory (src)
-add_subdirectory (examples)
+if (ENABLEEXAMPLES)
+ add_subdirectory (examples)
+endif ()