Skip to content
This repository was archived by the owner on Mar 22, 2023. It is now read-only.

Commit aab7724

Browse files
examples: warn about missing ncurses only once in the build
1 parent e696154 commit aab7724

2 files changed

Lines changed: 6 additions & 12 deletions

File tree

examples/CMakeLists.txt

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,12 @@ if(CURSES_FOUND)
161161
add_example(pman pman/pman.cpp)
162162
target_include_directories(example-pman PUBLIC ${CURSES_INCLUDE_DIR})
163163
target_link_libraries(example-pman ${CURSES_LIBRARIES})
164-
else()
165-
message(WARNING "ncurses not found - pman won't be build")
164+
165+
add_example(panaconda panaconda/panaconda.cpp)
166+
target_include_directories(example-panaconda PUBLIC ${CURSES_INCLUDE_DIR})
167+
target_link_libraries(example-panaconda ${CURSES_LIBRARIES})
168+
elseif(NOT WIN32)
169+
message(WARNING "ncurses not found - pman and panaconda examples won't be build")
166170
endif()
167171

168172
if(SFML_FOUND)
@@ -190,14 +194,6 @@ else()
190194
message(WARNING "SFML 2.4 or newer not found - pmpong won't be build")
191195
endif()
192196

193-
if(CURSES_FOUND)
194-
add_example(panaconda panaconda/panaconda.cpp)
195-
target_include_directories(example-panaconda PUBLIC ${CURSES_INCLUDE_DIR})
196-
target_link_libraries(example-panaconda ${CURSES_LIBRARIES})
197-
else()
198-
message(WARNING "ncurses not found - panaconda won't be build")
199-
endif()
200-
201197
add_example(map_cli map_cli/map_cli.cpp)
202198

203199
add_example(array array/array.cpp)

tests/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,6 @@ if(BUILD_EXAMPLES AND NO_GCC_VARIADIC_TEMPLATE_BUG)
132132
if(CURSES_FOUND AND NOT WIN32)
133133
build_example_pman()
134134
add_test_generic(NAME ex-pman CASE 0 TRACERS none SCRIPT ex-pman/ex-pman_0.cmake)
135-
elseif(NOT WIN32)
136-
message(WARNING "ncurses not found - pman test won't be build")
137135
endif()
138136
elseif(BUILD_EXAMPLES)
139137
message(WARNING "Skipping examples tests because of gcc variadic template bug")

0 commit comments

Comments
 (0)