~ubuntu-branches/ubuntu/vivid/freerdp/vivid

« back to all changes in this revision

Viewing changes to winpr/libwinpr/synch/CMakeLists.txt

  • Committer: Package Import Robot
  • Author(s): Iain Lane
  • Date: 2014-11-11 12:20:50 UTC
  • mfrom: (1.2.5)
  • mto: This revision was merged to the branch mainline in revision 24.
  • Revision ID: package-import@ubuntu.com-20141111122050-7z628f4ab38qxad5
Tags: upstream-1.1.0~git20140921.1.440916e+dfsg1
ImportĀ upstreamĀ versionĀ 1.1.0~git20140921.1.440916e+dfsg1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# WinPR: Windows Portable Runtime
 
2
# libwinpr-synch cmake build script
 
3
#
 
4
# Copyright 2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>
 
5
#
 
6
# Licensed under the Apache License, Version 2.0 (the "License");
 
7
# you may not use this file except in compliance with the License.
 
8
# You may obtain a copy of the License at
 
9
#
 
10
#     http://www.apache.org/licenses/LICENSE-2.0
 
11
#
 
12
# Unless required by applicable law or agreed to in writing, software
 
13
# distributed under the License is distributed on an "AS IS" BASIS,
 
14
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
15
# See the License for the specific language governing permissions and
 
16
# limitations under the License.
 
17
 
 
18
set(MODULE_NAME "winpr-synch")
 
19
set(MODULE_PREFIX "WINPR_SYNCH")
 
20
 
 
21
INCLUDE (CheckLibraryExists) 
 
22
list(APPEND CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
 
23
check_library_exists(pthread pthread_tryjoin_np "" HAVE_PTHREAD_GNU_EXT)
 
24
list(REMOVE_ITEM CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
 
25
 
 
26
if(HAVE_PTHREAD_GNU_EXT)
 
27
        add_definitions(-D_GNU_SOURCE -DHAVE_PTHREAD_GNU_EXT)
 
28
endif(HAVE_PTHREAD_GNU_EXT)
 
29
        
 
30
include_directories(../thread)
 
31
 
 
32
set(${MODULE_PREFIX}_SRCS
 
33
        address.c
 
34
        barrier.c
 
35
        condition.c
 
36
        critical.c
 
37
        event.c
 
38
        init.c
 
39
        mutex.c
 
40
        semaphore.c
 
41
        sleep.c
 
42
        srw.c
 
43
        synch.c
 
44
        synch.h
 
45
        timer.c
 
46
        wait.c)
 
47
 
 
48
add_complex_library(MODULE ${MODULE_NAME} TYPE "OBJECT"
 
49
        MONOLITHIC ${MONOLITHIC_BUILD}
 
50
        SOURCES ${${MODULE_PREFIX}_SRCS})
 
51
 
 
52
set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${WINPR_VERSION_FULL} SOVERSION ${WINPR_VERSION} PREFIX "lib")
 
53
 
 
54
set(${MODULE_PREFIX}_LIBS
 
55
        ${CMAKE_THREAD_LIBS_INIT}
 
56
        ${CMAKE_DL_LIBS})
 
57
 
 
58
if(${CMAKE_SYSTEM_NAME} MATCHES SunOS)
 
59
        set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} rt)
 
60
endif()
 
61
 
 
62
set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS
 
63
        MONOLITHIC ${MONOLITHIC_BUILD} INTERNAL
 
64
        MODULE winpr
 
65
        MODULES winpr-handle winpr-interlocked winpr-thread)
 
66
 
 
67
if(MONOLITHIC_BUILD)
 
68
        set(WINPR_LIBS ${WINPR_LIBS} ${${MODULE_PREFIX}_LIBS} PARENT_SCOPE)
 
69
else()
 
70
        target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS})
 
71
        install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR})
 
72
endif()
 
73
 
 
74
set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "WinPR")
 
75
 
 
76
if(BUILD_TESTING)
 
77
        add_subdirectory(test)
 
78
endif()