2021-03-19 22:05:00 +00:00
|
|
|
option( KICAD_SHOW_GTK_MESSAGES
|
|
|
|
"Show all the GTK error messages in the terminal"
|
|
|
|
OFF )
|
|
|
|
|
|
|
|
mark_as_advanced( KICAD_SHOW_GTK_MESSAGES )
|
|
|
|
|
|
|
|
set( PLATFORM_COMPILE_DEFS "" )
|
|
|
|
|
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
|
|
|
|
)
|
2020-12-16 00:28:58 +00:00
|
|
|
|
|
|
|
set( PLATFORM_LIBS
|
|
|
|
"Shlwapi"
|
2021-11-11 14:29:25 +00:00
|
|
|
"winhttp"
|
2020-12-16 00:28:58 +00:00
|
|
|
)
|
2020-06-03 14:58:54 +00:00
|
|
|
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} )
|
2021-03-19 22:05:00 +00:00
|
|
|
|
|
|
|
# Add the definition to show the GTK error messages if desired (they are hidden
|
|
|
|
# by us by default)
|
|
|
|
if( KICAD_SHOW_GTK_MESSAGES )
|
|
|
|
message( STATUS "Configuring KiCad not to hide any GTK error messages" )
|
|
|
|
string( APPEND PLATFORM_COMPILE_DEFS "-DKICAD_SHOW_GTK_MESSAGES" )
|
|
|
|
endif()
|
2020-06-03 14:58:54 +00:00
|
|
|
endif()
|
|
|
|
|
2021-03-19 22:36:16 +00:00
|
|
|
include_directories(
|
|
|
|
${INC_AFTER}
|
|
|
|
)
|
2020-06-03 14:58:54 +00:00
|
|
|
|
|
|
|
add_library( kiplatform STATIC
|
|
|
|
${PLATFORM_SRCS}
|
|
|
|
)
|
|
|
|
|
2021-03-19 22:05:00 +00:00
|
|
|
target_compile_definitions( kiplatform PRIVATE
|
|
|
|
${PLATFORM_COMPILE_DEFS}
|
|
|
|
)
|
|
|
|
|
2020-06-03 14:58:54 +00:00
|
|
|
target_include_directories( kiplatform PUBLIC
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/include
|
|
|
|
)
|
|
|
|
|
|
|
|
target_link_libraries( kiplatform
|
|
|
|
${wxWidgets_LIBRARIES}
|
|
|
|
${PLATFORM_LIBS}
|
|
|
|
)
|