update README.md

This commit is contained in:
hyzboy 2019-11-29 12:45:07 +08:00
parent 652d903bb6
commit 4ac904d834

View File

@ -1,5 +1,5 @@
# CMCMakeModule # CMCMakeModule
CM CMake module file CMake module files of CMGameEngine/ULRE
## use ## use
@ -10,33 +10,35 @@ CM CMake module file
git submodule add https://github.com/hyzboy/CMCMakeModule git submodule add https://github.com/hyzboy/CMCMakeModule
git submodule add https://github.com/hyzboy/CMCore git submodule add https://github.com/hyzboy/CMCore
git submodule add https://github.com/hyzboy/CMPlatform git submodule add https://github.com/hyzboy/CMPlatform
git submodule add https://github.com/hyzboy/CMUtil
``` ```
- add the following code to project CMakeLists.txt - add the following code to project CMakeLists.txt
``` ```
cmake_minimum_required(VERSION 3.0) cmake_minimum_required(VERSION 3.0)
project(YourProject) project(YourProject)
set_property(GLOBAL PROPERTY USE_FOLDERS ON) set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/CMCMakeModule) set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/CMCMakeModule)
#if you use Vulkan API #if you use Vulkan API
include(vulkan) include(vulkan)
include(math) include(math)
use_mgl(${CMAKE_CURRENT_SOURCE_DIR}/3rdpty/MathGeoLib) use_mgl(${CMAKE_CURRENT_SOURCE_DIR}/3rdpty/MathGeoLib)
include(use_cm_module) include(use_cm_module)
use_cm_module(Core) use_cm_module(Core)
use_cm_module(Platform) use_cm_module(Platform)
use_cm_module(Util)
... ...
add_executable(YourProgram ...) add_executable(YourProgram ...)
target_link_libraries(YourProgram CMCore CMPlatform) target_link_libraries(YourProgram CMCore CMPlatform)
#if you use vulkan render #if you use vulkan render
target_link_libraried(YourProject ${RENDER_LIBRARY} ${Vulkan_LIBRARIES}) target_link_libraried(YourProject ${RENDER_LIBRARY} ${Vulkan_LIBRARIES})
``` ```