All checks were successful
Run ReCI Build Test / Explore-Gitea-Actions (push) Successful in 7m9s
112 lines
2.9 KiB
CMake
112 lines
2.9 KiB
CMake
cmake_minimum_required(VERSION 3.18..3.27)
|
|
project(JGL
|
|
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 mcolor
|
|
URL https://git.redacted.cc/maxine/mcolor/archive/Prerelease-4.zip
|
|
)
|
|
|
|
CPMAddPackage(
|
|
NAME J3ML
|
|
URL https://git.redacted.cc/josh/j3ml/archive/Release-3.4.zip
|
|
)
|
|
|
|
CPMAddPackage(
|
|
NAME ReWindow
|
|
URL https://git.redacted.cc/Redacted/ReWindow/archive/Prerelease-21.zip
|
|
)
|
|
|
|
CPMAddPackage(
|
|
NAME GLAD
|
|
URL https://git.redacted.cc/Redacted/glad/archive/v2.1ext_fboV2.zip
|
|
)
|
|
|
|
CPMAddPackage(
|
|
NAME jlog
|
|
URL https://git.redacted.cc/josh/jlog/Prerelease-16.zip
|
|
)
|
|
|
|
CPMAddPackage(
|
|
NAME ReImage
|
|
URL https://git.redacted.cc/Redacted/ReImage/archive/Release-2.0.zip
|
|
)
|
|
|
|
if (WIN32)
|
|
#CPMAddPackage(
|
|
#NAME harfbuzz
|
|
#URL https://github.com/harfbuzz/harfbuzz/archive/refs/tags/9.0.0.zip
|
|
#)
|
|
|
|
CPMAddPackage(
|
|
NAME freetype
|
|
URL https://github.com/freetype/freetype/archive/refs/tags/VER-2-13-2.zip
|
|
)
|
|
endif()
|
|
|
|
#set(CMAKE_CXX_FLAGS "-O3 -Wall -Wextra")
|
|
|
|
file(COPY "assets" DESTINATION "${PROJECT_BINARY_DIR}")
|
|
file(GLOB_RECURSE ASSETS "assets/*")
|
|
file(GLOB_RECURSE HEADERS "include/*.h" "include/*.hpp")
|
|
file(GLOB_RECURSE SOURCES "src/*.c" "src/*.cpp" )
|
|
|
|
find_package(OpenGL REQUIRED)
|
|
|
|
if (UNIX AND NOT APPLE)
|
|
find_package(Freetype REQUIRED)
|
|
add_library(JGL SHARED ${SOURCES})
|
|
endif()
|
|
|
|
if (WIN32)
|
|
add_library(JGL STATIC ${SOURCES})
|
|
endif()
|
|
|
|
set_target_properties(JGL PROPERTIES LINKER_LANGUAGE CXX)
|
|
|
|
#Don't expose these ones.
|
|
include_directories(
|
|
${ReWindow_SOURCE_DIR}/include
|
|
${Event_SOURCE_DIR}/include
|
|
${glad_SOURCE_DIR}/include
|
|
)
|
|
|
|
target_include_directories(JGL PUBLIC
|
|
${PROJECT_SOURCE_DIR}/include
|
|
${OPENGL_INCLUDE_DIRS}
|
|
${ReImage_SOURCE_DIR}/include
|
|
${mcolor_SOURCE_DIR}/include
|
|
${J3ML_SOURCE_DIR}/include
|
|
${jlog_SOURCE_DIR}/include
|
|
)
|
|
|
|
add_executable(JGL_Demo main.cpp)
|
|
#set_target_properties(JGL_Demo PROPERTIES LINK_FLAGS "-Wl,-rpath,./lib")
|
|
|
|
if (UNIX AND NOT APPLE)
|
|
target_include_directories(JGL PRIVATE ${FREETYPE_INCLUDE_DIRS} )
|
|
target_link_libraries(JGL PRIVATE ${FREETYPE_LIBRARIES} glad)
|
|
target_link_libraries(JGL PUBLIC ${OPENGL_LIBRARIES} mcolor J3ML jlog ReImage)
|
|
endif()
|
|
|
|
if (WIN32)
|
|
target_include_directories(JGL PRIVATE ${freetype_SOURCE_DIR}/include)
|
|
target_link_libraries(JGL PRIVATE freetype glad)
|
|
target_link_libraries(JGL PUBLIC ${OPENGL_LIBRARIES} mcolor J3ML glad jlog ReImage)
|
|
endif()
|
|
|
|
target_link_libraries(JGL_Demo PUBLIC JGL ReWindowLibrary Event glad)
|