khanat-code-old/code/nel/src/net/CMakeLists.txt

44 lines
1.3 KiB
CMake

FILE(GLOB SRC "*.cpp")
FILE(GLOB NET_MANAGER "net_manager.*")
LIST(REMOVE_ITEM SRC ${NET_MANAGER})
DECORATE_NEL_LIB("nelmisc")
SET(NLMISC_LIB ${LIBNAME})
DECORATE_NEL_LIB("nelnet")
SET(NLNET_LIB ${LIBNAME})
IF(NOT WIN32)
ADD_LIBRARY(nelnet SHARED ${SRC})
CONFIGURE_FILE(nel-net.pc.in nel-net.pc)
INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/nel-net.pc" DESTINATION lib/pkgconfig)
ELSE(NOT WIN32)
ADD_LIBRARY(nelnet STATIC ${SRC})
ENDIF(NOT WIN32)
IF(WITH_GTK)
IF(GTK2_FOUND)
INCLUDE_DIRECTORIES(${GTK2_INCLUDE_DIRS})
ADD_DEFINITIONS(-DNL_USE_GTK)
ENDIF(GTK2_FOUND)
ENDIF(WITH_GTK)
INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR})
TARGET_LINK_LIBRARIES(nelnet ${LIBXML2_LIBRARIES} ${NLMISC_LIB})
SET_TARGET_PROPERTIES(nelnet PROPERTIES
VERSION ${NL_VERSION}
SOVERSION ${NL_VERSION_MAJOR}
PROJECT_LABEL "Library: NeL Net")
IF(WIN32)
SET_TARGET_PROPERTIES(${NLNET_LIB} PROPERTIES COMPILE_FLAGS "/Yustdnet.h")
SET_SOURCE_FILES_PROPERTIES(stdnet.cpp PROPERTIES COMPILE_FLAGS "/Ycstdnet.h")
SET_TARGET_PROPERTIES(${NLNET_LIB} PROPERTIES
LINK_FLAGS "/NODEFAULTLIB:libcmt"
DEBUG_POSTFIX "_d"
RELEASE_POSTFIX "_r")
ENDIF(WIN32)
ADD_DEFINITIONS(${LIBXML2_DEFINITIONS})
INSTALL(TARGETS ${NLNET_LIB} LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries)