Files
ReJUI/CMakeLists.txt
2025-06-04 14:34:38 -05:00

83 lines
2.2 KiB
CMake

cmake_minimum_required(VERSION 3.18..3.27)
project(JUI
VERSION 1.1
LANGUAGES CXX)
if (PROJECT_SOURCE_DIR STREQUAL PROJECT_BINARY_DIR)
message(FATAL_ERROR "In-source builds are not allowed!")
endif()
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
# Enable Package Managers
include(cmake/CPM.cmake)
file(COPY "assets" DESTINATION "${PROJECT_BINARY_DIR}")
file(GLOB_RECURSE ASSETS "assets/*")
file(GLOB_RECURSE JUI_HEADERS "include/JUI/*.hpp" "include/JUI/*.h")
file(GLOB_RECURSE JUI_SRC "src/JUI/*.cpp" "src/JUI/*.c")
include_directories("include")
if (UNIX)
add_library(JUI SHARED ${JUI_SRC})
endif()
if (WIN32)
add_library(JUI STATIC ${JUI_SRC}
include/JUI/Mixins/DragAndDropReceiver.hpp
include/JUI/Widgets/RadioButtonSet.hpp
src/JUI/Widgets/UtilityBar.cpp
include/JUI/Widgets/ContextMenu.hpp)
endif()
set_target_properties(JUI PROPERTIES LINKER_LANGUAGE CXX)
CPMAddPackage(
NAME mcolor
URL https://git.redacted.cc/maxine/mcolor/archive/Release-1.zip
)
CPMAddPackage(
NAME Event
URL https://git.redacted.cc/josh/Event/archive/Release-12.zip
)
CPMAddPackage(
NAME jlog
URL https://git.redacted.cc/josh/jlog/archive/Prerelease-19.zip
)
CPMAddPackage(
NAME J3ML
URL https://git.redacted.cc/josh/j3ml/archive/3.4.5.zip
)
CPMAddPackage(
NAME ReWindow
URL https://git.redacted.cc/Redacted/ReWindow/archive/Prerelease-34.zip
)
CPMAddPackage(
NAME JGL
URL https://git.redacted.cc/josh/JGL/archive/Prerelease-55.zip
)
target_include_directories(JUI PUBLIC ${Event_SOURCE_DIR}/include)
target_include_directories(JUI PUBLIC ${J3ML_SOURCE_DIR}/include)
target_include_directories(JUI PUBLIC ${jlog_SOURCE_DIR}/include)
target_include_directories(JUI PUBLIC ${JGL_SOURCE_DIR}/include)
target_include_directories(JUI PUBLIC ${ReWindow_SOURCE_DIR}/include)
install(TARGETS ${PROJECT_NAME} DESTINATION lib/${PROJECT_NAME})
install(FILES ${JUI_HEADERS} DESTINATION include/${PROJECT_NAME})
target_link_libraries(JUI PUBLIC Event J3ML jlog ReWindow JGL)
add_executable(RedactedJUIDemo main.cpp)
target_link_libraries(RedactedJUIDemo PUBLIC JUI)