Add build modes. Engine - build framework only. Tests - build unit tests only. TestGame - build TestGame and engine libraries. All - build all. Add scripts for easy build projects in different modes. "build_tests.bat" - create build directory, configure tests project and build there. "build_Engine.bat" - create build directory, configure engine projects, build there and copy header files to "build/bin/include".
This commit is contained in:
+31
-9
@@ -6,19 +6,41 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${OUTPUT_DIR})
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${OUTPUT_DIR})
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${OUTPUT_DIR})
|
||||
|
||||
# Build mode
|
||||
set(BUILD_MODE "All" CACHE STRING "Build mode: Engine / Tests / TestGame / All")
|
||||
set_property(CACHE BUILD_MODE PROPERTY STRINGS "Engine" "Tests" "TestGame" "All")
|
||||
|
||||
if(NOT MSVC)
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g")
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
add_compile_options(/GR-)
|
||||
add_compile_options(/GR-)
|
||||
else()
|
||||
add_compile_options(-fno-rtti)
|
||||
add_compile_options(-fno-rtti)
|
||||
endif()
|
||||
|
||||
add_subdirectory(FastRTTI)
|
||||
add_subdirectory(glfw)
|
||||
add_subdirectory(Core)
|
||||
add_subdirectory(TestGame)
|
||||
add_subdirectory(ProjectGenerator)
|
||||
add_subdirectory(Tests)
|
||||
if(BUILD_MODE STREQUAL "Engine")
|
||||
add_subdirectory(FastRTTI)
|
||||
add_subdirectory(glfw)
|
||||
add_subdirectory(Core)
|
||||
add_subdirectory(ProjectGenerator)
|
||||
|
||||
elseif(BUILD_MODE STREQUAL "Tests")
|
||||
add_subdirectory(Tests)
|
||||
|
||||
elseif(BUILD_MODE STREQUAL "TestGame")
|
||||
add_subdirectory(FastRTTI)
|
||||
add_subdirectory(glfw)
|
||||
add_subdirectory(Core)
|
||||
add_subdirectory(TestGame)
|
||||
|
||||
elseif(BUILD_MODE STREQUAL "All")
|
||||
add_subdirectory(FastRTTI)
|
||||
add_subdirectory(glfw)
|
||||
add_subdirectory(Core)
|
||||
add_subdirectory(ProjectGenerator)
|
||||
add_subdirectory(TestGame)
|
||||
add_subdirectory(Tests)
|
||||
|
||||
endif()
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
@echo off
|
||||
mkdir .\build
|
||||
cd build
|
||||
cmake -DBUILD_MODE=Engine ..
|
||||
cmake --build . --config Release
|
||||
cd ..
|
||||
mkdir ".\build\bin\include"
|
||||
robocopy ".\Core" ".\build\bin\include\Core" *.h *.hpp /S
|
||||
robocopy ".\Delegate" ".\build\bin\include\Delegate" *.h *.hpp /S
|
||||
robocopy ".\FastRTTI" ".\build\bin\include\FastRTTI" *.h *.hpp /S
|
||||
pause
|
||||
@@ -0,0 +1,5 @@
|
||||
@echo off
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -DBUILD_MODE=Tests ..
|
||||
cmake --build . --config Release
|
||||
@@ -1,5 +1,5 @@
|
||||
@echo off
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -A Win32
|
||||
cmake -DBUILD_MODE=All .. -A Win32
|
||||
pause
|
||||
@@ -1,5 +1,5 @@
|
||||
@echo off
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -A x64
|
||||
cmake -DBUILD_MODE=All .. -A x64
|
||||
pause
|
||||
Reference in New Issue
Block a user