Files
ReImage/CMakeLists.txt
Redacted cf90f057fe Refactor & Fixes.
Rename to better fit the scope of this project. Allow loading an image from Color3* & Color4*
2024-10-10 11:49:39 -04:00

47 lines
1.2 KiB
CMake

cmake_minimum_required(VERSION 3.18)
project(ReImage
VERSION 1.0
LANGUAGES CXX
)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
# Enable Package Managers
include(cmake/CPM.cmake)
set(CMAKE_CXX_STANDARD 20)
CPMAddPackage(
NAME mcolor
URL https://git.redacted.cc/maxine/mcolor/archive/Prerelease-4.zip
)
file(GLOB_RECURSE HEADERS "include/*.h")
file(GLOB_RECURSE SOURCES "src/*.cpp")
file(COPY "testImages" DESTINATION "${PROJECT_BINARY_DIR}")
if (PROJECT_SOURCE_DIR STREQUAL PROJECT_BINARY_DIR)
message(FATAL_ERROR "In-Source builds are not allowed")
endif()
if (UNIX AND NOT APPLE)
add_library(ReImage SHARED ${SOURCES} ${HEADERS})
endif()
if (WIN32)
add_library(ReImage STATIC ${SOURCES} ${HEADERS})
endif()
target_include_directories(
ReImage PUBLIC
${PROJECT_SOURCE_DIR}/include
${mcolor_SOURCE_DIR}/include
)
add_executable(ReImageTest main.cpp)
set_target_properties(ReImage PROPERTIES LINKER_LANGUAGE CXX)
set_target_properties(ReImageTest PROPERTIES LINKER_LANGUAGE CXX)
target_link_libraries(ReImage PUBLIC mcolor)
target_link_libraries(ReImageTest PUBLIC ReImage)