terom@59: # dependancies terom@59: find_package (LibEvent REQUIRED) terom@59: find_package (GnuTLS REQUIRED) terom@67: find_package (LibPQ REQUIRED) terom@67: find_package (Evsql REQUIRED) terom@93: find_package (Lua51 REQUIRED) terom@121: find_package (PCRE REQUIRED) terom@59: terom@59: # add our include path terom@121: include_directories (${LibEvent_INCLUDE_DIRS} ${GnuTLS_INCLUDE_DIRS} ${Evsql_INCLUDE_DIRS} ${Lua51_INCLUDE_DIRS} ${PCRE_INCLUDE_DIRS}) terom@59: terom@59: # define our source code modules terom@126: set (CORE_SOURCES error.c log.c str.c) terom@118: set (SOCK_SOURCES sock.c sock_fd.c sock_tcp.c sock_gnutls.c sock_test.c sock_fifo.c line_proto.c) terom@90: set (IRC_SOURCES irc_line.c irc_conn.c irc_net.c irc_chan.c chain.c irc_cmd.c irc_proto.c irc_client.c irc_user.c irc_queue.c) terom@116: set (LUA_SOURCES nexus_lua.c lua_objs.c lua_config.c lua_irc.c) terom@105: set (CONSOLE_SOURCES console.c lua_console.c) terom@59: terom@105: set (NEXUS_SOURCES nexus.c ${CORE_SOURCES} ${SOCK_SOURCES} ${IRC_SOURCES} ${LUA_SOURCES} ${CONSOLE_SOURCES} signals.c module.c config.c) terom@59: set (TEST_SOURCES test.c ${CORE_SOURCES} ${SOCK_SOURCES} ${IRC_SOURCES}) terom@117: set (IRC_LOG_SOURCES modules/irc_log.c) terom@133: set (LOGWATCH_SOURCES modules/logwatch.c modules/logwatch_source.c modules/logwatch_filter.c modules/logwatch_chan.c) terom@59: terom@59: # define our libraries terom@59: set (MODULE_LIBRARIES "dl") terom@93: set (NEXUS_LIBRARIES ${LibEvent_LIBRARIES} ${GnuTLS_LIBRARIES} ${MODULE_LIBRARIES} "readline" ${Lua51_LIBRARIES}) terom@59: terom@59: # compiler flags terom@68: set (CFLAGS "-Wall -Wextra -std=gnu99") terom@59: terom@59: # add our binaries terom@59: add_executable (nexus ${NEXUS_SOURCES}) terom@59: add_executable (test EXCLUDE_FROM_ALL ${TEST_SOURCES}) terom@59: terom@59: # add our modules terom@59: add_library (irc_log MODULE ${IRC_LOG_SOURCES}) terom@119: add_library (logwatch MODULE ${LOGWATCH_SOURCES}) terom@59: terom@59: # set libraries terom@59: target_link_libraries (nexus ${NEXUS_LIBRARIES}) terom@59: target_link_libraries (test ${NEXUS_LIBRARIES}) terom@67: target_link_libraries (irc_log ${Evsql_LIBRARIES}) terom@121: target_link_libraries (logwatch ${PCRE_LIBRARIES}) terom@59: terom@59: # global target properties terom@119: set_target_properties (nexus test irc_log logwatch PROPERTIES terom@59: COMPILE_FLAGS ${CFLAGS} terom@59: ) terom@59: terom@59: # nexus needs to export its symbols to be able to load modules terom@59: set_target_properties (nexus PROPERTIES terom@59: LINK_FLAGS "--export-dynamic" terom@59: ) terom@59: terom@59: # modules have weird names terom@119: set_target_properties (irc_log logwatch PROPERTIES terom@67: PREFIX "mod_" terom@59: LIBRARY_OUTPUT_DIRECTORY "modules" terom@59: ) terom@59: terom@59: ## setup install info terom@59: #install (TARGETS evirc terom@59: # LIBRARY DESTINATION lib terom@59: # ARCHIVE DESTINATION lib/static terom@59: # PUBLIC_HEADER DESTINATION include terom@59: #) terom@59: