fix build for osx
This commit is contained in:
committed by
Dmitry Mikushin
parent
149cabaee7
commit
95a1d0a786
@@ -6,7 +6,7 @@ else()
|
|||||||
set(subproject OFF)
|
set(subproject OFF)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
PROJECT(tray C)
|
PROJECT(tray C CXX)
|
||||||
|
|
||||||
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
|
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
|
||||||
|
|
||||||
@@ -31,7 +31,7 @@ else()
|
|||||||
if(UNIX)
|
if(UNIX)
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
add_compile_definitions(TRAY_APPKIT=1)
|
add_compile_definitions(TRAY_APPKIT=1)
|
||||||
find_library(Cocoa REQUIRED)
|
find_library(COCOA Cocoa REQUIRED)
|
||||||
else()
|
else()
|
||||||
PKG_CHECK_MODULES(APPINDICATOR REQUIRED appindicator3-0.1)
|
PKG_CHECK_MODULES(APPINDICATOR REQUIRED appindicator3-0.1)
|
||||||
IF(APPINDICATOR_FOUND)
|
IF(APPINDICATOR_FOUND)
|
||||||
@@ -50,14 +50,14 @@ file(GLOB src
|
|||||||
${CMAKE_CURRENT_LIST_DIR}/*.png)
|
${CMAKE_CURRENT_LIST_DIR}/*.png)
|
||||||
|
|
||||||
add_executable(tray_example ${src})
|
add_executable(tray_example ${src})
|
||||||
target_link_libraries(tray_example INTERFACE tray)
|
target_link_libraries(tray_example tray)
|
||||||
|
|
||||||
configure_file(${CMAKE_CURRENT_LIST_DIR}/icon.ico ${CMAKE_BINARY_DIR}/icon.ico COPYONLY)
|
configure_file(${CMAKE_CURRENT_LIST_DIR}/icon.ico ${CMAKE_BINARY_DIR}/icon.ico COPYONLY)
|
||||||
configure_file(${CMAKE_CURRENT_LIST_DIR}/icon.png ${CMAKE_BINARY_DIR}/icon.png COPYONLY)
|
configure_file(${CMAKE_CURRENT_LIST_DIR}/icon.png ${CMAKE_BINARY_DIR}/icon.png COPYONLY)
|
||||||
|
|
||||||
if(UNIX)
|
if(UNIX)
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
target_link_libraries(tray_example Cocoa)
|
target_link_libraries(tray_example ${COCOA})
|
||||||
else()
|
else()
|
||||||
target_link_libraries(tray_example APPINDICATOR_STATIC_LIBRARIES)
|
target_link_libraries(tray_example APPINDICATOR_STATIC_LIBRARIES)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
Reference in New Issue
Block a user