diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2018-02-10 04:21:10 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2018-02-10 04:22:47 +0000 |
| commit | e51eeb6902ac83c97a56987f4b999027490bc1ae (patch) | |
| tree | 25b48e8d4631a63307b6342526b08577c508ea91 /Common/NativeApp | |
| parent | Fixed resize window issues in unity app (diff) | |
| download | DiligentEngine-e51eeb6902ac83c97a56987f4b999027490bc1ae.tar.gz DiligentEngine-e51eeb6902ac83c97a56987f4b999027490bc1ae.zip | |
Reworked win32 and uwp cmake build rules
Diffstat (limited to 'Common/NativeApp')
| -rw-r--r-- | Common/NativeApp/CMakeLists.txt | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/Common/NativeApp/CMakeLists.txt b/Common/NativeApp/CMakeLists.txt index 46fced8..4625caf 100644 --- a/Common/NativeApp/CMakeLists.txt +++ b/Common/NativeApp/CMakeLists.txt @@ -10,6 +10,10 @@ if(PLATFORM_WIN32) include/Win32/Win32AppBase.h ) + function(add_win32_app TARGET_NAME SOURCE INCLUDE ASSETS) + add_executable(${TARGET_NAME} WIN32 ${SOURCE} ${INCLUDE} ${ASSETS}) + endfunction() + elseif(PLATFORM_UNIVERSAL_WINDOWS) set(SOURCE @@ -22,33 +26,34 @@ elseif(PLATFORM_UNIVERSAL_WINDOWS) # Windows Runtime types cannot be included into static libraries # https://social.msdn.microsoft.com/Forums/en-US/269db513-64ef-4817-a025-43954f614eb3/lnk4264-why-are-static-libraries-not-recommended-when-authoring-windows-runtime-types?forum=winappswithnativecode # So as a workaround, we will include all source files into the target app project - function(get_native_app_uwp_source UWP_SOURCE_IN UWP_INCLUDE_IN UWP_INCLUDE_DIR_IN) + function(add_uwp_app TARGET_NAME SOURCE INCLUDE ASSETS) get_target_property(NATIVE_APP_SOURCE_DIR NativeAppBase SOURCE_DIR) set(UWP_SOURCE - ${UWP_SOURCE_IN} ${NATIVE_APP_SOURCE_DIR}/src/UWP/Common/DeviceResources.cpp ${NATIVE_APP_SOURCE_DIR}/src/UWP/App.cpp ${NATIVE_APP_SOURCE_DIR}/src/UWP/UWPAppBase.cpp - PARENT_SCOPE ) set(UWP_INCLUDE - ${UWP_INCLUDE_IN} ${NATIVE_APP_SOURCE_DIR}/src/UWP/Common/DeviceResources.h ${NATIVE_APP_SOURCE_DIR}/src/UWP/Common/DirectXHelper.h ${NATIVE_APP_SOURCE_DIR}/src/UWP/App.h ${NATIVE_APP_SOURCE_DIR}/include/UWP/UWPAppBase.h ${NATIVE_APP_SOURCE_DIR}/src/UWP/Common/StepTimer.h - PARENT_SCOPE ) - set(UWP_INCLUDE_DIR - ${UWP_INCLUDE_DIR_IN} + add_executable(${TARGET_NAME} WIN32 ${SOURCE} ${INCLUDE} ${ASSETS} ${UWP_SOURCE} ${UWP_INCLUDE}) + + target_include_directories(${TARGET_NAME} + PUBLIC ${NATIVE_APP_SOURCE_DIR}/Src/UWP - PARENT_SCOPE ) - endfunction(get_native_app_uwp_source) + + source_group("UWP Common\\src" FILES ${UWP_SOURCE}) + source_group("UWP Common\\include" FILES ${UWP_INCLUDE}) + + endfunction(add_uwp_app) elseif(PLATFORM_ANDROID) set(SOURCE |
