2020-06-03 14:58:54 +00:00
|
|
|
# Add the appropriate source files
|
|
|
|
if( APPLE )
|
|
|
|
set( PLATFORM_SRCS
|
2020-07-21 00:33:35 +00:00
|
|
|
osx/app.mm
|
2020-01-30 01:31:45 +00:00
|
|
|
osx/environment.mm
|
2020-06-03 14:58:54 +00:00
|
|
|
osx/ui.mm
|
|
|
|
)
|
|
|
|
|
|
|
|
set( PLATFORM_LIBS
|
|
|
|
"-framework Cocoa"
|
|
|
|
"-framework AppKit"
|
|
|
|
"-framework CoreData"
|
|
|
|
"-framework Foundation"
|
|
|
|
)
|
|
|
|
elseif( WIN32 )
|
|
|
|
set( PLATFORM_SRCS
|
2020-07-21 00:33:35 +00:00
|
|
|
msw/app.cpp
|
2020-01-30 01:31:45 +00:00
|
|
|
msw/environment.cpp
|
2020-06-03 14:58:54 +00:00
|
|
|
msw/ui.cpp
|
|
|
|
)
|
|
|
|
elseif( UNIX )
|
|
|
|
set( PLATFORM_SRCS
|
2020-07-21 00:33:35 +00:00
|
|
|
gtk/app.cpp
|
2020-01-30 01:31:45 +00:00
|
|
|
gtk/environment.cpp
|
2020-06-03 14:58:54 +00:00
|
|
|
gtk/ui.cpp
|
|
|
|
)
|
2020-01-30 01:31:45 +00:00
|
|
|
|
|
|
|
find_package(PkgConfig REQUIRED)
|
|
|
|
pkg_check_modules(GTK3 REQUIRED gtk+-3.0)
|
|
|
|
|
|
|
|
# Detect GTK3 and configure it
|
|
|
|
set( PLATFORM_LIBS
|
|
|
|
${GTK3_LIBRARIES}
|
|
|
|
)
|
|
|
|
|
|
|
|
include_directories( SYSTEM ${GTK3_INCLUDE_DIRS} )
|
|
|
|
link_directories( ${GTK3_LIBRARY_DIRS} )
|
|
|
|
add_definitions( ${GTK3_CFLAGS_OTHER} )
|
2020-06-03 14:58:54 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
add_library( kiplatform STATIC
|
|
|
|
${PLATFORM_SRCS}
|
|
|
|
)
|
|
|
|
|
|
|
|
target_include_directories( kiplatform PUBLIC
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/include
|
|
|
|
)
|
|
|
|
|
|
|
|
target_link_libraries( kiplatform
|
|
|
|
${wxWidgets_LIBRARIES}
|
|
|
|
${PLATFORM_LIBS}
|
|
|
|
)
|