From 08b7da9426367a910ab651929c826da87662da07 Mon Sep 17 00:00:00 2001 From: cobrapitz <12397702+cobrapitz@users.noreply.github.com> Date: Mon, 8 May 2023 02:36:04 +0200 Subject: [PATCH] added CBLib and Raylib --- FetchBoost.cmake | 2 +- FetchCBLib.cmake | 17 +++++++++++++++++ FetchRaylib.cmake | 31 +++++++++++++++++++++++++++++++ Utils.cmake | 2 +- 4 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 FetchCBLib.cmake create mode 100644 FetchRaylib.cmake diff --git a/FetchBoost.cmake b/FetchBoost.cmake index 136eeb6..6db60a5 100644 --- a/FetchBoost.cmake +++ b/FetchBoost.cmake @@ -12,7 +12,7 @@ # ) if (NOT DEFINED BOOST_GIT_TAG) - message(FATAL_ERROR "BOOST_GIT_TAG is not defined.\n see https://github.com/boostorg/boost and grab a release tag.\n example: set(BOOST_GIT_TAG boost-1.81.0)") + message(FATAL_ERROR "BOOST_GIT_TAG is not defined.\n see https://github.com/boostorg/boost and grab a release tag.\n example: set(BOOST_GIT_TAG boost-1.82.0)") endif() if (NOT DEFINED BOOST_INCLUDE_LIBRARIES) diff --git a/FetchCBLib.cmake b/FetchCBLib.cmake new file mode 100644 index 0000000..e4f123e --- /dev/null +++ b/FetchCBLib.cmake @@ -0,0 +1,17 @@ +# usage: +# FetchContent_MakeAvailable(cblib) +# target_link_libraries(${PROJECT_NAME} PRIVATE cblib) + +if (NOT DEFINED CBLIB_GIT_TAG) + message(FATAL_ERROR "CBLIB_GIT_TAG is not defined.\n see https://git.cobrapitz.de/cobrapitz/CBLib and grab a release tag.\n example: set(CBLIB_GIT_TAG v0.1.4)") +endif() + + +FetchContent_Declare( + cblib + GIT_REPOSITORY https://git.cobrapitz.de/cobrapitz/CBLib.git + GIT_TAG ${CBLIB_GIT_TAG} +) + +include(${CMAKE_SOURCE_DIR}/cmake/Utils.cmake) +print_git_tag(${CBLIB_GIT_TAG}) diff --git a/FetchRaylib.cmake b/FetchRaylib.cmake new file mode 100644 index 0000000..8eb172c --- /dev/null +++ b/FetchRaylib.cmake @@ -0,0 +1,31 @@ +# usage: +# FetchContent_MakeAvailable(raylib) +# target_link_libraries(${PROJECT_NAME} PRIVATE raylib) + +##################### after target_link_libraries +## Web Configurations +#if (${PLATFORM} STREQUAL "Web") +# # Tell Emscripten to build an example.html file. +# set_target_properties(${PROJECT_NAME} PROPERTIES SUFFIX ".html") +#endif() +# +## Checks if OSX and links appropriate frameworks (Only required on MacOS) +#if (APPLE) +# target_link_libraries(${PROJECT_NAME} "-framework IOKit") +# target_link_libraries(${PROJECT_NAME} "-framework Cocoa") +# target_link_libraries(${PROJECT_NAME} "-framework OpenGL") +#endif() + + +if (NOT DEFINED RAYLIB_GIT_TAG) + message(FATAL_ERROR "RAYLIB_GIT_TAG is not defined.\n see https://github.com/raysan5/raylib and grab a release tag.\n example: set(RAYLIB_GIT_TAG 4.5.0)") +endif() + +FetchContent_Declare( + raylib + GIT_REPOSITORY https://github.com/raysan5/raylib.git + GIT_TAG ${RAYLIB_GIT_TAG} +) + +include(${CMAKE_SOURCE_DIR}/cmake/Utils.cmake) +print_git_tag(${RAYLIB_GIT_TAG}) diff --git a/Utils.cmake b/Utils.cmake index 32f100a..28538f5 100644 --- a/Utils.cmake +++ b/Utils.cmake @@ -7,5 +7,5 @@ macro(print_git_tag GIT_TAG) get_filename_component(_CURRENT_FILENAME ${CMAKE_CURRENT_LIST_FILE} NAME) # print message - message(STATUS "${_CURRENT_FILENAME}:> Fetching Version-[${GIT_TAG}]") + message(STATUS "FETCH: ${_CURRENT_FILENAME}:> Fetching Version-[${GIT_TAG}]") endmacro()