From da1b8d1d53065620e24fd113a0b086c9c1961262 Mon Sep 17 00:00:00 2001 From: nick black Date: Sat, 10 Oct 2020 20:53:45 -0400 Subject: [PATCH] install version.h #1054 --- .drone.yml | 4 ++-- CMakeLists.txt | 4 +++- src/demo/demo.h | 6 +----- src/lib/debug.c | 3 +-- src/lib/ffmpeg.cpp | 2 +- src/lib/internal.h | 1 + src/lib/oiio.cpp | 2 +- src/lib/visual.cpp | 2 +- src/tetris/main.cpp | 1 + tools/version.h.in | 5 +++++ 10 files changed, 17 insertions(+), 13 deletions(-) diff --git a/.drone.yml b/.drone.yml index a84224125..cc103d49e 100644 --- a/.drone.yml +++ b/.drone.yml @@ -5,7 +5,7 @@ name: debian-unstable steps: - name: debian-build - image: dankamongmen/unstable_builder:2020-09-29a + image: dankamongmen/unstable_builder:2020-10-10a commands: - export LANG=en_US.UTF-8 - mkdir build @@ -25,7 +25,7 @@ name: ubuntu-focal steps: - name: ubuntu-build - image: dankamongmen/focal:2020-09-22a + image: dankamongmen/focal:2020-10-10a commands: - export LANG=en_US.UTF-8 - mkdir build diff --git a/CMakeLists.txt b/CMakeLists.txt index e98feee03..d2fb7dfbd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -341,7 +341,8 @@ target_compile_definitions(notcurses++-static file(GLOB NOTCURSES_HEADERS CONFIGURE_DEPENDS LIST_DIRECTORIES false - ${PROJECT_SOURCE_DIR}/include/notcurses/*.h) + ${PROJECT_SOURCE_DIR}/include/notcurses/*.h + ${CMAKE_CURRENT_BINARY_DIR}/include/version.h) file(GLOB NCPP_HEADERS CONFIGURE_DEPENDS @@ -591,6 +592,7 @@ install(FILES include(CMakePackageConfigHelpers) configure_file(tools/version.h.in include/version.h) +configure_file(tools/builddef.h.in include/builddef.h) configure_package_config_file(tools/NotcursesConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/NotcursesConfig.cmake diff --git a/src/demo/demo.h b/src/demo/demo.h index 9474dddaf..de25d27d4 100644 --- a/src/demo/demo.h +++ b/src/demo/demo.h @@ -7,12 +7,8 @@ #include #include #include +#include #include -#ifdef USE_FFMPEG -#include -#include -#include // ffmpeg doesn't reliably "C"-guard itself -#endif #ifdef __cplusplus extern "C" { diff --git a/src/lib/debug.c b/src/lib/debug.c index 685d14d0b..7f99afed7 100644 --- a/src/lib/debug.c +++ b/src/lib/debug.c @@ -7,8 +7,7 @@ void notcurses_debug(notcurses* nc, FILE* debugfp){ fprintf(debugfp, "*************************** notcurses debug state *****************************\n"); while(n){ fprintf(debugfp, "%04d off y: %3d x: %3d geom y: %3d x: %3d curs y: %3d x: %3d %p %.8s\n", - planeidx, n->absy, n->absx, n->leny, n->lenx, n->y, n->x, - n, n->name ? n->name : ""); + planeidx, n->absy, n->absx, n->leny, n->lenx, n->y, n->x, n, n->name); if(n->boundto || n->bnext || n->bprev || n->blist){ fprintf(debugfp, " bound %p → %p ← %p binds %p\n", n->boundto, n->bnext, n->bprev, n->blist); diff --git a/src/lib/ffmpeg.cpp b/src/lib/ffmpeg.cpp index e5f0dc256..4cb0fc85a 100644 --- a/src/lib/ffmpeg.cpp +++ b/src/lib/ffmpeg.cpp @@ -1,4 +1,4 @@ -#include "version.h" +#include "builddef.h" #ifdef USE_FFMPEG #include "ffmpeg.h" #include "internal.h" diff --git a/src/lib/internal.h b/src/lib/internal.h index e73bf96e3..0aae6cb06 100644 --- a/src/lib/internal.h +++ b/src/lib/internal.h @@ -6,6 +6,7 @@ extern "C" { #endif #include "version.h" +#include "builddef.h" #ifdef USE_FFMPEG #include diff --git a/src/lib/oiio.cpp b/src/lib/oiio.cpp index 2c23b6f29..ade7c526e 100644 --- a/src/lib/oiio.cpp +++ b/src/lib/oiio.cpp @@ -1,4 +1,4 @@ -#include "version.h" +#include "builddef.h" #ifdef USE_OIIO #include "oiio.h" #include "internal.h" diff --git a/src/lib/visual.cpp b/src/lib/visual.cpp index 7482b93fd..eb2b257ab 100644 --- a/src/lib/visual.cpp +++ b/src/lib/visual.cpp @@ -1,6 +1,6 @@ #include #include -#include "version.h" +#include "builddef.h" #include "visual-details.h" #include "internal.h" diff --git a/src/tetris/main.cpp b/src/tetris/main.cpp index f87867883..b57a83be1 100644 --- a/src/tetris/main.cpp +++ b/src/tetris/main.cpp @@ -11,6 +11,7 @@ #include #include #include +#include "builddef.h" #include "version.h" std::mutex ncmtx; diff --git a/tools/version.h.in b/tools/version.h.in index f8e4d7ffd..782d36352 100644 --- a/tools/version.h.in +++ b/tools/version.h.in @@ -1,5 +1,10 @@ // Populated by CMake, and installed to the host system +#ifndef NOTCURSES_VERSION_HEADER +#define NOTCURSES_VERSION_HEADER + #define NOTCURSES_VERSION_MAJOR "@notcurses_VERSION_MAJOR@" #define NOTCURSES_VERSION_MINOR "@notcurses_VERSION_MINOR@" #define NOTCURSES_VERSION_PATCH "@notcurses_VERSION_PATCH@" #define NOTCURSES_VERSION_TWEAK "@notcurses_VERSION_TWEAK@" + +#endif