forked from kyonshi/grenzland-mud
Support cmake (#153)
* First cmake list file, simple docs. TODO: utils folder. * Support for building utils * All fields except HAVE_DOPRNT in place * Now builds and runs :)
This commit is contained in:
46
src/util/CMakeLists.txt
Normal file
46
src/util/CMakeLists.txt
Normal file
@@ -0,0 +1,46 @@
|
||||
|
||||
set(TOOLS
|
||||
asciipasswd
|
||||
autowiz
|
||||
plrtoascii
|
||||
rebuildIndex
|
||||
rebuildMailIndex
|
||||
shopconv
|
||||
sign
|
||||
split
|
||||
wld2html
|
||||
webster
|
||||
)
|
||||
|
||||
# common includes and flags
|
||||
include_directories(${CMAKE_SOURCE_DIR}/src)
|
||||
add_definitions(-DCIRCLE_UTIL)
|
||||
|
||||
find_library(CRYPT_LIBRARY crypt)
|
||||
find_library(NETLIB_LIBRARY nsl socket) # for sign.c, hvis nødvendig
|
||||
|
||||
foreach(tool ${TOOLS})
|
||||
if(${tool} STREQUAL "rebuildIndex")
|
||||
add_executable(rebuildIndex rebuildAsciiIndex.c)
|
||||
else()
|
||||
add_executable(${tool} ${tool}.c)
|
||||
endif()
|
||||
|
||||
# Set output location
|
||||
set_target_properties(${tool} PROPERTIES
|
||||
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin
|
||||
)
|
||||
|
||||
# Link to libcrypt for asciipasswd
|
||||
if(${tool} STREQUAL "asciipasswd" AND CRYPT_LIBRARY)
|
||||
target_link_libraries(${tool} ${CRYPT_LIBRARY})
|
||||
endif()
|
||||
|
||||
# Link to netlib for sign
|
||||
if(${tool} STREQUAL "sign" AND NETLIB_LIBRARY)
|
||||
target_link_libraries(${tool} ${NETLIB_LIBRARY})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
add_custom_target(utils DEPENDS ${TOOLS})
|
||||
|
||||
Reference in New Issue
Block a user