root/OpenSceneGraph/trunk/src/OpenThreads/qt/CMakeLists.txt @ 13482

Revision 13482, 2.1 kB (checked in by robert, 11 hours ago)

From Jan Klimke, "i noticed, that there are a couple of additional flaws when building osg for Mac OS X 10.10 Yosemite.

The mac os sdk version is recognized by the current CMAKE script as 10.1 instead of 10.10 since it cuts the version string from the 4th place. I introduced a more reliable version checking based on splitting the returned version code into MAJOR MINOR and PATCH parts and reassemble the OSG sdk version afterwards.

I replaced the existing CMake code against the following (returning now version 10.10 as expected):

# Determine the canonical name of the selected Platform SDK

EXECUTE_PROCESS(COMMAND "/usr/bin/sw_vers" "-productVersion"

OUTPUT_VARIABLE OSG_OSX_SDK_NAME
OUTPUT_STRIP_TRAILING_WHITESPACE)

STRING(REPLACE "." ";" MACOS_VERSION_LIST ${OSG_OSX_SDK_NAME})
LIST(GET MACOS_VERSION_LIST 0 MACOS_VERSION_MAJOR)
LIST(GET MACOS_VERSION_LIST 1 MACOS_VERSION_MINOR)
LIST(GET MACOS_VERSION_LIST 2 MACOS_VERSION_PATCH)

SET(OSG_OSX_SDK_NAME "macosx${MACOS_VERSION_MAJOR}.${MACOS_VERSION_MINOR}")

Also i added the check for the new Version to some more find scripts.

Additionally the nil object in Objective C now seems to be equivalent with a null_ptr that cannot be passed as GLInt anymore. So i switched this in the PixelBufferCocoa?.mm to pass a zero instead of nil.
"

  • Property svn:eol-style set to native
Line 
1# This file should only be included when using Qt threads
2
3SET(LIB_NAME OpenThreads)
4SET(LIB_PUBLIC_HEADERS ${OpenThreads_PUBLIC_HEADERS})
5
6SOURCE_GROUP("Header Files" FILES ${LIB_PUBLIC_HEADERS})
7SET_SOURCE_FILES_PROPERTIES(${LIB_PUBLIC_HEADERS} PROPERTIES HEADER_FILE_ONLY ON)
8
9SET(QTCLASS_HEADERS
10    QtThreadPrivateData.h
11    QtMutexPrivateData.h
12    QtConditionPrivateData.h
13    QtBarrierPrivateData.h
14)
15
16# No need to moc headers right now
17#QT4_WRAP_CPP( QTCLASS_MOC ${QTCLASS_HEADERS} OPTIONS "-f" )
18
19ADD_LIBRARY(${LIB_NAME}
20    ${OPENTHREADS_USER_DEFINED_DYNAMIC_OR_STATIC}
21    ${LIB_PUBLIC_HEADERS}
22    ${QTCLASS_HEADERS}
23    QtThread.cpp
24    QtMutex.cpp
25    QtCondition.cpp
26    QtBarrier.cpp
27    ../common/Version.cpp
28    ../common/Atomic.cpp
29    ${QTCLASS_MOC}
30    ${OPENTHREADS_VERSIONINFO_RC}
31)
32
33IF(CMAKE_COMPILER_IS_GNUCXX)
34    # Remove -pedantic flag as it barfs on Qt headers
35   STRING(REGEX REPLACE "-pedantic" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
36ENDIF()
37
38IF(OPENTHREADS_SONAMES)
39  SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES VERSION ${OPENTHREADS_VERSION} SOVERSION ${OPENTHREADS_SOVERSION})
40ENDIF()
41
42if ( QT4_FOUND )
43    TARGET_LINK_LIBRARIES(${LIB_NAME} ${QT_QTCORE_LIBRARY})
44    INCLUDE_DIRECTORIES(${QT_INCLUDE_DIR} ${QT_QTCORE_INCLUDE_DIR})
45else( QT4_FOUND )
46IF ( Qt5Widgets_FOUND )
47    qt5_use_modules( ${LIB_NAME} Core )
48ENDIF ( Qt5Widgets_FOUND )
49   
50endif( QT4_FOUND )
51
52# Since we're building different platforms binaries in
53# their respective directories, we need to set the
54# link directory so it can find this location.
55LINK_DIRECTORIES(
56    ${CMAKE_CURRENT_BINARY_DIR}
57)
58
59IF(MSVC AND OSG_MSVC_VERSIONED_DLL)
60    HANDLE_MSVC_DLL(ot ${OPENTHREADS_SOVERSION})
61ENDIF()
62
63INSTALL(
64    TARGETS OpenThreads
65    ARCHIVE DESTINATION lib${LIB_POSTFIX} COMPONENT libopenthreads-dev
66    LIBRARY DESTINATION lib${LIB_POSTFIX} COMPONENT libopenthreads
67    RUNTIME DESTINATION bin COMPONENT libopenthreads
68)
69INSTALL(
70    FILES ${OpenThreads_PUBLIC_HEADERS}
71    DESTINATION include/OpenThreads
72    COMPONENT libopenthreads-dev
73)
74
75#commented out# INCLUDE(ModuleInstall OPTIONAL)
Note: See TracBrowser for help on using the browser.