]> jfr.im git - irc/znc/znc.git/blob - ZNCConfig.cmake.in
Update translations from Crowdin for de_DE es_ES pt_BR
[irc/znc/znc.git] / ZNCConfig.cmake.in
1 #
2 # Copyright (C) 2004-2016 ZNC, see the NOTICE file for details.
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 # http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 #
16
17 include("${CMAKE_CURRENT_LIST_DIR}/znc_internal.cmake")
18 include("${CMAKE_CURRENT_LIST_DIR}/znc_public.cmake")
19 include(CMakeParseArguments)
20
21 # For some reason cygwin fails to build modules if Threads::Threads
22 # is not found.
23 if(NOT CYGWIN)
24 set(ZNC_NO_INCLUDE_THREADS true)
25 endif()
26
27 if(NOT ZNC_NO_INCLUDE_THREADS)
28 set(CMAKE_THREAD_PREFER_PTHREAD true)
29 set(THREADS_PREFER_PTHREAD_FLAG true)
30 find_package(Threads REQUIRED)
31 if(NOT CMAKE_USE_PTHREADS_INIT)
32 message(FATAL_ERROR "This compiler/OS doesn't seem "
33 "to support pthreads.")
34 endif()
35 endif()
36
37 function(znc_setup_module)
38 cmake_parse_arguments(znc_mod "" "TARGET;NAME" "" ${ARGN})
39 set_target_properties("${znc_mod_TARGET}" PROPERTIES
40 OUTPUT_NAME "${znc_mod_NAME}"
41 PREFIX ""
42 SUFFIX ".so"
43 NO_SONAME true
44 CXX_VISIBILITY_PRESET "hidden")
45 target_link_libraries("${znc_mod_TARGET}" PRIVATE ZNC::ZNC)
46 endfunction()
47
48 message(STATUS "Found ZNC @ZNC_VERSION@")