From d76e518db104a709496918df78fa420be233b101 Mon Sep 17 00:00:00 2001 From: Bruno Herbelin Date: Mon, 14 Mar 2022 22:52:50 +0100 Subject: [PATCH 1/2] Optional library dependency CMake --- CMakeLists.txt | 7 ++++--- README.md | 15 +++++++++++++-- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b2c6a56..621f4d9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -142,6 +142,7 @@ endif() if (GLM_FOUND) macro_log_feature(GLM_FOUND "GLM" "OpenGL mathematics" "https://glm.g-truc.net" TRUE) else () + set(GLM_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/ext/glm) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/ext/glm) message(STATUS "Compiling 'GLM' OpenGL mathematics https://glm.g-truc.net -- ${CMAKE_CURRENT_SOURCE_DIR}/ext/glm") endif() @@ -158,9 +159,9 @@ endif() if (TINYXML2_FOUND) macro_log_feature(TINYXML2_FOUND "TinyXML2" "TinyXML2 library" "https://github.com/leethomason/tinyxml2.git" TRUE) else () - add_library(tinyxml2 "${CMAKE_CURRENT_SOURCE_DIR}/ext/tinyxml2/tinyxml2.cpp") set(TINYXML2_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/ext/tinyxml2) - set(TINYXML2_LIBRARIES -ltinyxml2) + set(TINYXML2_LIBRARIES TINYXML2) + add_library(TINYXML2 "${CMAKE_CURRENT_SOURCE_DIR}/ext/tinyxml2/tinyxml2.cpp") message(STATUS "Compiling 'TinyXML2' from https://github.com/leethomason/tinyxml2.git -- ${TINYXML2_INCLUDE_DIRS}") endif() @@ -189,7 +190,7 @@ if (AbletonLink_FOUND) macro_log_feature(AbletonLink_FOUND "AbletonLink" "Ableton Link synchronizer" "https://github.com/Ableton/link" TRUE) else () include(${CMAKE_CURRENT_SOURCE_DIR}/ext/link/AbletonLinkConfig.cmake) - message(STATUS "Compiling with Ableton Link https://github.com/Ableton/link -- ${CMAKE_CURRENT_SOURCE_DIR}/ext/link") + message(STATUS "Compiling 'Ableton Link' from https://github.com/Ableton/link -- ${CMAKE_CURRENT_SOURCE_DIR}/ext/link") endif() # diff --git a/README.md b/README.md index 4fc1c03..b37a9bc 100644 --- a/README.md +++ b/README.md @@ -69,9 +69,16 @@ Compile (or re-compile after pull): **Libraries:** - gstreamer -- gst-plugins : libav, base, good, bad & ugly +- gst-plugins (libav, base, good, bad & ugly) - libglfw3 -- libicu +- libicu (icu-i18n icu-uc icu-io) + +Optionnal: + +- glm +- stb +- TinyXML2 +- AbletonLink #### Install Dependencies @@ -79,6 +86,10 @@ Compile (or re-compile after pull): $ apt-get install build-essential cmake libpng-dev libglfw3-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-libav libicu-dev libgtk-3-dev +Optionnal: + + $ apt-get install libglm-dev libstb-dev libtinyxml2-dev ableton-link-dev + **OSX with Brew** $ brew install cmake libpng glfw gstreamer gst-libav gst-plugins-bad gst-plugins-base gst-plugins-good gst-plugins-ugly icu4c From e9497b03f4d785176de089d597d999e395cc5bd9 Mon Sep 17 00:00:00 2001 From: Bruno Herbelin Date: Mon, 14 Mar 2022 23:31:50 +0100 Subject: [PATCH 2/2] Fix version from git --- CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 621f4d9..1e41be6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,7 +16,12 @@ if(GIT_EXECUTABLE) if(NOT GIT_DESCRIBE_ERROR_CODE) string(SUBSTRING ${GIT_DESCRIBE_VERSION} 0 1 VIMIX_VERSION_MAJOR) string(SUBSTRING ${GIT_DESCRIBE_VERSION} 2 1 VIMIX_VERSION_MINOR) - string(SUBSTRING ${GIT_DESCRIBE_VERSION} 4 1 VIMIX_VERSION_PATCH) + string(LENGTH ${GIT_DESCRIBE_VERSION} VIMIX_VERSION_LENGTH) + if (VIMIX_VERSION_LENGTH GREATER 4) + string(SUBSTRING ${GIT_DESCRIBE_VERSION} 4 1 VIMIX_VERSION_PATCH) + else() + set(VIMIX_VERSION_PATCH "0") + endif() add_definitions(-DVIMIX_VERSION_MAJOR=${VIMIX_VERSION_MAJOR}) add_definitions(-DVIMIX_VERSION_MINOR=${VIMIX_VERSION_MINOR}) add_definitions(-DVIMIX_VERSION_PATCH=${VIMIX_VERSION_PATCH})