85 lines
2.3 KiB
CMake
85 lines
2.3 KiB
CMake
cmake_minimum_required(VERSION 3.18..3.27)
|
|
|
|
project(Editor2D
|
|
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_BUILD_PARALLEL_LEVEL 8)
|
|
|
|
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(GLOB_RECURSE EDITOR_HEADERS "include/*.hpp")
|
|
file(GLOB_RECURSE EDITOR_SRC "src/*.cpp")
|
|
|
|
include_directories("include")
|
|
|
|
CPMAddPackage(NAME mcolor
|
|
URL https://git.redacted.cc/maxine/mcolor/archive/Prerelease-7.3.zip)
|
|
|
|
CPMAddPackage(NAME jlog
|
|
URL https://git.redacted.cc/josh/jlog/archive/Prerelease-18.zip)
|
|
|
|
CPMAddPackage(NAME Event
|
|
URL https://git.redacted.cc/josh/Event/archive/Release-12.zip)
|
|
|
|
CPMAddPackage(NAME jjx
|
|
URL https://git.redacted.cc/josh/jjx/archive/Release-1.2.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-32.zip)
|
|
|
|
CPMAddPackage(NAME JGL
|
|
URL https://git.redacted.cc/josh/JGL/archive/Prerelease-58.zip)
|
|
|
|
CPMAddPackage(NAME JUI
|
|
URL https://git.redacted.cc/josh/ReJUI/archive/Prerelease-6.2.zip)
|
|
|
|
|
|
if (UNIX)
|
|
add_library(Editor2D SHARED ${EDITOR_SRC})
|
|
endif()
|
|
|
|
if (WIN32)
|
|
ADD_LIBRARY(Editor2D STATIC ${EDITOR_SRC})
|
|
endif()
|
|
|
|
set_target_properties(Editor2D PROPERTIES LINKER_LANGUAGE CXX)
|
|
|
|
# TODO: Separate dependency packages such that only bare-minimum required is compiled with the just the lib.
|
|
target_include_directories(Editor2D PUBLIC
|
|
${Event_SOURCE_DIR}/include
|
|
${J3ML_SOURCE_DIR}/include
|
|
${jlog_SOURCE_DIR}/include
|
|
${JGL_SOURCE_DIR}/include
|
|
${ReWindow_SOURCE_DIR}/include
|
|
${JUI_SOURCE_DIR}/include
|
|
${mcolor_SOURCE_DIR}/include
|
|
${jjx_SOURCE_DIR}/include
|
|
)
|
|
|
|
target_link_libraries(Editor2D PUBLIC Event J3ML jlog ReWindow JGL JUI mcolor jjx)
|
|
|
|
|
|
add_executable(Editor2DApp main.cpp app.rc)
|
|
target_link_libraries(Editor2DApp PUBLIC Editor2D)
|
|
|
|
|
|
add_executable(testgame testgame.cpp)
|
|
target_link_libraries(testgame PUBLIC Editor2D)
|
|
|
|
|
|
add_executable(libtest libtest.cpp)
|
|
target_link_libraries(libtest PUBLIC Editor2D)
|