2024-11-01 14:10:00 +01:00
|
|
|
cmake_minimum_required (VERSION 3.8)
|
2024-11-02 12:10:42 +01:00
|
|
|
if(APPLE)
|
|
|
|
project ("globalRPC" LANGUAGES C CXX OBJCXX)
|
|
|
|
else()
|
|
|
|
project ("globalRPC" LANGUAGES C CXX)
|
|
|
|
endif()
|
2024-11-01 14:10:00 +01:00
|
|
|
file(GLOB_RECURSE SOURCES "src/*.cpp")
|
|
|
|
add_executable (rpc ${SOURCES})
|
|
|
|
set_property(TARGET rpc PROPERTY CXX_STANDARD 20)
|
|
|
|
add_subdirectory("vendor")
|
2024-11-02 11:25:56 +01:00
|
|
|
set(LIBRARIES discord-rpc libcurl_static mbedcrypto mbedx509 mbedtls wxmono)
|
2024-11-01 16:55:27 +01:00
|
|
|
if(WIN32)
|
|
|
|
list(APPEND LIBRARIES WindowsApp)
|
|
|
|
endif()
|
2024-11-02 11:25:56 +01:00
|
|
|
file(GLOB wx_setup_dir
|
|
|
|
"${CMAKE_BINARY_DIR}/vendor/wxWidgets/lib/*/mswu"
|
|
|
|
"${CMAKE_BINARY_DIR}/vendor/wxWidgets/lib/*/gtk3u"
|
2024-11-02 12:10:42 +01:00
|
|
|
"${CMAKE_BINARY_DIR}/vendor/wxWidgets/lib/wx/include/*"
|
2024-11-02 11:25:56 +01:00
|
|
|
)
|
|
|
|
if(wx_setup_dir)
|
|
|
|
message(STATUS "wxWidgets setup.h directory found: ${wx_setup_dir}")
|
|
|
|
target_include_directories(rpc PRIVATE vendor vendor/wxWidgets/include ${wx_setup_dir})
|
|
|
|
else()
|
|
|
|
message(FATAL_ERROR "wx/setup.h not found. Please check your wxWidgets build configuration.")
|
|
|
|
endif()
|
|
|
|
target_link_libraries(rpc PUBLIC ${LIBRARIES})
|