Use FindCurses.cmake to discover the right way to build with libcurses.
This commit is contained in:
parent
bcdfdec211
commit
303d50c197
@ -40,11 +40,22 @@ function( use_mpw_sodium t r )
|
|||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
function( use_mpw_color t )
|
function( use_mpw_color t )
|
||||||
|
find_package( CURSES )
|
||||||
if( USE_COLOR )
|
if( USE_COLOR )
|
||||||
target_link_libraries( ${t} curses)
|
if ( CURSES_FOUND )
|
||||||
target_compile_definitions( ${t} PUBLIC -DMPW_COLOR=1 )
|
target_include_directories( ${t} PUBLIC ${CURSES_INCLUDE_DIR} )
|
||||||
|
target_link_libraries( ${t} ${CURSES_LIBRARIES} )
|
||||||
|
target_compile_definitions( ${t} PUBLIC -DMPW_COLOR=1 ${CURSES_DEFINITIONS} )
|
||||||
message(STATUS "${t}: USE_COLOR is enabled.")
|
message(STATUS "${t}: USE_COLOR is enabled.")
|
||||||
|
|
||||||
|
elseif( r STREQUAL "required" )
|
||||||
|
message(FATAL_ERROR "${t}: USE_COLOR was enabled but is missing libcurses. Please install this library before continuing.")
|
||||||
|
|
||||||
|
else()
|
||||||
|
message(WARNING "${t}: USE_COLOR was enabled but is missing libcurses. Will continue with USE_COLOR disabled!")
|
||||||
|
|
||||||
|
endif()
|
||||||
|
|
||||||
elseif( r STREQUAL "required" )
|
elseif( r STREQUAL "required" )
|
||||||
message(FATAL_ERROR "${t}: USE_COLOR was required but is not enabled. Please enable the option or remove this target.")
|
message(FATAL_ERROR "${t}: USE_COLOR was required but is not enabled. Please enable the option or remove this target.")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user