diff --git a/CMakeLists.txt b/CMakeLists.txt index 6a1afa71..dcf3529c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,7 +30,9 @@ set(DEXED_JUCE_PATH "${CMAKE_SOURCE_DIR}/libs/JUCE" CACHE STRING "Path to JUCE l add_subdirectory(${DEXED_JUCE_PATH} ${CMAKE_BINARY_DIR}/JUCE EXCLUDE_FROM_ALL) add_subdirectory(libs/clap-juce-extensions EXCLUDE_FROM_ALL) - +# Adding the new "version.h" file created from "version.h.in" file, containing definition of DEXED_ID needed in Dexed.h +configure_file(version.h.in version.h) +include_directories(${CMAKE_CURRENT_BINARY_DIR}) #Adds all the module sources so they appear correctly in the IDE set_property(GLOBAL PROPERTY USE_FOLDERS YES) diff --git a/Source/Dexed.h b/Source/Dexed.h index dec60148..4ab021d9 100644 --- a/Source/Dexed.h +++ b/Source/Dexed.h @@ -21,6 +21,9 @@ #ifndef DEXED_H_INCLUDED #define DEXED_H_INCLUDED +// get value of the DEXED_ID from the PROJECT_VERSION from the main CMakeLists.txt +#include "version.h" + void dexed_trace(const char *source, const char *fmt, ...); #define __QUOTE(name) #name diff --git a/version.h.in b/version.h.in new file mode 100644 index 00000000..5c36bab3 --- /dev/null +++ b/version.h.in @@ -0,0 +1 @@ +#define DEXED_ID "@PROJECT_VERSION@"