mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-20 17:26:01 +08:00
[sfml] Refactor CMake build
This commit is contained in:
parent
63d829682e
commit
70af9d8159
@ -1,8 +1,14 @@
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
project(spine-c)
|
||||
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/../flags.cmake)
|
||||
|
||||
include_directories(include)
|
||||
file(GLOB INCLUDES "spine-c/include/**/*.h")
|
||||
file(GLOB SOURCES "spine-c/src/**/*.c" "spine-c/src/**/*.cpp")
|
||||
file(GLOB SOURCES "spine-c/src/**/*.c")
|
||||
|
||||
add_library(spine-c STATIC ${SOURCES} ${INCLUDES})
|
||||
target_include_directories(spine-c PUBLIC spine-c/include)
|
||||
|
||||
install(TARGETS spine-c DESTINATION dist/lib)
|
||||
install(FILES ${INCLUDES} DESTINATION dist/include)
|
||||
@ -1,7 +1,7 @@
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
project(spine-cpp)
|
||||
|
||||
include(${CMAKE_SOURCE_DIR}/../flags.cmake)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/../flags.cmake)
|
||||
|
||||
include_directories(include)
|
||||
file(GLOB INCLUDES "spine-cpp/include/**/*.h")
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
project(spine-glfw)
|
||||
project(spine-sdl)
|
||||
|
||||
# Default flags
|
||||
include(${CMAKE_SOURCE_DIR}/../flags.cmake)
|
||||
|
||||
@ -1,3 +1,8 @@
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
project(spine-sfml)
|
||||
|
||||
# Default flags
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/../../flags.cmake)
|
||||
#
|
||||
# First download and extract SFML 2.5.1 for the respective OS we are on
|
||||
#
|
||||
@ -44,6 +49,9 @@ else()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Add spine-c
|
||||
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/../../spine-c ${CMAKE_BINARY_DIR}/spine-c-build)
|
||||
|
||||
# Define spine-sfml library
|
||||
include_directories(src ${SFML_DIR}/include)
|
||||
file(GLOB INCLUDES "src/**/*.h")
|
||||
|
||||
@ -1,3 +1,9 @@
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
project(spine-sfml)
|
||||
|
||||
# Default flags
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/../../flags.cmake)
|
||||
|
||||
#
|
||||
# First download and extract SFML 2.6.1 for the respective OS we are on
|
||||
#
|
||||
@ -44,14 +50,8 @@ else()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
message("MSCV detected")
|
||||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_CRT_SECURE_NO_WARNINGS")
|
||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_CRT_SECURE_NO_WARNINGS")
|
||||
else()
|
||||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic -std=c99")
|
||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wnon-virtual-dtor -pedantic -std=c++11 -fno-exceptions -fno-rtti")
|
||||
endif()
|
||||
# Add spine-cpp
|
||||
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/../../spine-cpp ${CMAKE_BINARY_DIR}/spine-cpp-build)
|
||||
|
||||
# Define spine-sfml-cpp library
|
||||
include_directories(src ${SFML_DIR}/include)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user