summaryrefslogtreecommitdiffhomepage
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt32
1 files changed, 26 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c1cc757e..952584e4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -327,7 +327,7 @@ if(SDK_XPLANE)
LIBRARY_OUTPUT_NAME "opentrack.xpl"
PREFIX "" SUFFIX "")
endif()
- if(UNIX)
+ if(UNIX AND NOT APPLE)
target_link_libraries(opentrack-xplane-plugin rt)
endif()
endif()
@@ -345,7 +345,7 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
endif()
add_library(opentrack-compat SHARED ${opentrack-compat-c} ${opentrack-compat-h})
-if(NOT WIN32)
+if(NOT WIN32 AND NOT APPLE)
target_link_libraries(opentrack-compat rt)
endif()
@@ -354,7 +354,12 @@ endif()
if(WIN32)
set(my-qt-deps ws2_32)
endif()
-SET(MY_QT_LIBS ${Qt5Widgets_LIBRARIES} ${Qt5Gui_LIBRARIES} ${Qt5Network_LIBRARIES} ${Qt5Xml_LIBRARIES} ${Qt5Core_LIBRARIES} ${my-qt-deps})
+if(APPLE)
+ link_directories(${CMAKE_INSTALL_PREFIX})
+ SET(MY_QT_LIBS QtWidgets QtGui QtNetwork QtXml QtCore)
+else()
+ SET(MY_QT_LIBS ${Qt5Widgets_LIBRARIES} ${Qt5Gui_LIBRARIES} ${Qt5Network_LIBRARIES} ${Qt5Xml_LIBRARIES} ${Qt5Core_LIBRARIES} ${my-qt-deps})
+endif()
add_library(opentrack-csv SHARED ${opentrack-csv-c} ${opentrack-csv-h})
target_link_libraries(opentrack-csv ${MY_QT_LIBS})
@@ -550,7 +555,11 @@ if(SDK_RIFT)
if(WIN32)
target_link_libraries(opentrack-tracker-rift "${SDK_RIFT}/libLibOVR.a" winmm.lib setupapi.lib)
else()
- target_link_libraries(opentrack-tracker-rift "${SDK_RIFT}/libLibOVR.a" udev Xinerama)
+ if (NOT APPLE)
+ target_link_libraries(opentrack-tracker-rift "${SDK_RIFT}/libLibOVR.a" udev Xinerama)
+ else() # crapintosh
+ target_link_libraries(opentrack-tracker-rift "${SDK_RIFT}/libLibOVR.a")
+ endif()
endif()
endif()
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_GNUCC)
@@ -560,6 +569,10 @@ if(SDK_RIFT)
COMPILE_FLAGS "-fno-strict-aliasing"
)
endif()
+ if(APPLE)
+ SET_TARGET_PROPERTIES(opentrack-tracker-rift
+ PROPERTIES LINK_FLAGS "-framework CoreFoundation -framework CoreGraphics -framework IOKit -framework Quartz")
+ endif()
endif()
if(SDK_HYDRA)
@@ -604,16 +617,23 @@ if(WIN32 AND NOT SDK_CONSOLE_DEBUG)
else()
set(opentrack-win32-executable "")
endif()
-if(UNIX)
+if(UNIX OR APPLE)
add_library(opentrack-qxt-mini SHARED ${qxt-mini-c})
SET_TARGET_PROPERTIES(opentrack-qxt-mini PROPERTIES COMPILE_FLAGS "-DBUILD_QXT_CORE=42 -DBUILD_QXT_WIDGETS=42 -DBUILD_QXT_GUI=42")
- target_link_libraries(opentrack-qxt-mini ${MY_QT_LIBS} X11)
+ target_link_libraries(opentrack-qxt-mini ${MY_QT_LIBS})
+ if(NOT APPLE)
+ target_link_libraries(opentrack-qxt-mini X11)
+ endif()
endif()
add_executable(opentrack ${opentrack-win32-executable} ${opentrack-bin-c} ${opentrack-bin-h} ${opentrack-bin-moc} ${opentrack-bin-uih} ${opentrack-bin-rcc})
set_target_properties(opentrack PROPERTIES COMPILE_DEFINITIONS OPENTRACK_VERSION=\"${OPENTRACK__COMMIT}\")
set(OPENTRACK_COMMIT_VERSION \"${OPENTRACK__COMMIT}\")
configure_file("${CMAKE_SOURCE_DIR}/opentrack-version.h" "${CMAKE_BINARY_DIR}/opentrack-version.h" @ONLY NEWLINE_STYLE UNIX)
+if(APPLE)
+ SET_TARGET_PROPERTIES(opentrack-qxt-mini PROPERTIES LINK_FLAGS "-framework Carbon -framework CoreFoundation")
+endif()
+
add_library(opentrack-api SHARED ${opentrack-lib-c} ${opentrack-lib-h} ${opentrack-lib-moc})
target_link_libraries(opentrack-api ${MY_QT_LIBS})
if(CMAKE_COMPILER_IS_GNUCXX)