diff --git a/spine-c/CMakeLists.txt b/spine-c/CMakeLists.txt index 906f7b0590..b7e4d2aa29 100644 --- a/spine-c/CMakeLists.txt +++ b/spine-c/CMakeLists.txt @@ -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) \ No newline at end of file diff --git a/spine-cpp/CMakeLists.txt b/spine-cpp/CMakeLists.txt index 68f1f0b145..9829b42cdf 100644 --- a/spine-cpp/CMakeLists.txt +++ b/spine-cpp/CMakeLists.txt @@ -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") diff --git a/spine-sdl/CMakeLists.txt b/spine-sdl/CMakeLists.txt index 45ebb7502d..0d636fadc2 100644 --- a/spine-sdl/CMakeLists.txt +++ b/spine-sdl/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.10) -project(spine-glfw) +project(spine-sdl) # Default flags include(${CMAKE_SOURCE_DIR}/../flags.cmake) diff --git a/spine-sfml/c/CMakeLists.txt b/spine-sfml/c/CMakeLists.txt index dcc33a0801..141e3e95bb 100644 --- a/spine-sfml/c/CMakeLists.txt +++ b/spine-sfml/c/CMakeLists.txt @@ -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") diff --git a/spine-sfml/cpp/CMakeLists.txt b/spine-sfml/cpp/CMakeLists.txt index 8215285e57..c1ac6a33d8 100644 --- a/spine-sfml/cpp/CMakeLists.txt +++ b/spine-sfml/cpp/CMakeLists.txt @@ -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)