Some checks failed
Run ReCI Build Test / Explore-Gitea-Actions (push) Failing after 1m18s
Resolve functions we use for OpenGL at runtime so if your PC doesn't support that renderer you could still use a different one.
79 lines
2.0 KiB
CMake
79 lines
2.0 KiB
CMake
cmake_minimum_required(VERSION 3.18..3.27)
|
|
project(ReWindow
|
|
VERSION 1.0
|
|
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)
|
|
|
|
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-16.zip
|
|
)
|
|
|
|
#TODO dlopen these at runtime so if one isn't supported the program still works.
|
|
find_package(Vulkan REQUIRED)
|
|
|
|
include_directories(${Vulkan_INCLUDE_DIR})
|
|
include_directories(${J3ML_SOURCE_DIR}/include)
|
|
include_directories(${jlog_SOURCE_DIR}/include)
|
|
|
|
|
|
file(GLOB_RECURSE HEADERS "include/*.h" "include/*.hpp")
|
|
|
|
file(GLOB_RECURSE HEADERS "include/logger/*.h" "include/logger/*.hpp")
|
|
|
|
if(UNIX AND NOT APPLE)
|
|
|
|
file(GLOB_RECURSE SOURCES "src/types/*.cpp" "src/platform/linux/*.cpp" "src/platform/shared/*.cpp" "src/ReWindow/*.cpp" )
|
|
endif()
|
|
|
|
if(WIN32)
|
|
file(GLOB_RECURSE SOURCES "src/types/*.cpp" "src/platform/windows/*.cpp" "src/platform/shared/*.cpp" "src/ReWindow/*.cpp")
|
|
endif()
|
|
|
|
include_directories("include")
|
|
|
|
if(UNIX)
|
|
add_library(ReWindow SHARED ${SOURCES})
|
|
endif()
|
|
|
|
if(WIN32)
|
|
add_library(ReWindow STATIC ${SOURCES})
|
|
endif()
|
|
|
|
target_include_directories(ReWindow PUBLIC ${Event_SOURCE_DIR}/include)
|
|
|
|
# Why god???
|
|
set_target_properties(ReWindow PROPERTIES LINKER_LANGUAGE CXX)
|
|
|
|
if(UNIX AND NOT APPLE)
|
|
target_link_libraries(ReWindow PUBLIC X11 Event jlog Vulkan::Vulkan)
|
|
target_link_libraries(ReWindow PUBLIC)
|
|
|
|
add_executable(ReWindowDemo main.cpp)
|
|
target_link_libraries(ReWindowDemo PUBLIC ReWindow)
|
|
endif()
|
|
|
|
if(WIN32)
|
|
target_compile_options(ReWindow PUBLIC /utf-8)
|
|
target_link_libraries(ReWindow PUBLIC Event jlog ${OPENGL_LIBRARIES})
|
|
add_executable(ReWindowDemo main.cpp)
|
|
target_link_libraries(ReWindowDemo PUBLIC ReWindow)
|
|
endif()
|