2020-08-25 23:52:09 -07:00
|
|
|
project(wpigui)
|
|
|
|
|
|
|
|
|
|
include(CompileWarnings)
|
2020-09-20 12:31:20 -04:00
|
|
|
include(LinkMacOSGUI)
|
2020-08-25 23:52:09 -07:00
|
|
|
|
|
|
|
|
file(GLOB wpigui_src src/main/native/cpp/*.cpp)
|
|
|
|
|
file(GLOB wpigui_windows_src src/main/native/directx11/*.cpp)
|
|
|
|
|
file(GLOB wpigui_mac_src src/main/native/metal/*.mm)
|
|
|
|
|
file(GLOB wpigui_unix_src src/main/native/opengl3/*.cpp)
|
|
|
|
|
|
2024-07-22 11:03:19 -04:00
|
|
|
add_library(wpigui STATIC ${wpigui_src})
|
2020-08-25 23:52:09 -07:00
|
|
|
set_target_properties(wpigui PROPERTIES DEBUG_POSTFIX "d")
|
|
|
|
|
|
|
|
|
|
set_property(TARGET wpigui PROPERTY FOLDER "libraries")
|
|
|
|
|
|
|
|
|
|
wpilib_target_warnings(wpigui)
|
2021-12-31 07:56:31 -08:00
|
|
|
target_link_libraries(wpigui PUBLIC imgui)
|
2020-08-25 23:52:09 -07:00
|
|
|
|
2023-11-30 19:52:21 -05:00
|
|
|
target_include_directories(
|
|
|
|
|
wpigui
|
|
|
|
|
PUBLIC
|
|
|
|
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/main/native/include>
|
|
|
|
|
$<INSTALL_INTERFACE:${include_dest}/wpigui>
|
|
|
|
|
)
|
2020-08-25 23:52:09 -07:00
|
|
|
|
2023-11-30 19:52:21 -05:00
|
|
|
if(MSVC)
|
2020-08-25 23:52:09 -07:00
|
|
|
target_sources(wpigui PRIVATE ${wpigui_windows_src})
|
2024-07-11 18:01:05 -04:00
|
|
|
elseif(APPLE)
|
|
|
|
|
target_compile_options(wpigui PRIVATE -fobjc-arc)
|
|
|
|
|
wpilib_link_macos_gui(wpigui)
|
|
|
|
|
target_sources(wpigui PRIVATE ${wpigui_mac_src})
|
2020-08-25 23:52:09 -07:00
|
|
|
else()
|
2024-07-11 18:01:05 -04:00
|
|
|
target_sources(wpigui PRIVATE ${wpigui_unix_src})
|
2020-08-25 23:52:09 -07:00
|
|
|
endif()
|
|
|
|
|
|
2020-08-29 00:37:13 -07:00
|
|
|
add_executable(wpiguidev src/dev/native/cpp/main.cpp)
|
2020-09-20 12:31:20 -04:00
|
|
|
wpilib_link_macos_gui(wpiguidev)
|
2023-09-22 18:39:35 -04:00
|
|
|
wpilib_target_warnings(wpiguidev)
|
2020-08-29 00:37:13 -07:00
|
|
|
target_link_libraries(wpiguidev wpigui)
|
|
|
|
|
|
2023-09-18 01:17:32 +02:00
|
|
|
install(TARGETS wpigui EXPORT wpigui)
|
2024-04-10 22:04:22 -07:00
|
|
|
export(TARGETS wpigui FILE wpigui.cmake NAMESPACE wpigui::)
|
2020-08-25 23:52:09 -07:00
|
|
|
install(DIRECTORY src/main/native/include/ DESTINATION "${include_dest}/wpigui")
|