cmake support

This commit is contained in:
Vítor Santos Costa
2014-12-14 12:05:43 +00:00
parent 289a36a0a1
commit 90feb7f9f8
32 changed files with 2309 additions and 2047 deletions

View File

@@ -108,7 +108,8 @@ endif (HAVE_LIBM)
check_library_exists( dl dlopen "" HAVE_LIBDL )
if (HAVE_LIBDL)
set(EXTRALIBS ${EXTRALIBS} dl)
target_link_libraries(libYap dl)
set( CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} dl )
set(HAVE_DLOPEN 1)
endif (HAVE_LIBDL)
@@ -118,84 +119,76 @@ if (WIN32)
set(EXTRALIBS ${EXTRALIBS} comdlg32)
endif (HAVE_LIBCOMDLG32)
check_library_exists( msvcrt strtok "" HAVE_LIBMSCRT )
if (HAVE_LIBMSCRT)
set(EXTRALIBS ${EXTRALIBS} mscrt)
endif (HAVE_LIBMSCRT)
check_library_exists( shell32 main "" HAVE_LIBSHELL32 )
if (HAVE_LIBSHELL32)
set(EXTRALIBS ${EXTRALIBS} shell32)
endif (HAVE_LIBSHELL32)
check_library_exists( wsock32 main "" HAVE_LIBWSOCK32 )
if (HAVE_LIBWSOCK32)
set(EXTRALIBS ${EXTRALIBS} wsock32)
endif (HAVE_LIBWSOCK32)
check_library_exists( ws2_32 main "" HAVE_LIBWS2_32 )
if (HAVE_LIBWS2_32)
set(EXTRALIBS ${EXTRALIBS} ws2_32)
endif (HAVE_LIBWS2_32)
endif()
check_library_exists( crypt crypt "" HAVE_LIBCRYPT )
if (HAVE_LIBCRYPT)
set(EXTRALIBS ${EXTRALIBS} crypt)
target_link_libraries(libYap crypt)
endif (HAVE_LIBCRYPT)
check_library_exists( judy Judy1Set "" HAVE_LIBJUDY )
if (HAVE_LIBJUDY)
set(EXTRALIBS ${EXTRALIBS} judy)
endif (HAVE_LIBJUDY)
check_library_exists( log main "" HAVE_LIBLOG )
if (HAVE_LIBLOG)
set(EXTRALIBS ${EXTRALIBS} log)
endif (HAVE_LIBLOG)
# check_library_exists( nsl nis_add "" HAVE_LIBNSL )
# if (HAVE_LIBNSL)
# target_link_libraries(libYap nsl)
# endif (HAVE_LIBNSL)
check_library_exists( nsl nis_add "" HAVE_LIBNSL )
if (HAVE_LIBNSL)
set(EXTRALIBS ${EXTRALIBS} nsl)
endif (HAVE_LIBNSL)
# check_library_exists( nss_dns main "" HAVE_LIBNSS_DNS )
# if (HAVE_LIBNSS_DNS)
# target_link_libraries(libYap nss_dns)
# endif (HAVE_LIBNSS_DNS)
check_library_exists( nss_dns main "" HAVE_LIBNSS_DNS )
if (HAVE_LIBNSS_DNS)
set(EXTRALIBS ${EXTRALIBS} nss_dns)
endif (HAVE_LIBNSS_DNS)
# check_library_exists( nss_files main "" HAVE_LIBNSS_FILES )
# if (HAVE_LIBNSS_FILES)
# set(EXTRALIBS ${EXTRALIBS} nss_files)
# endif (HAVE_LIBNSS_FILES)
check_library_exists( nss_files main "" HAVE_LIBNSS_FILES )
if (HAVE_LIBNSS_FILES)
set(EXTRALIBS ${EXTRALIBS} nss_files)
endif (HAVE_LIBNSS_FILES)
# check_library_exists( psapi main "" HAVE_LIBPSAPI )
# if (HAVE_LIBPSAPI)
# set(EXTRALIBS ${EXTRALIBS} psapi)
# endif (HAVE_LIBPSAPI)
check_library_exists( psapi main "" HAVE_LIBPSAPI )
if (HAVE_LIBPSAPI)
set(EXTRALIBS ${EXTRALIBS} psapi)
endif (HAVE_LIBPSAPI)
check_library_exists( resolv main "" HAVE_LIBRESOLV )
if (HAVE_LIBRESOLV)
set(EXTRALIBS ${EXTRALIBS} resolv)
endif (HAVE_LIBRESOLV)
# check_library_exists( resolv main "" HAVE_LIBRESOLV )
# if (HAVE_LIBRESOLV)
# set(EXTRALIBS ${EXTRALIBS} resolv)
# endif (HAVE_LIBRESOLV)
check_library_exists( socket main "" HAVE_LIBSOCKET )
if (HAVE_LIBSOCKET)
set(EXTRALIBS ${EXTRALIBS} socket)
endif (HAVE_LIBSOCKET)
check_library_exists( stdc__ main "" HAVE_LIBSTDC__ )
if (HAVE_LIBSTDC__)
set(EXTRALIBS ${EXTRALIBS} stdc__)
endif (HAVE_LIBSTDC__)
# check_library_exists( socket socket "" HAVE_LIBSOCKET )
# if (HAVE_LIBSOCKET)
# set(EXTRALIBS ${EXTRALIBS} socket)
# endif (HAVE_LIBSOCKET)
check_library_exists( unicode main "" HAVE_LIBUNICODE )
if (HAVE_LIBUNICODE)
set(EXTRALIBS ${EXTRALIBS} unicode)
endif (HAVE_LIBUNICODE)
check_library_exists( ws2_32 main "" HAVE_LIBWS2_32 )
if (HAVE_LIBWS2_32)
set(EXTRALIBS ${EXTRALIBS} ws2_32)
endif (HAVE_LIBWS2_32)
check_library_exists( xnet main "" HAVE_LIBXNET )
if (HAVE_LIBXNET)
set(EXTRALIBS ${EXTRALIBS} xnet)