python-texttable: update to 1.3.1
[void-packages.git] / srcpkgs / tmines / patches / cmake.patch
blob9bb8069abbb49722a19a35397e8b56803929f45e
1 --- CMakeLists.txt
2 +++ CMakeLists.txt
3 @@ -58,6 +58,28 @@ add_library(iodevice_simulation src/iodevice_simulation.cpp)
4 find_package(Curses REQUIRED)
5 include_directories(${CURSES_INCLUDE_DIRS})
7 +include (CheckCSourceCompiles)
9 +check_c_source_compiles (
10 + "#include <argp.h>
11 + int main () {
12 + int argc=1;
13 + char *argv[]={\"test\"};
14 + argp_parse(0,argc,argv,0,0,0);
15 + return 0;
16 + }" LIBC_HAS_ARGP
19 +if (NOT LIBC_HAS_ARGP)
20 + message(STATUS "libc does not have argp")
21 + find_library (ARGP_LIB argp REQUIRED)
22 + if (ARGP_LIB)
23 + message(STATUS "Found libargp")
24 + else(ARGP_LIB)
25 + message(FATAL_ERROR "libargp required but not found")
26 + endif(ARGP_LIB)
27 +endif(NOT LIBC_HAS_ARGP)
29 add_executable(tmines src/tmines.cpp)
31 add_subdirectory(doc)
32 @@ -68,6 +90,9 @@ target_link_libraries(tmines minefield)
33 target_link_libraries(tmines iodevice_curses)
34 target_link_libraries(tmines iodevice_simulation)
35 target_link_libraries(tmines ${CURSES_LIBRARIES})
36 +if (ARGP_LIB)
37 + target_link_libraries (tmines ${ARGP_LIB})
38 +endif(ARGP_LIB)
40 install(TARGETS tmines DESTINATION bin)
41 # add manpage