Skip to content

Commit

Permalink
x11: remove unneeded extra includes
Browse files Browse the repository at this point in the history
  • Loading branch information
scivision committed Mar 21, 2024
1 parent 33ea173 commit 5be0b93
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 39 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ else()
target_compile_definitions(pdcurses PRIVATE XCURSES)

target_include_directories(pdcurses PRIVATE ${X11_INCLUDE_DIR})
target_link_libraries(pdcurses PRIVATE ${X11_LIBRARIES} X11::Xaw X11::Xt X11::Xpm X11::Xmu)
target_link_libraries(pdcurses PRIVATE X11::X11 X11::Xaw X11::Xt X11::Xpm X11::Xmu)

target_sources(pdcurses PRIVATE x11/pdcclip.c x11/pdcdisp.c x11/pdcgetsc.c
x11/pdckbd.c x11/pdcscrn.c x11/pdcsetsc.c x11/pdcutil.c x11/sb.c x11/scrlbox.c
Expand Down
5 changes: 4 additions & 1 deletion cmake/config.cmake.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
@PACKAGE_INIT@

include(CMakeFindDependencyMacro)
include(${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@-targets.cmake)

set(PDCurses_X11 @X11_FOUND@)
if(PDCurses_X11)
find_dependency(X11)
endif()

check_required_components(@PROJECT_NAME@)
34 changes: 1 addition & 33 deletions cmake/x11.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ pkg_check_modules(_xt xt)
pkg_check_modules(_x11 x11)
pkg_check_modules(_xmu xmu)
pkg_check_modules(_xpm xpm)
pkg_check_modules(_xaw REQUIRED xaw7)

endif()

Expand All @@ -21,39 +20,8 @@ PATH_SUFFIXES X11
REQUIRED
)

find_path(_xatom_inc
NAMES Xatom.h
HINTS ${_x11_INCLUDE_DIRS} ${X11_INCLUDE_DIR}
PATH_SUFFIXES X11
REQUIRED
)

find_path(_xmu_inc
NAMES StdSel.h
HINTS ${_xmu_INCLUDE_DIRS} ${X11_INCLUDE_DIR}
PATH_SUFFIXES X11/Xmu
REQUIRED
)

find_path(_xpm_inc
NAMES xpm.h
HINTS ${_xpm_INCLUDE_DIRS} ${X11_INCLUDE_DIR}
PATH_SUFFIXES X11
REQUIRED
)

find_path(_xaw_inc
NAMES Box.h
HINTS ${_xaw_INCLUDE_DIRS} ${X11_INCLUDE_DIR}
PATH_SUFFIXES X11/Xaw
REQUIRED
)

list(APPEND X11_INCLUDE_DIR
${_xt_inc} ${_xatom_inc}
${_xmu_inc} ${_xmu_inc}/..
${_xpm_inc}
${_xaw_inc} ${_xaw_inc}/..
${_xt_inc}
)

message(STATUS "X11_INCLUDE_DIR: ${X11_INCLUDE_DIR}
Expand Down
4 changes: 0 additions & 4 deletions demos/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ project(PDcursesDemos LANGUAGES C)

find_package(PDCurses CONFIG REQUIRED)

if(PDCurses_X11)
include(${PROJECT_SOURCE_DIR}/../cmake/x11.cmake)
endif()

foreach(f IN ITEMS testcurs ozdemo xmas firework ptest rain worm)
add_executable(${f} ${f}.c)
target_link_libraries(${f} PRIVATE CURSES::CURSES)
Expand Down

0 comments on commit 5be0b93

Please sign in to comment.