diff --git a/CMakeLists.txt b/CMakeLists.txt index f62fb5d6b..c5c0de02d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -614,21 +614,21 @@ install(FILES include(CMakePackageConfigHelpers) configure_file(tools/version.h.in include/version.h) -configure_package_config_file(tools/notcursesConfig.cmake.in - ${CMAKE_CURRENT_BINARY_DIR}/notcursesConfig.cmake +configure_package_config_file(tools/NotcursesConfig.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/NotcursesConfig.cmake INSTALL_DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/notcurses/cmake ) write_basic_package_version_file( - ${CMAKE_CURRENT_BINARY_DIR}/notcursesConfigVersion.cmake + ${CMAKE_CURRENT_BINARY_DIR}/NotcursesConfigVersion.cmake COMPATIBILITY SameMajorVersion ) # Installation install(FILES - "${CMAKE_CURRENT_BINARY_DIR}/notcursesConfig.cmake" - "${CMAKE_CURRENT_BINARY_DIR}/notcursesConfigVersion.cmake" - DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/notcurses" + "${CMAKE_CURRENT_BINARY_DIR}/NotcursesConfig.cmake" + "${CMAKE_CURRENT_BINARY_DIR}/NotcursesConfigVersion.cmake" + DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/Notcurses" ) install(FILES diff --git a/NEWS.md b/NEWS.md index dfa4aea7d..0c8056b8f 100644 --- a/NEWS.md +++ b/NEWS.md @@ -7,6 +7,8 @@ rearrangements of Notcurses. * `ncreel` functions now generally call `ncreel_redraw()` themselves. This includes `ncreel_add()`, `ncreel_del()`, `ncreel_next()`, and `ncreel_prev()`. `ncreel_redraw()` need only be called to update tablets. + * In order to conform with CMake naming conventions, our CMake package is + now accessed as "Notcurses" rather than "notcurses". * 1.6.19 (2020-08-27) * Direct mode now places the terminal into "cbreak mode". This disables diff --git a/USAGE.md b/USAGE.md index add823547..7e81806db 100644 --- a/USAGE.md +++ b/USAGE.md @@ -23,7 +23,7 @@ unified commentary, consider the [paperback](https://www.amazon.com/dp/B086PNVNC A program wishing to use Notcurses will need to link it, ideally using the output of `pkg-config --libs notcurses`. It is advised to compile with the output of `pkg-config --cflags notcurses`. If using CMake, a support file is -provided, and can be accessed as `notcurses`. +provided, and can be accessed as `Notcurses`. Before calling into Notcurses—and usually as one of the first calls of the program—be sure to call `setlocale(3)` with an appropriate UTF-8 locale. It is diff --git a/tools/NotcursesConfig.cmake.in b/tools/NotcursesConfig.cmake.in new file mode 100644 index 000000000..1b093f97e --- /dev/null +++ b/tools/NotcursesConfig.cmake.in @@ -0,0 +1,9 @@ +@PACKAGE_INIT@ +set(Notcurses_DIR "@PACKAGE_SOME_INSTALL_DIR@") + +# Compute paths +get_filename_component(Notcurses_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) +set(Notcurses_INCLUDE_DIRS "@CONF_INCLUDE_DIRS@") +set(Notcurses_LIBRARY_DIRS "@CONF_LIBRARY_DIRS@") + +set(Notcurses_LIBRARIES -lnotcurses) diff --git a/tools/notcursesConfig.cmake.in b/tools/notcursesConfig.cmake.in deleted file mode 100644 index ddb83da6d..000000000 --- a/tools/notcursesConfig.cmake.in +++ /dev/null @@ -1,9 +0,0 @@ -@PACKAGE_INIT@ -set(NOTCURSES_DIR "@PACKAGE_SOME_INSTALL_DIR@") - -# Compute paths -get_filename_component(NOTCURSES_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) -set(NOTCURSES_INCLUDE_DIRS "@CONF_INCLUDE_DIRS@") -set(NOTCURSES_LIBRARY_DIRS "@CONF_LIBRARY_DIRS@") - -set(Notcurses_LIBRARIES -lnotcurses)