diff options
author | Vitaly Novichkov <Wohlstand@users.noreply.github.com> | 2018-10-25 13:25:05 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-25 13:25:05 +0300 |
commit | 5b67d0967519e6469e5faf92a143a7471c6584a9 (patch) | |
tree | b3c45ab48e55e73027c7a3b4d43f1fb5eb3bae6d /CMakeLists.txt | |
parent | d5004a22559d3f1f1b912a2765448cfc76aa53db (diff) | |
parent | 69e4ab8ac0fbfdc7e355518b5b286cc96734916e (diff) | |
download | libADLMIDI-5b67d0967519e6469e5faf92a143a7471c6584a9.tar.gz libADLMIDI-5b67d0967519e6469e5faf92a143a7471c6584a9.tar.bz2 libADLMIDI-5b67d0967519e6469e5faf92a143a7471c6584a9.zip |
Merge pull request #189 from jpcima/version-check
cmake rule to fail the build on version mismatch
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 0837c5d..342a4c1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -592,6 +592,16 @@ if(WITH_UNIT_TESTS) add_subdirectory(test) endif() +# === Version check ==== +set(VERSION_CHECK_SOURCE " + #include \"adlmidi.h\" + #if !(ADLMIDI_VERSION_MAJOR == ${PROJECT_VERSION_MAJOR} && ADLMIDI_VERSION_MINOR == ${PROJECT_VERSION_MINOR} && ADLMIDI_VERSION_PATCHLEVEL == ${PROJECT_VERSION_PATCH}) + #error Project and source code version do not match! + #endif") +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/version_check.c" "${VERSION_CHECK_SOURCE}") +add_library(ADLMIDI_version_check OBJECT "${CMAKE_CURRENT_BINARY_DIR}/version_check.c") +target_include_directories(ADLMIDI_version_check PRIVATE "include") + message("==== libADLMIDI options ====") message("libADLMIDI_STATIC = ${libADLMIDI_STATIC}") message("libADLMIDI_SHARED = ${libADLMIDI_SHARED}") |