diff options
author | Kargatum <dowlandtop@yandex.com> | 2019-04-02 03:41:08 +0700 |
---|---|---|
committer | Francesco Borzì <borzifrancesco@gmail.com> | 2019-04-01 22:41:08 +0200 |
commit | eae9affec99181cec14fa4fd0449bb9f8e02565f (patch) | |
tree | 26b106ea2f6268cd2e4e75b63de6e4a0322aaead /deps/readline/CMakeLists.txt | |
parent | 0f174eff0142c60d3c631c23b5348d3f43fd444b (diff) |
feat(Cmake): Rewrite build and use inherited dependencies (#1652)
Diffstat (limited to 'deps/readline/CMakeLists.txt')
-rw-r--r-- | deps/readline/CMakeLists.txt | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/deps/readline/CMakeLists.txt b/deps/readline/CMakeLists.txt new file mode 100644 index 0000000000..8f0701b01f --- /dev/null +++ b/deps/readline/CMakeLists.txt @@ -0,0 +1,39 @@ +# Copyright (C) 2008-2019 TrinityCore <https://www.trinitycore.org/> +# Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL3 v3 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-AGPL3 +# +# This file is free software; as a special exception the author gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +if( UNIX ) + # find Readline (terminal input library) includes and library + # + # READLINE_INCLUDE_DIR - where the directory containing the READLINE headers can be found + # READLINE_LIBRARY - full path to the READLINE library + find_path(READLINE_INCLUDE_DIR readline/readline.h) + find_library(READLINE_LIBRARY NAMES readline) + + message(STATUS "Found Readline library: ${READLINE_LIBRARY}") + message(STATUS "Include dir is: ${READLINE_INCLUDE_DIR}") + + if (NOT READLINE_INCLUDE_DIR OR NOT READLINE_LIBRARY) + message(FATAL_ERROR "** Readline library not found!\n** Your distro may provide a binary for Readline e.g. for ubuntu try apt-get install libreadline5-dev") + endif () + + add_library(readline SHARED IMPORTED GLOBAL) + + set_target_properties(readline + PROPERTIES + IMPORTED_LOCATION + "${READLINE_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES + "${READLINE_INCLUDE_DIR}") + +else() + # Provide a dummy target + add_library(readline INTERFACE) +endif() |