-
-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CMake] Restore old way of importing Notcurses into a cmake project #1149
Conversation
Partially reverts: c5c9432 Context: dankamongmen#1146 The above commit implemented the much more convenient way of finding and using a package from CMake, however it broke compatibility with the way id had been before, which defined various `Notcurses_*` variables. Revert the `Notcurses` component to the old way and add support for `Notcurses++` in the same fashion. Perhaps one day we should think of implementing `find_package` support by way of a module, which should make it possible to have the cake and eat the cake. One day.
Wait, I thought the old definitions were coming from I just wanted to make sure nothing broke if one was using a pure |
They come from the ####### Expanded from @PACKAGE_INIT@ by configure_package_config_file() #######
####### Any changes to this file will be overwritten by the next CMake run ####
####### The input file was NotcursesConfig.cmake.in ########
get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../" ABSOLUTE)
macro(set_and_check _var _file)
set(${_var} "${_file}")
if(NOT EXISTS "${_file}")
message(FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist !")
endif()
endmacro()
macro(check_required_components _NAME)
foreach(comp ${${_NAME}_FIND_COMPONENTS})
if(NOT ${_NAME}_${comp}_FOUND)
if(${_NAME}_FIND_REQUIRED_${comp})
set(${_NAME}_FOUND FALSE)
endif()
endif()
endforeach()
endmacro()
####################################################################################
set(Notcurses_DIR "")
# Compute paths
get_filename_component(Notcurses_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
set(Notcurses_INCLUDE_DIRS "")
set(Notcurses_LIBRARY_DIRS "")
set(Notcurses_LIBRARIES -lnotcurses) Note the
Pure pkg_check_modules(NOTCURSES REQUIRED notcurses>=2.0.8)
|
[deletia] avast! sacre bleu! |
/""\ |
I wonder how come it works for you in glowlight - on my system, with those files in place, Notcurses does get detected but the build fails because lib path is empty, so is include path. |
probably because i've got the debian |
That might be it, I don't have it installed (on purpose). So maybe we can switch to the |
Partially reverts: c5c9432
Context: #1146
The above commit implemented the much more convenient way of finding and
using a package from CMake, however it broke compatibility with the way
id had been before, which defined various
Notcurses_*
variables.Revert the
Notcurses
component to the old way and add support forNotcurses++
in the same fashion.Perhaps one day we should think of implementing
find_package
supportby way of a module, which should make it possible to have the cake and
eat the cake. One day.