mirror of
https://github.com/allankoechke/raylib-cpp.git
synced 2026-11-30 10:59:00 +00:00
Add a static library
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
cmake_minimum_required(VERSION 3.11)
|
||||
project (raylib-cpp)
|
||||
|
||||
option(BUILD_STATIC "Static Library" ON)
|
||||
option(BUILD_EXAMPLES "Examples" ON)
|
||||
|
||||
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
||||
@@ -8,6 +9,10 @@ configure_file(${CMAKE_SOURCE_DIR}/cmake/CTestCustom.cmake ${CMAKE_BINARY_DIR})
|
||||
|
||||
add_subdirectory(include)
|
||||
|
||||
if(BUILD_STATIC)
|
||||
add_subdirectory(lib)
|
||||
endif()
|
||||
|
||||
if(BUILD_EXAMPLES)
|
||||
add_subdirectory(examples)
|
||||
endif()
|
||||
|
||||
@@ -39,7 +39,7 @@ int main()
|
||||
|
||||
background.ClearBackground();
|
||||
|
||||
texture.Draw(screenWidth / 2 - texture.getWidth() / 2, screenHeight / 2 - texture.getHeight() / 2);
|
||||
texture.Draw(screenWidth / 2 - texture.GetWidth() / 2, screenHeight / 2 - texture.GetHeight() / 2);
|
||||
|
||||
textColor.DrawText("this IS a texture loaded from an image!", 300, 370, 10);
|
||||
|
||||
|
||||
8
lib/CMakeLists.txt
Normal file
8
lib/CMakeLists.txt
Normal file
@@ -0,0 +1,8 @@
|
||||
# libraylib-cpp static library
|
||||
add_library(libraylib-cpp STATIC libraylib-cpp)
|
||||
|
||||
# Link raylib and raylib-cpp
|
||||
target_link_libraries(libraylib-cpp PUBLIC raylib raylib-cpp)
|
||||
|
||||
# Remove the "lib" at the beginning since it's already there.
|
||||
set_target_properties(libraylib-cpp PROPERTIES PREFIX "")
|
||||
11
lib/libraylib-cpp.cpp
Normal file
11
lib/libraylib-cpp.cpp
Normal file
@@ -0,0 +1,11 @@
|
||||
/*******************************************************************************************
|
||||
*
|
||||
* libraylib-cpp [raylib-cpp] library
|
||||
*
|
||||
* This is a static C++ built library to make linking easier.
|
||||
*
|
||||
* Copyright (c) 2015 Rob Loach (@RobLoach)
|
||||
*
|
||||
********************************************************************************************/
|
||||
|
||||
#include "raylib/raylib.hpp"
|
||||
Reference in New Issue
Block a user