From 3e3f00389b820c4b38f401142f7a14b811b36f85 Mon Sep 17 00:00:00 2001 From: Soji Yamakawa Date: Sun, 29 Sep 2024 20:58:02 -0400 Subject: [PATCH 1/8] Bug fix. --- src/yssimplesound/src/yssimplesound.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/yssimplesound/src/yssimplesound.cpp b/src/yssimplesound/src/yssimplesound.cpp index 59e498b..46fcb6a 100644 --- a/src/yssimplesound/src/yssimplesound.cpp +++ b/src/yssimplesound/src/yssimplesound.cpp @@ -178,7 +178,7 @@ YSRESULT YsSoundPlayer::StartStreaming(Stream &streamPlayer,StreamingOption opt) YSRESULT YsSoundPlayer::StartStreaming(Stream &streamPlayer) { StreamingOption opt; - return StartStreamingAPISpecific(streamPlayer,opt); + return StartStreaming(streamPlayer,opt); } void YsSoundPlayer::StopStreaming(Stream &streamPlayer) From 1850a1aa27ded112dabff807bcb8e3a3dea80795 Mon Sep 17 00:00:00 2001 From: Soji Yamakawa Date: Thu, 5 Dec 2024 13:14:05 -0500 Subject: [PATCH 2/8] Removed in-source build rejection. --- src/fsgui3d/src/CMakeLists.txt | 8 ++------ src/fsgui3d/src/gl1/CMakeLists.txt | 8 ++------ src/fsgui3d/src/gl2/CMakeLists.txt | 8 ++------ src/fsgui3d/template-easy/CMakeLists.txt | 8 ++------ src/fsgui3d/template/CMakeLists.txt | 8 ++------ src/fsgui3d/template_with_filedialog/CMakeLists.txt | 8 ++------ src/fsguilib/filedialog/CMakeLists.txt | 8 ++------ src/fsguilib/src/CMakeLists.txt | 8 ++------ src/fsguilib/src/gl1/CMakeLists.txt | 8 ++------ src/fsguilib/src/gl2/CMakeLists.txt | 8 ++------ src/fsguilib/src/nownd/CMakeLists.txt | 8 ++------ src/fsguilib/template/CMakeLists.txt | 8 ++------ src/fsguilib/template_with_filedialog/CMakeLists.txt | 8 ++------ .../samples/sample00-bouncingBall/CMakeLists.txt | 8 ++------ src/fslazywindow/src/CMakeLists.txt | 8 ++------ src/fslazywindow/template/CMakeLists.txt | 8 ++------ src/fssimplefiledialog/sample/CMakeLists.txt | 8 ++------ src/fssimplefiledialog/src/CMakeLists.txt | 8 ++------ src/opencv/arucoMarkerDetection/CMakeLists.txt | 8 ++------ src/opencv/drawMarker/CMakeLists.txt | 8 ++------ src/opencv/videoCapture/CMakeLists.txt | 8 ++------ src/ysclass/src/CMakeLists.txt | 8 ++------ src/ysclass11/src/CMakeLists.txt | 8 ++------ src/ysfontrenderer/src/CMakeLists.txt | 8 ++------ src/ysgebl/src/cmdlib/CMakeLists.txt | 8 ++------ src/ysgebl/src/cmdmain/CMakeLists.txt | 8 ++------ src/ysgebl/src/gui/CMakeLists.txt | 8 ++------ src/ysgebl/src/gui_foundation/CMakeLists.txt | 8 ++------ src/ysgebl/src/kernel/CMakeLists.txt | 8 ++------ src/ysgebl/src/kernelutil/CMakeLists.txt | 8 ++------ src/ysgebl/src/main/CMakeLists.txt | 8 ++------ src/ysgebl/src/samples/YsShellExt/CMakeLists.txt | 8 ++------ src/ysgebl/src/shellrender/CMakeLists.txt | 8 ++------ src/ysgebl/src/shellrender/gl1/CMakeLists.txt | 8 ++------ src/ysgebl/src/shellrender/gl2/CMakeLists.txt | 8 ++------ src/ysgebl/src/shellrender/nownd/CMakeLists.txt | 8 ++------ src/ysgl/src/CMakeLists.txt | 8 ++------ src/ysglcpp/src/CMakeLists.txt | 8 ++------ src/ysglcpp/src/gl1/CMakeLists.txt | 8 ++------ src/ysglcpp/src/gl2/CMakeLists.txt | 8 ++------ src/ysglcpp/src/nownd/CMakeLists.txt | 8 ++------ src/ysport/src/CMakeLists.txt | 8 ++------ src/ystexturemanager/src/CMakeLists.txt | 8 ++------ src/ystexturemanager/src/gl/CMakeLists.txt | 8 ++------ src/ystexturemanager/src/null/CMakeLists.txt | 8 ++------ 45 files changed, 90 insertions(+), 270 deletions(-) diff --git a/src/fsgui3d/src/CMakeLists.txt b/src/fsgui3d/src/CMakeLists.txt index f6018ec..de695c1 100644 --- a/src/fsgui3d/src/CMakeLists.txt +++ b/src/fsgui3d/src/CMakeLists.txt @@ -36,12 +36,8 @@ set(REALLY_NEED_CPP11 1) # Setting 1 will enable use of C++11 libraries, but # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. cmake_minimum_required(VERSION 3.0.0) -if("${CMAKE_CURRENT_SOURCE_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}" AND - "${CMAKE_BINARY_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}") - message(FATAL_ERROR "In-source build prohibited.\nClear cache and Start cmake from somewhere else.") - # First condition is to allow inclusion of the project from outside CMake project with - # explicit binary-directory specification. eg. add_subdirectory from Android CMakeLists.txt -endif() + + if(MSVC) if(NOT WIN_SUBSYSTEM) diff --git a/src/fsgui3d/src/gl1/CMakeLists.txt b/src/fsgui3d/src/gl1/CMakeLists.txt index cfa0c0a..4300fef 100644 --- a/src/fsgui3d/src/gl1/CMakeLists.txt +++ b/src/fsgui3d/src/gl1/CMakeLists.txt @@ -50,12 +50,8 @@ set(REALLY_NEED_CPP11 1) # Setting 1 will enable use of C++11 libraries, but # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. cmake_minimum_required(VERSION 3.0.0) -if("${CMAKE_CURRENT_SOURCE_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}" AND - "${CMAKE_BINARY_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}") - message(FATAL_ERROR "In-source build prohibited.\nClear cache and Start cmake from somewhere else.") - # First condition is to allow inclusion of the project from outside CMake project with - # explicit binary-directory specification. eg. add_subdirectory from Android CMakeLists.txt -endif() + + if(MSVC) if(NOT WIN_SUBSYSTEM) diff --git a/src/fsgui3d/src/gl2/CMakeLists.txt b/src/fsgui3d/src/gl2/CMakeLists.txt index a38df18..bc86aa6 100644 --- a/src/fsgui3d/src/gl2/CMakeLists.txt +++ b/src/fsgui3d/src/gl2/CMakeLists.txt @@ -48,12 +48,8 @@ set(REALLY_NEED_CPP11 1) # Setting 1 will enable use of C++11 libraries, but # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. cmake_minimum_required(VERSION 3.0.0) -if("${CMAKE_CURRENT_SOURCE_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}" AND - "${CMAKE_BINARY_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}") - message(FATAL_ERROR "In-source build prohibited.\nClear cache and Start cmake from somewhere else.") - # First condition is to allow inclusion of the project from outside CMake project with - # explicit binary-directory specification. eg. add_subdirectory from Android CMakeLists.txt -endif() + + if(MSVC) if(NOT WIN_SUBSYSTEM) diff --git a/src/fsgui3d/template-easy/CMakeLists.txt b/src/fsgui3d/template-easy/CMakeLists.txt index d20cef1..c565544 100644 --- a/src/fsgui3d/template-easy/CMakeLists.txt +++ b/src/fsgui3d/template-easy/CMakeLists.txt @@ -36,12 +36,8 @@ set(REALLY_NEED_CPP11 0) # Setting 1 will enable use of C++11 libraries, but # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. cmake_minimum_required(VERSION 3.0.0) -if("${CMAKE_CURRENT_SOURCE_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}" AND - "${CMAKE_BINARY_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}") - message(FATAL_ERROR "In-source build prohibited.\nClear cache and Start cmake from somewhere else.") - # First condition is to allow inclusion of the project from outside CMake project with - # explicit binary-directory specification. eg. add_subdirectory from Android CMakeLists.txt -endif() + + if(MSVC) if(NOT WIN_SUBSYSTEM) diff --git a/src/fsgui3d/template/CMakeLists.txt b/src/fsgui3d/template/CMakeLists.txt index e743cf7..22f7829 100644 --- a/src/fsgui3d/template/CMakeLists.txt +++ b/src/fsgui3d/template/CMakeLists.txt @@ -41,12 +41,8 @@ endif() # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. cmake_minimum_required(VERSION 3.0.0) -if("${CMAKE_CURRENT_SOURCE_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}" AND - "${CMAKE_BINARY_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}") - message(FATAL_ERROR "In-source build prohibited.\nClear cache and Start cmake from somewhere else.") - # First condition is to allow inclusion of the project from outside CMake project with - # explicit binary-directory specification. eg. add_subdirectory from Android CMakeLists.txt -endif() + + if(MSVC) if(NOT WIN_SUBSYSTEM) diff --git a/src/fsgui3d/template_with_filedialog/CMakeLists.txt b/src/fsgui3d/template_with_filedialog/CMakeLists.txt index 494598b..2fb3fa6 100644 --- a/src/fsgui3d/template_with_filedialog/CMakeLists.txt +++ b/src/fsgui3d/template_with_filedialog/CMakeLists.txt @@ -37,12 +37,8 @@ set(REALLY_NEED_CPP11 0) # Setting 1 will enable use of C++11 libraries, but # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. cmake_minimum_required(VERSION 3.0.0) -if("${CMAKE_CURRENT_SOURCE_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}" AND - "${CMAKE_BINARY_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}") - message(FATAL_ERROR "In-source build prohibited.\nClear cache and Start cmake from somewhere else.") - # First condition is to allow inclusion of the project from outside CMake project with - # explicit binary-directory specification. eg. add_subdirectory from Android CMakeLists.txt -endif() + + if(MSVC) if(NOT WIN_SUBSYSTEM) diff --git a/src/fsguilib/filedialog/CMakeLists.txt b/src/fsguilib/filedialog/CMakeLists.txt index d06e3b3..19f6c81 100644 --- a/src/fsguilib/filedialog/CMakeLists.txt +++ b/src/fsguilib/filedialog/CMakeLists.txt @@ -37,12 +37,8 @@ set(REALLY_NEED_CPP11 1) # Setting 1 will enable use of C++11 libraries, but # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. cmake_minimum_required(VERSION 3.0.0) -if("${CMAKE_CURRENT_SOURCE_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}" AND - "${CMAKE_BINARY_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}") - message(FATAL_ERROR "In-source build prohibited.\nClear cache and Start cmake from somewhere else.") - # First condition is to allow inclusion of the project from outside CMake project with - # explicit binary-directory specification. eg. add_subdirectory from Android CMakeLists.txt -endif() + + if(MSVC) if(NOT WIN_SUBSYSTEM) diff --git a/src/fsguilib/src/CMakeLists.txt b/src/fsguilib/src/CMakeLists.txt index f7f1079..95824fa 100644 --- a/src/fsguilib/src/CMakeLists.txt +++ b/src/fsguilib/src/CMakeLists.txt @@ -36,12 +36,8 @@ set(REALLY_NEED_CPP11 1) # Setting 1 will enable use of C++11 libraries, but # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. cmake_minimum_required(VERSION 3.0.0) -if("${CMAKE_CURRENT_SOURCE_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}" AND - "${CMAKE_BINARY_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}") - message(FATAL_ERROR "In-source build prohibited.\nClear cache and Start cmake from somewhere else.") - # First condition is to allow inclusion of the project from outside CMake project with - # explicit binary-directory specification. eg. add_subdirectory from Android CMakeLists.txt -endif() + + if(MSVC) if(NOT WIN_SUBSYSTEM) diff --git a/src/fsguilib/src/gl1/CMakeLists.txt b/src/fsguilib/src/gl1/CMakeLists.txt index 4aae48e..dc9b9f7 100644 --- a/src/fsguilib/src/gl1/CMakeLists.txt +++ b/src/fsguilib/src/gl1/CMakeLists.txt @@ -50,12 +50,8 @@ set(REALLY_NEED_CPP11 1) # Setting 1 will enable use of C++11 libraries, but # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. cmake_minimum_required(VERSION 3.0.0) -if("${CMAKE_CURRENT_SOURCE_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}" AND - "${CMAKE_BINARY_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}") - message(FATAL_ERROR "In-source build prohibited.\nClear cache and Start cmake from somewhere else.") - # First condition is to allow inclusion of the project from outside CMake project with - # explicit binary-directory specification. eg. add_subdirectory from Android CMakeLists.txt -endif() + + if(MSVC) if(NOT WIN_SUBSYSTEM) diff --git a/src/fsguilib/src/gl2/CMakeLists.txt b/src/fsguilib/src/gl2/CMakeLists.txt index 254d1df..37cc00e 100644 --- a/src/fsguilib/src/gl2/CMakeLists.txt +++ b/src/fsguilib/src/gl2/CMakeLists.txt @@ -48,12 +48,8 @@ set(REALLY_NEED_CPP11 1) # Setting 1 will enable use of C++11 libraries, but # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. cmake_minimum_required(VERSION 3.0.0) -if("${CMAKE_CURRENT_SOURCE_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}" AND - "${CMAKE_BINARY_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}") - message(FATAL_ERROR "In-source build prohibited.\nClear cache and Start cmake from somewhere else.") - # First condition is to allow inclusion of the project from outside CMake project with - # explicit binary-directory specification. eg. add_subdirectory from Android CMakeLists.txt -endif() + + if(MSVC) if(NOT WIN_SUBSYSTEM) diff --git a/src/fsguilib/src/nownd/CMakeLists.txt b/src/fsguilib/src/nownd/CMakeLists.txt index 9554738..76035fc 100644 --- a/src/fsguilib/src/nownd/CMakeLists.txt +++ b/src/fsguilib/src/nownd/CMakeLists.txt @@ -48,12 +48,8 @@ set(REALLY_NEED_CPP11 1) # Setting 1 will enable use of C++11 libraries, but # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. cmake_minimum_required(VERSION 3.0.0) -if("${CMAKE_CURRENT_SOURCE_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}" AND - "${CMAKE_BINARY_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}") - message(FATAL_ERROR "In-source build prohibited.\nClear cache and Start cmake from somewhere else.") - # First condition is to allow inclusion of the project from outside CMake project with - # explicit binary-directory specification. eg. add_subdirectory from Android CMakeLists.txt -endif() + + if(MSVC) if(NOT WIN_SUBSYSTEM) diff --git a/src/fsguilib/template/CMakeLists.txt b/src/fsguilib/template/CMakeLists.txt index ea2f436..818465c 100644 --- a/src/fsguilib/template/CMakeLists.txt +++ b/src/fsguilib/template/CMakeLists.txt @@ -41,12 +41,8 @@ endif() # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. cmake_minimum_required(VERSION 3.0.0) -if("${CMAKE_CURRENT_SOURCE_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}" AND - "${CMAKE_BINARY_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}") - message(FATAL_ERROR "In-source build prohibited.\nClear cache and Start cmake from somewhere else.") - # First condition is to allow inclusion of the project from outside CMake project with - # explicit binary-directory specification. eg. add_subdirectory from Android CMakeLists.txt -endif() + + if(MSVC) if(NOT WIN_SUBSYSTEM) diff --git a/src/fsguilib/template_with_filedialog/CMakeLists.txt b/src/fsguilib/template_with_filedialog/CMakeLists.txt index 2407929..a47a210 100644 --- a/src/fsguilib/template_with_filedialog/CMakeLists.txt +++ b/src/fsguilib/template_with_filedialog/CMakeLists.txt @@ -37,12 +37,8 @@ set(REALLY_NEED_CPP11 0) # Setting 1 will enable use of C++11 libraries, but # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. cmake_minimum_required(VERSION 3.0.0) -if("${CMAKE_CURRENT_SOURCE_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}" AND - "${CMAKE_BINARY_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}") - message(FATAL_ERROR "In-source build prohibited.\nClear cache and Start cmake from somewhere else.") - # First condition is to allow inclusion of the project from outside CMake project with - # explicit binary-directory specification. eg. add_subdirectory from Android CMakeLists.txt -endif() + + if(MSVC) if(NOT WIN_SUBSYSTEM) diff --git a/src/fslazywindow/samples/sample00-bouncingBall/CMakeLists.txt b/src/fslazywindow/samples/sample00-bouncingBall/CMakeLists.txt index 143f789..39b7064 100644 --- a/src/fslazywindow/samples/sample00-bouncingBall/CMakeLists.txt +++ b/src/fslazywindow/samples/sample00-bouncingBall/CMakeLists.txt @@ -53,12 +53,8 @@ endif() # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. cmake_minimum_required(VERSION 3.0.0) -if("${CMAKE_CURRENT_SOURCE_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}" AND - "${CMAKE_BINARY_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}") - message(FATAL_ERROR "In-source build prohibited.\nClear cache and Start cmake from somewhere else.") - # First condition is to allow inclusion of the project from outside CMake project with - # explicit binary-directory specification. eg. add_subdirectory from Android CMakeLists.txt -endif() + + if(MSVC) if(NOT WIN_SUBSYSTEM) diff --git a/src/fslazywindow/src/CMakeLists.txt b/src/fslazywindow/src/CMakeLists.txt index 023399a..88ab437 100644 --- a/src/fslazywindow/src/CMakeLists.txt +++ b/src/fslazywindow/src/CMakeLists.txt @@ -48,12 +48,8 @@ set(REALLY_NEED_CPP11 1) # Setting 1 will enable use of C++11 libraries, but # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. cmake_minimum_required(VERSION 3.0.0) -if("${CMAKE_CURRENT_SOURCE_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}" AND - "${CMAKE_BINARY_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}") - message(FATAL_ERROR "In-source build prohibited.\nClear cache and Start cmake from somewhere else.") - # First condition is to allow inclusion of the project from outside CMake project with - # explicit binary-directory specification. eg. add_subdirectory from Android CMakeLists.txt -endif() + + if(MSVC) if(NOT WIN_SUBSYSTEM) diff --git a/src/fslazywindow/template/CMakeLists.txt b/src/fslazywindow/template/CMakeLists.txt index 4562c0a..7f7f3b1 100644 --- a/src/fslazywindow/template/CMakeLists.txt +++ b/src/fslazywindow/template/CMakeLists.txt @@ -52,12 +52,8 @@ endif() # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. cmake_minimum_required(VERSION 3.0.0) -if("${CMAKE_CURRENT_SOURCE_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}" AND - "${CMAKE_BINARY_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}") - message(FATAL_ERROR "In-source build prohibited.\nClear cache and Start cmake from somewhere else.") - # First condition is to allow inclusion of the project from outside CMake project with - # explicit binary-directory specification. eg. add_subdirectory from Android CMakeLists.txt -endif() + + if(MSVC) if(NOT WIN_SUBSYSTEM) diff --git a/src/fssimplefiledialog/sample/CMakeLists.txt b/src/fssimplefiledialog/sample/CMakeLists.txt index 69d568f..622f9ef 100644 --- a/src/fssimplefiledialog/sample/CMakeLists.txt +++ b/src/fssimplefiledialog/sample/CMakeLists.txt @@ -48,12 +48,8 @@ set(REALLY_NEED_CPP11 1) # Setting 1 will enable use of C++11 libraries, but # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. cmake_minimum_required(VERSION 3.0.0) -if("${CMAKE_CURRENT_SOURCE_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}" AND - "${CMAKE_BINARY_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}") - message(FATAL_ERROR "In-source build prohibited.\nClear cache and Start cmake from somewhere else.") - # First condition is to allow inclusion of the project from outside CMake project with - # explicit binary-directory specification. eg. add_subdirectory from Android CMakeLists.txt -endif() + + if(MSVC) if(NOT WIN_SUBSYSTEM) diff --git a/src/fssimplefiledialog/src/CMakeLists.txt b/src/fssimplefiledialog/src/CMakeLists.txt index c42672f..242ded1 100644 --- a/src/fssimplefiledialog/src/CMakeLists.txt +++ b/src/fssimplefiledialog/src/CMakeLists.txt @@ -66,12 +66,8 @@ set(DATA_FILE_LOCATION) # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. cmake_minimum_required(VERSION 3.0.0) -if("${CMAKE_CURRENT_SOURCE_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}" AND - "${CMAKE_BINARY_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}") - message(FATAL_ERROR "In-source build prohibited.\nClear cache and Start cmake from somewhere else.") - # First condition is to allow inclusion of the project from outside CMake project with - # explicit binary-directory specification. eg. add_subdirectory from Android CMakeLists.txt -endif() + + if(MSVC) if(NOT WIN_SUBSYSTEM) diff --git a/src/opencv/arucoMarkerDetection/CMakeLists.txt b/src/opencv/arucoMarkerDetection/CMakeLists.txt index c293605..cf678b0 100644 --- a/src/opencv/arucoMarkerDetection/CMakeLists.txt +++ b/src/opencv/arucoMarkerDetection/CMakeLists.txt @@ -48,12 +48,8 @@ set(REALLY_NEED_CPP11 1) # Setting 1 will enable use of C++11 libraries, but # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. cmake_minimum_required(VERSION 3.0.0) -if("${CMAKE_CURRENT_SOURCE_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}" AND - "${CMAKE_BINARY_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}") - message(FATAL_ERROR "In-source build prohibited.\nClear cache and Start cmake from somewhere else.") - # First condition is to allow inclusion of the project from outside CMake project with - # explicit binary-directory specification. eg. add_subdirectory from Android CMakeLists.txt -endif() + + if(MSVC) if(NOT WIN_SUBSYSTEM) diff --git a/src/opencv/drawMarker/CMakeLists.txt b/src/opencv/drawMarker/CMakeLists.txt index 9668bd6..c054850 100644 --- a/src/opencv/drawMarker/CMakeLists.txt +++ b/src/opencv/drawMarker/CMakeLists.txt @@ -65,12 +65,8 @@ set(DATA_FILE_LOCATION) # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. cmake_minimum_required(VERSION 3.0.0) -if("${CMAKE_CURRENT_SOURCE_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}" AND - "${CMAKE_BINARY_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}") - message(FATAL_ERROR "In-source build prohibited.\nClear cache and Start cmake from somewhere else.") - # First condition is to allow inclusion of the project from outside CMake project with - # explicit binary-directory specification. eg. add_subdirectory from Android CMakeLists.txt -endif() + + if(MSVC) if(NOT WIN_SUBSYSTEM) diff --git a/src/opencv/videoCapture/CMakeLists.txt b/src/opencv/videoCapture/CMakeLists.txt index 7acd752..541fceb 100644 --- a/src/opencv/videoCapture/CMakeLists.txt +++ b/src/opencv/videoCapture/CMakeLists.txt @@ -52,12 +52,8 @@ endif() # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. cmake_minimum_required(VERSION 3.0.0) -if("${CMAKE_CURRENT_SOURCE_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}" AND - "${CMAKE_BINARY_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}") - message(FATAL_ERROR "In-source build prohibited.\nClear cache and Start cmake from somewhere else.") - # First condition is to allow inclusion of the project from outside CMake project with - # explicit binary-directory specification. eg. add_subdirectory from Android CMakeLists.txt -endif() + + if(MSVC) if(NOT WIN_SUBSYSTEM) diff --git a/src/ysclass/src/CMakeLists.txt b/src/ysclass/src/CMakeLists.txt index cacfca4..09aba89 100644 --- a/src/ysclass/src/CMakeLists.txt +++ b/src/ysclass/src/CMakeLists.txt @@ -36,12 +36,8 @@ set(REALLY_NEED_CPP11 0) # Setting 1 will enable use of C++11 libraries, but # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. cmake_minimum_required(VERSION 3.0.0) -if("${CMAKE_CURRENT_SOURCE_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}" AND - "${CMAKE_BINARY_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}") - message(FATAL_ERROR "In-source build prohibited.\nClear cache and Start cmake from somewhere else.") - # First condition is to allow inclusion of the project from outside CMake project with - # explicit binary-directory specification. eg. add_subdirectory from Android CMakeLists.txt -endif() + + if(MSVC) if(NOT WIN_SUBSYSTEM) diff --git a/src/ysclass11/src/CMakeLists.txt b/src/ysclass11/src/CMakeLists.txt index 0bd4494..ae9db7a 100644 --- a/src/ysclass11/src/CMakeLists.txt +++ b/src/ysclass11/src/CMakeLists.txt @@ -36,12 +36,8 @@ set(REALLY_NEED_CPP11 1) # Setting 1 will enable use of C++11 libraries, but # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. cmake_minimum_required(VERSION 3.0.0) -if("${CMAKE_CURRENT_SOURCE_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}" AND - "${CMAKE_BINARY_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}") - message(FATAL_ERROR "In-source build prohibited.\nClear cache and Start cmake from somewhere else.") - # First condition is to allow inclusion of the project from outside CMake project with - # explicit binary-directory specification. eg. add_subdirectory from Android CMakeLists.txt -endif() + + if(MSVC) if(NOT WIN_SUBSYSTEM) diff --git a/src/ysfontrenderer/src/CMakeLists.txt b/src/ysfontrenderer/src/CMakeLists.txt index 9c920cf..02e9edf 100644 --- a/src/ysfontrenderer/src/CMakeLists.txt +++ b/src/ysfontrenderer/src/CMakeLists.txt @@ -40,12 +40,8 @@ set(REALLY_NEED_CPP11 0) # Setting 1 will enable use of C++11 libraries, but # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. cmake_minimum_required(VERSION 3.0.0) -if("${CMAKE_CURRENT_SOURCE_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}" AND - "${CMAKE_BINARY_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}") - message(FATAL_ERROR "In-source build prohibited.\nClear cache and Start cmake from somewhere else.") - # First condition is to allow inclusion of the project from outside CMake project with - # explicit binary-directory specification. eg. add_subdirectory from Android CMakeLists.txt -endif() + + if(MSVC) if(NOT WIN_SUBSYSTEM) diff --git a/src/ysgebl/src/cmdlib/CMakeLists.txt b/src/ysgebl/src/cmdlib/CMakeLists.txt index 5d917e9..fe4d8e0 100644 --- a/src/ysgebl/src/cmdlib/CMakeLists.txt +++ b/src/ysgebl/src/cmdlib/CMakeLists.txt @@ -47,12 +47,8 @@ set(REALLY_NEED_CPP11 0) # Setting 1 will enable use of C++11 libraries, but # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. cmake_minimum_required(VERSION 3.0.0) -if("${CMAKE_CURRENT_SOURCE_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}" AND - "${CMAKE_BINARY_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}") - message(FATAL_ERROR "In-source build prohibited.\nClear cache and Start cmake from somewhere else.") - # First condition is to allow inclusion of the project from outside CMake project with - # explicit binary-directory specification. eg. add_subdirectory from Android CMakeLists.txt -endif() + + if(MSVC) if(NOT WIN_SUBSYSTEM) diff --git a/src/ysgebl/src/cmdmain/CMakeLists.txt b/src/ysgebl/src/cmdmain/CMakeLists.txt index 135145e..6104f4e 100644 --- a/src/ysgebl/src/cmdmain/CMakeLists.txt +++ b/src/ysgebl/src/cmdmain/CMakeLists.txt @@ -47,12 +47,8 @@ set(REALLY_NEED_CPP11 0) # Setting 1 will enable use of C++11 libraries, but # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. cmake_minimum_required(VERSION 3.0.0) -if("${CMAKE_CURRENT_SOURCE_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}" AND - "${CMAKE_BINARY_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}") - message(FATAL_ERROR "In-source build prohibited.\nClear cache and Start cmake from somewhere else.") - # First condition is to allow inclusion of the project from outside CMake project with - # explicit binary-directory specification. eg. add_subdirectory from Android CMakeLists.txt -endif() + + if(MSVC) if(NOT WIN_SUBSYSTEM) diff --git a/src/ysgebl/src/gui/CMakeLists.txt b/src/ysgebl/src/gui/CMakeLists.txt index 70fae92..03ca224 100644 --- a/src/ysgebl/src/gui/CMakeLists.txt +++ b/src/ysgebl/src/gui/CMakeLists.txt @@ -37,12 +37,8 @@ set(REALLY_NEED_CPP11 1) # Setting 1 will enable use of C++11 libraries, but # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. cmake_minimum_required(VERSION 3.0.0) -if("${CMAKE_CURRENT_SOURCE_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}" AND - "${CMAKE_BINARY_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}") - message(FATAL_ERROR "In-source build prohibited.\nClear cache and Start cmake from somewhere else.") - # First condition is to allow inclusion of the project from outside CMake project with - # explicit binary-directory specification. eg. add_subdirectory from Android CMakeLists.txt -endif() + + if(MSVC) if(NOT WIN_SUBSYSTEM) diff --git a/src/ysgebl/src/gui_foundation/CMakeLists.txt b/src/ysgebl/src/gui_foundation/CMakeLists.txt index 76fbfbf..5517e84 100644 --- a/src/ysgebl/src/gui_foundation/CMakeLists.txt +++ b/src/ysgebl/src/gui_foundation/CMakeLists.txt @@ -48,12 +48,8 @@ set(REALLY_NEED_CPP11 1) # Setting 1 will enable use of C++11 libraries, but # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. cmake_minimum_required(VERSION 3.0.0) -if("${CMAKE_CURRENT_SOURCE_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}" AND - "${CMAKE_BINARY_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}") - message(FATAL_ERROR "In-source build prohibited.\nClear cache and Start cmake from somewhere else.") - # First condition is to allow inclusion of the project from outside CMake project with - # explicit binary-directory specification. eg. add_subdirectory from Android CMakeLists.txt -endif() + + if(MSVC) if(NOT WIN_SUBSYSTEM) diff --git a/src/ysgebl/src/kernel/CMakeLists.txt b/src/ysgebl/src/kernel/CMakeLists.txt index 54dcb4f..de0ab1d 100644 --- a/src/ysgebl/src/kernel/CMakeLists.txt +++ b/src/ysgebl/src/kernel/CMakeLists.txt @@ -37,12 +37,8 @@ set(REALLY_NEED_CPP11 1) # Setting 1 will enable use of C++11 libraries, but # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. cmake_minimum_required(VERSION 3.0.0) -if("${CMAKE_CURRENT_SOURCE_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}" AND - "${CMAKE_BINARY_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}") - message(FATAL_ERROR "In-source build prohibited.\nClear cache and Start cmake from somewhere else.") - # First condition is to allow inclusion of the project from outside CMake project with - # explicit binary-directory specification. eg. add_subdirectory from Android CMakeLists.txt -endif() + + if(MSVC) if(NOT WIN_SUBSYSTEM) diff --git a/src/ysgebl/src/kernelutil/CMakeLists.txt b/src/ysgebl/src/kernelutil/CMakeLists.txt index 01d9a1d..2df4cb6 100644 --- a/src/ysgebl/src/kernelutil/CMakeLists.txt +++ b/src/ysgebl/src/kernelutil/CMakeLists.txt @@ -37,12 +37,8 @@ set(REALLY_NEED_CPP11 1) # Setting 1 will enable use of C++11 libraries, but # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. cmake_minimum_required(VERSION 3.0.0) -if("${CMAKE_CURRENT_SOURCE_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}" AND - "${CMAKE_BINARY_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}") - message(FATAL_ERROR "In-source build prohibited.\nClear cache and Start cmake from somewhere else.") - # First condition is to allow inclusion of the project from outside CMake project with - # explicit binary-directory specification. eg. add_subdirectory from Android CMakeLists.txt -endif() + + if(MSVC) if(NOT WIN_SUBSYSTEM) diff --git a/src/ysgebl/src/main/CMakeLists.txt b/src/ysgebl/src/main/CMakeLists.txt index e6be764..2e26fd3 100644 --- a/src/ysgebl/src/main/CMakeLists.txt +++ b/src/ysgebl/src/main/CMakeLists.txt @@ -73,12 +73,8 @@ endif() # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. cmake_minimum_required(VERSION 3.0.0) -if("${CMAKE_CURRENT_SOURCE_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}" AND - "${CMAKE_BINARY_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}") - message(FATAL_ERROR "In-source build prohibited.\nClear cache and Start cmake from somewhere else.") - # First condition is to allow inclusion of the project from outside CMake project with - # explicit binary-directory specification. eg. add_subdirectory from Android CMakeLists.txt -endif() + + if(MSVC) if(NOT WIN_SUBSYSTEM) diff --git a/src/ysgebl/src/samples/YsShellExt/CMakeLists.txt b/src/ysgebl/src/samples/YsShellExt/CMakeLists.txt index bd0a68b..43ce513 100644 --- a/src/ysgebl/src/samples/YsShellExt/CMakeLists.txt +++ b/src/ysgebl/src/samples/YsShellExt/CMakeLists.txt @@ -48,12 +48,8 @@ set(REALLY_NEED_CPP11 1) # Setting 1 will enable use of C++11 libraries, but # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. cmake_minimum_required(VERSION 3.0.0) -if("${CMAKE_CURRENT_SOURCE_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}" AND - "${CMAKE_BINARY_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}") - message(FATAL_ERROR "In-source build prohibited.\nClear cache and Start cmake from somewhere else.") - # First condition is to allow inclusion of the project from outside CMake project with - # explicit binary-directory specification. eg. add_subdirectory from Android CMakeLists.txt -endif() + + if(MSVC) if(NOT WIN_SUBSYSTEM) diff --git a/src/ysgebl/src/shellrender/CMakeLists.txt b/src/ysgebl/src/shellrender/CMakeLists.txt index d440a25..4d4476d 100644 --- a/src/ysgebl/src/shellrender/CMakeLists.txt +++ b/src/ysgebl/src/shellrender/CMakeLists.txt @@ -48,12 +48,8 @@ set(REALLY_NEED_CPP11 1) # Setting 1 will enable use of C++11 libraries, but # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. cmake_minimum_required(VERSION 3.0.0) -if("${CMAKE_CURRENT_SOURCE_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}" AND - "${CMAKE_BINARY_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}") - message(FATAL_ERROR "In-source build prohibited.\nClear cache and Start cmake from somewhere else.") - # First condition is to allow inclusion of the project from outside CMake project with - # explicit binary-directory specification. eg. add_subdirectory from Android CMakeLists.txt -endif() + + if(MSVC) if(NOT WIN_SUBSYSTEM) diff --git a/src/ysgebl/src/shellrender/gl1/CMakeLists.txt b/src/ysgebl/src/shellrender/gl1/CMakeLists.txt index e62726b..5221cd0 100644 --- a/src/ysgebl/src/shellrender/gl1/CMakeLists.txt +++ b/src/ysgebl/src/shellrender/gl1/CMakeLists.txt @@ -50,12 +50,8 @@ set(REALLY_NEED_CPP11 1) # Setting 1 will enable use of C++11 libraries, but # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. cmake_minimum_required(VERSION 3.0.0) -if("${CMAKE_CURRENT_SOURCE_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}" AND - "${CMAKE_BINARY_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}") - message(FATAL_ERROR "In-source build prohibited.\nClear cache and Start cmake from somewhere else.") - # First condition is to allow inclusion of the project from outside CMake project with - # explicit binary-directory specification. eg. add_subdirectory from Android CMakeLists.txt -endif() + + if(MSVC) if(NOT WIN_SUBSYSTEM) diff --git a/src/ysgebl/src/shellrender/gl2/CMakeLists.txt b/src/ysgebl/src/shellrender/gl2/CMakeLists.txt index 22a132f..b709384 100644 --- a/src/ysgebl/src/shellrender/gl2/CMakeLists.txt +++ b/src/ysgebl/src/shellrender/gl2/CMakeLists.txt @@ -48,12 +48,8 @@ set(REALLY_NEED_CPP11 1) # Setting 1 will enable use of C++11 libraries, but # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. cmake_minimum_required(VERSION 3.0.0) -if("${CMAKE_CURRENT_SOURCE_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}" AND - "${CMAKE_BINARY_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}") - message(FATAL_ERROR "In-source build prohibited.\nClear cache and Start cmake from somewhere else.") - # First condition is to allow inclusion of the project from outside CMake project with - # explicit binary-directory specification. eg. add_subdirectory from Android CMakeLists.txt -endif() + + if(MSVC) if(NOT WIN_SUBSYSTEM) diff --git a/src/ysgebl/src/shellrender/nownd/CMakeLists.txt b/src/ysgebl/src/shellrender/nownd/CMakeLists.txt index 601df40..2b9c5af 100644 --- a/src/ysgebl/src/shellrender/nownd/CMakeLists.txt +++ b/src/ysgebl/src/shellrender/nownd/CMakeLists.txt @@ -50,12 +50,8 @@ set(REALLY_NEED_CPP11 1) # Setting 1 will enable use of C++11 libraries, but # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. cmake_minimum_required(VERSION 3.0.0) -if("${CMAKE_CURRENT_SOURCE_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}" AND - "${CMAKE_BINARY_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}") - message(FATAL_ERROR "In-source build prohibited.\nClear cache and Start cmake from somewhere else.") - # First condition is to allow inclusion of the project from outside CMake project with - # explicit binary-directory specification. eg. add_subdirectory from Android CMakeLists.txt -endif() + + if(MSVC) if(NOT WIN_SUBSYSTEM) diff --git a/src/ysgl/src/CMakeLists.txt b/src/ysgl/src/CMakeLists.txt index a40cd07..e1632ce 100644 --- a/src/ysgl/src/CMakeLists.txt +++ b/src/ysgl/src/CMakeLists.txt @@ -54,12 +54,8 @@ endif() # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. cmake_minimum_required(VERSION 3.0.0) -if("${CMAKE_CURRENT_SOURCE_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}" AND - "${CMAKE_BINARY_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}") - message(FATAL_ERROR "In-source build prohibited.\nClear cache and Start cmake from somewhere else.") - # First condition is to allow inclusion of the project from outside CMake project with - # explicit binary-directory specification. eg. add_subdirectory from Android CMakeLists.txt -endif() + + if(MSVC) if(NOT WIN_SUBSYSTEM) diff --git a/src/ysglcpp/src/CMakeLists.txt b/src/ysglcpp/src/CMakeLists.txt index 63944ce..4aeb6bf 100644 --- a/src/ysglcpp/src/CMakeLists.txt +++ b/src/ysglcpp/src/CMakeLists.txt @@ -36,12 +36,8 @@ set(REALLY_NEED_CPP11 0) # Setting 1 will enable use of C++11 libraries, but # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. cmake_minimum_required(VERSION 3.0.0) -if("${CMAKE_CURRENT_SOURCE_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}" AND - "${CMAKE_BINARY_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}") - message(FATAL_ERROR "In-source build prohibited.\nClear cache and Start cmake from somewhere else.") - # First condition is to allow inclusion of the project from outside CMake project with - # explicit binary-directory specification. eg. add_subdirectory from Android CMakeLists.txt -endif() + + if(MSVC) if(NOT WIN_SUBSYSTEM) diff --git a/src/ysglcpp/src/gl1/CMakeLists.txt b/src/ysglcpp/src/gl1/CMakeLists.txt index 638f4e7..817023a 100644 --- a/src/ysglcpp/src/gl1/CMakeLists.txt +++ b/src/ysglcpp/src/gl1/CMakeLists.txt @@ -50,12 +50,8 @@ set(REALLY_NEED_CPP11 1) # Setting 1 will enable use of C++11 libraries, but # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. cmake_minimum_required(VERSION 3.0.0) -if("${CMAKE_CURRENT_SOURCE_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}" AND - "${CMAKE_BINARY_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}") - message(FATAL_ERROR "In-source build prohibited.\nClear cache and Start cmake from somewhere else.") - # First condition is to allow inclusion of the project from outside CMake project with - # explicit binary-directory specification. eg. add_subdirectory from Android CMakeLists.txt -endif() + + if(MSVC) if(NOT WIN_SUBSYSTEM) diff --git a/src/ysglcpp/src/gl2/CMakeLists.txt b/src/ysglcpp/src/gl2/CMakeLists.txt index 64f823e..d8df9d0 100644 --- a/src/ysglcpp/src/gl2/CMakeLists.txt +++ b/src/ysglcpp/src/gl2/CMakeLists.txt @@ -48,12 +48,8 @@ set(REALLY_NEED_CPP11 1) # Setting 1 will enable use of C++11 libraries, but # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. cmake_minimum_required(VERSION 3.0.0) -if("${CMAKE_CURRENT_SOURCE_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}" AND - "${CMAKE_BINARY_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}") - message(FATAL_ERROR "In-source build prohibited.\nClear cache and Start cmake from somewhere else.") - # First condition is to allow inclusion of the project from outside CMake project with - # explicit binary-directory specification. eg. add_subdirectory from Android CMakeLists.txt -endif() + + if(MSVC) if(NOT WIN_SUBSYSTEM) diff --git a/src/ysglcpp/src/nownd/CMakeLists.txt b/src/ysglcpp/src/nownd/CMakeLists.txt index 6ea2b1d..558e065 100644 --- a/src/ysglcpp/src/nownd/CMakeLists.txt +++ b/src/ysglcpp/src/nownd/CMakeLists.txt @@ -48,12 +48,8 @@ set(REALLY_NEED_CPP11 1) # Setting 1 will enable use of C++11 libraries, but # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. cmake_minimum_required(VERSION 3.0.0) -if("${CMAKE_CURRENT_SOURCE_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}" AND - "${CMAKE_BINARY_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}") - message(FATAL_ERROR "In-source build prohibited.\nClear cache and Start cmake from somewhere else.") - # First condition is to allow inclusion of the project from outside CMake project with - # explicit binary-directory specification. eg. add_subdirectory from Android CMakeLists.txt -endif() + + if(MSVC) if(NOT WIN_SUBSYSTEM) diff --git a/src/ysport/src/CMakeLists.txt b/src/ysport/src/CMakeLists.txt index 4806fc9..4628da1 100644 --- a/src/ysport/src/CMakeLists.txt +++ b/src/ysport/src/CMakeLists.txt @@ -46,12 +46,8 @@ endif() # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. cmake_minimum_required(VERSION 3.0.0) -if("${CMAKE_CURRENT_SOURCE_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}" AND - "${CMAKE_BINARY_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}") - message(FATAL_ERROR "In-source build prohibited.\nClear cache and Start cmake from somewhere else.") - # First condition is to allow inclusion of the project from outside CMake project with - # explicit binary-directory specification. eg. add_subdirectory from Android CMakeLists.txt -endif() + + if(MSVC) if(NOT WIN_SUBSYSTEM) diff --git a/src/ystexturemanager/src/CMakeLists.txt b/src/ystexturemanager/src/CMakeLists.txt index 31b6964..1c90814 100644 --- a/src/ystexturemanager/src/CMakeLists.txt +++ b/src/ystexturemanager/src/CMakeLists.txt @@ -37,12 +37,8 @@ set(REALLY_NEED_CPP11 0) # Setting 1 will enable use of C++11 libraries, but # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. cmake_minimum_required(VERSION 3.0.0) -if("${CMAKE_CURRENT_SOURCE_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}" AND - "${CMAKE_BINARY_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}") - message(FATAL_ERROR "In-source build prohibited.\nClear cache and Start cmake from somewhere else.") - # First condition is to allow inclusion of the project from outside CMake project with - # explicit binary-directory specification. eg. add_subdirectory from Android CMakeLists.txt -endif() + + if(MSVC) if(NOT WIN_SUBSYSTEM) diff --git a/src/ystexturemanager/src/gl/CMakeLists.txt b/src/ystexturemanager/src/gl/CMakeLists.txt index 2c4c179..f800ed1 100644 --- a/src/ystexturemanager/src/gl/CMakeLists.txt +++ b/src/ystexturemanager/src/gl/CMakeLists.txt @@ -48,12 +48,8 @@ set(REALLY_NEED_CPP11 1) # Setting 1 will enable use of C++11 libraries, but # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. cmake_minimum_required(VERSION 3.0.0) -if("${CMAKE_CURRENT_SOURCE_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}" AND - "${CMAKE_BINARY_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}") - message(FATAL_ERROR "In-source build prohibited.\nClear cache and Start cmake from somewhere else.") - # First condition is to allow inclusion of the project from outside CMake project with - # explicit binary-directory specification. eg. add_subdirectory from Android CMakeLists.txt -endif() + + if(MSVC) if(NOT WIN_SUBSYSTEM) diff --git a/src/ystexturemanager/src/null/CMakeLists.txt b/src/ystexturemanager/src/null/CMakeLists.txt index 8b63954..7b92d3f 100644 --- a/src/ystexturemanager/src/null/CMakeLists.txt +++ b/src/ystexturemanager/src/null/CMakeLists.txt @@ -48,12 +48,8 @@ set(REALLY_NEED_CPP11 1) # Setting 1 will enable use of C++11 libraries, but # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. cmake_minimum_required(VERSION 3.0.0) -if("${CMAKE_CURRENT_SOURCE_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}" AND - "${CMAKE_BINARY_DIR}" MATCHES "^${CMAKE_SOURCE_DIR}") - message(FATAL_ERROR "In-source build prohibited.\nClear cache and Start cmake from somewhere else.") - # First condition is to allow inclusion of the project from outside CMake project with - # explicit binary-directory specification. eg. add_subdirectory from Android CMakeLists.txt -endif() + + if(MSVC) if(NOT WIN_SUBSYSTEM) From db4e57d19a4dac90dcd192ed13a5cc431fdd177e Mon Sep 17 00:00:00 2001 From: Soji Yamakawa Date: Thu, 5 Dec 2024 13:16:26 -0500 Subject: [PATCH 3/8] Removed in-source build rejection. --- src/ysclass/src/CMakeFiles | 8 -------- src/ysgebl/src/gui/CMakeFiles | 8 -------- src/ysgebl/src/kernel/CMakeFiles | 8 -------- src/ysgebl/src/kernelutil/CMakeFiles | 8 -------- src/ysgebl/src/main/CMakeFiles | 8 -------- src/ysport/src/CMakeFiles | 8 -------- 6 files changed, 48 deletions(-) delete mode 100644 src/ysclass/src/CMakeFiles delete mode 100644 src/ysgebl/src/gui/CMakeFiles delete mode 100644 src/ysgebl/src/kernel/CMakeFiles delete mode 100644 src/ysgebl/src/kernelutil/CMakeFiles delete mode 100644 src/ysgebl/src/main/CMakeFiles delete mode 100644 src/ysport/src/CMakeFiles diff --git a/src/ysclass/src/CMakeFiles b/src/ysclass/src/CMakeFiles deleted file mode 100644 index fa775f6..0000000 --- a/src/ysclass/src/CMakeFiles +++ /dev/null @@ -1,8 +0,0 @@ -This file prevents accidental in-source build from this directory. - -What's horrible about cmake is if I accidentally type cmake where CMakeLists.txt exists, cmake happily considers it as an in-source build, and contaminate the directory with the build-related files. There seems to be no way of preventing accidental massive file contamination. Just one mistake is enough. It's as bad as accidental "rm -r *", because a lot of "rm -r something" follows to de-contaminate the source directory. - -However, cmake needs to create a directory called CMakeFiles to set up build-related files. It stops after creating CMakeCache.txt. - -Probably, creating a directory called CMakeCache.txt is also as effective. - diff --git a/src/ysgebl/src/gui/CMakeFiles b/src/ysgebl/src/gui/CMakeFiles deleted file mode 100644 index fa775f6..0000000 --- a/src/ysgebl/src/gui/CMakeFiles +++ /dev/null @@ -1,8 +0,0 @@ -This file prevents accidental in-source build from this directory. - -What's horrible about cmake is if I accidentally type cmake where CMakeLists.txt exists, cmake happily considers it as an in-source build, and contaminate the directory with the build-related files. There seems to be no way of preventing accidental massive file contamination. Just one mistake is enough. It's as bad as accidental "rm -r *", because a lot of "rm -r something" follows to de-contaminate the source directory. - -However, cmake needs to create a directory called CMakeFiles to set up build-related files. It stops after creating CMakeCache.txt. - -Probably, creating a directory called CMakeCache.txt is also as effective. - diff --git a/src/ysgebl/src/kernel/CMakeFiles b/src/ysgebl/src/kernel/CMakeFiles deleted file mode 100644 index fa775f6..0000000 --- a/src/ysgebl/src/kernel/CMakeFiles +++ /dev/null @@ -1,8 +0,0 @@ -This file prevents accidental in-source build from this directory. - -What's horrible about cmake is if I accidentally type cmake where CMakeLists.txt exists, cmake happily considers it as an in-source build, and contaminate the directory with the build-related files. There seems to be no way of preventing accidental massive file contamination. Just one mistake is enough. It's as bad as accidental "rm -r *", because a lot of "rm -r something" follows to de-contaminate the source directory. - -However, cmake needs to create a directory called CMakeFiles to set up build-related files. It stops after creating CMakeCache.txt. - -Probably, creating a directory called CMakeCache.txt is also as effective. - diff --git a/src/ysgebl/src/kernelutil/CMakeFiles b/src/ysgebl/src/kernelutil/CMakeFiles deleted file mode 100644 index fa775f6..0000000 --- a/src/ysgebl/src/kernelutil/CMakeFiles +++ /dev/null @@ -1,8 +0,0 @@ -This file prevents accidental in-source build from this directory. - -What's horrible about cmake is if I accidentally type cmake where CMakeLists.txt exists, cmake happily considers it as an in-source build, and contaminate the directory with the build-related files. There seems to be no way of preventing accidental massive file contamination. Just one mistake is enough. It's as bad as accidental "rm -r *", because a lot of "rm -r something" follows to de-contaminate the source directory. - -However, cmake needs to create a directory called CMakeFiles to set up build-related files. It stops after creating CMakeCache.txt. - -Probably, creating a directory called CMakeCache.txt is also as effective. - diff --git a/src/ysgebl/src/main/CMakeFiles b/src/ysgebl/src/main/CMakeFiles deleted file mode 100644 index fa775f6..0000000 --- a/src/ysgebl/src/main/CMakeFiles +++ /dev/null @@ -1,8 +0,0 @@ -This file prevents accidental in-source build from this directory. - -What's horrible about cmake is if I accidentally type cmake where CMakeLists.txt exists, cmake happily considers it as an in-source build, and contaminate the directory with the build-related files. There seems to be no way of preventing accidental massive file contamination. Just one mistake is enough. It's as bad as accidental "rm -r *", because a lot of "rm -r something" follows to de-contaminate the source directory. - -However, cmake needs to create a directory called CMakeFiles to set up build-related files. It stops after creating CMakeCache.txt. - -Probably, creating a directory called CMakeCache.txt is also as effective. - diff --git a/src/ysport/src/CMakeFiles b/src/ysport/src/CMakeFiles deleted file mode 100644 index fa775f6..0000000 --- a/src/ysport/src/CMakeFiles +++ /dev/null @@ -1,8 +0,0 @@ -This file prevents accidental in-source build from this directory. - -What's horrible about cmake is if I accidentally type cmake where CMakeLists.txt exists, cmake happily considers it as an in-source build, and contaminate the directory with the build-related files. There seems to be no way of preventing accidental massive file contamination. Just one mistake is enough. It's as bad as accidental "rm -r *", because a lot of "rm -r something" follows to de-contaminate the source directory. - -However, cmake needs to create a directory called CMakeFiles to set up build-related files. It stops after creating CMakeCache.txt. - -Probably, creating a directory called CMakeCache.txt is also as effective. - From 51242d64f87266380fec8ddba3c08109e79236e5 Mon Sep 17 00:00:00 2001 From: Soji Yamakawa Date: Thu, 5 Dec 2024 13:29:31 -0500 Subject: [PATCH 4/8] Missing include --- src/ysclass11/src/ysthreadpool.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ysclass11/src/ysthreadpool.cpp b/src/ysclass11/src/ysthreadpool.cpp index 4f33a05..3add8ca 100644 --- a/src/ysclass11/src/ysthreadpool.cpp +++ b/src/ysclass11/src/ysthreadpool.cpp @@ -27,6 +27,7 @@ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. //////////////////////////////////////////////////////////// */ +#include #include "ysthreadpool.h" From ea5e2659e909f4e7be8ac8ed14545f80db585cd7 Mon Sep 17 00:00:00 2001 From: Soji Yamakawa Date: Sun, 8 Dec 2024 20:25:54 -0500 Subject: [PATCH 5/8] Add limited support for .PLY --- src/ysgebl/src/gui/filemenu/filemenu.cpp | 1 + .../ysgebl_gui_foundation_io.cpp | 24 ++ src/ysgebl/src/kernel/ysshellext.cpp | 7 + src/ysgebl/src/kernel/ysshellext.h | 3 + src/ysgebl/src/kernel/ysshellextedit.cpp | 20 + src/ysgebl/src/kernel/ysshellextedit.h | 6 + src/ysgebl/src/kernel/ysshellextio.cpp | 373 +++++++++++++++++- src/ysgebl/src/kernel/ysshellextio.h | 94 +++++ 8 files changed, 527 insertions(+), 1 deletion(-) diff --git a/src/ysgebl/src/gui/filemenu/filemenu.cpp b/src/ysgebl/src/gui/filemenu/filemenu.cpp index a0081ec..a4a9825 100644 --- a/src/ysgebl/src/gui/filemenu/filemenu.cpp +++ b/src/ysgebl/src/gui/filemenu/filemenu.cpp @@ -80,6 +80,7 @@ void GeblGuiEditorBase::File_Open(FsGuiPopUpMenuItem *) fdlg->fileExtensionArray.Append(L".srf"); fdlg->fileExtensionArray.Append(L".stl"); fdlg->fileExtensionArray.Append(L".obj"); + fdlg->fileExtensionArray.Append(L".ply"); fdlg->fileExtensionArray.Append(L".off"); fdlg->fileExtensionArray.Append(L".dxf"); fdlg->fileExtensionArray.Append(L".dnm"); diff --git a/src/ysgebl/src/gui_foundation/ysgebl_gui_foundation_io.cpp b/src/ysgebl/src/gui_foundation/ysgebl_gui_foundation_io.cpp index 9c4e634..de51337 100644 --- a/src/ysgebl/src/gui_foundation/ysgebl_gui_foundation_io.cpp +++ b/src/ysgebl/src/gui_foundation/ysgebl_gui_foundation_io.cpp @@ -142,6 +142,30 @@ GeblGuiFoundation::SlhdAndErrorCode GeblGuiFoundation::LoadGeneral(const wchar_t returnValue.errCode=GEBLERROR_FILE_NOT_FOUND; } } + else if(0==ext.STRCMP(L".PLY")) + { + YsFileIO::File fp(fn,"r"); + if(NULL!=fp) + { + YsShellDnmContainer ::Node *newSlHd=shlGrp.CreateShell(parent); + + auto inStream=fp.InStream(); + if(YSOK==newSlHd->LoadPly(inStream)) + { + newSlHd->SetFileName(fn); + returnValue.slHd=newSlHd; + } + else + { + shlGrp.DeleteShell(newSlHd); + returnValue.errCode=GEBLERROR_FILE_CORRUPTED; + } + } + else + { + returnValue.errCode=GEBLERROR_FILE_NOT_FOUND; + } + } else if(0==ext.STRCMP(L".OFF")) { YsFileIO::File fp(fn,"r"); diff --git a/src/ysgebl/src/kernel/ysshellext.cpp b/src/ysgebl/src/kernel/ysshellext.cpp index 05f11b7..ff5e21c 100644 --- a/src/ysgebl/src/kernel/ysshellext.cpp +++ b/src/ysgebl/src/kernel/ysshellext.cpp @@ -766,6 +766,13 @@ YSRESULT YsShellExt::LoadObj(YsTextInputStream &inStream) return objReader.ReadObj(*this,inStream,opt); } +YSRESULT YsShellExt::LoadPly(YsTextInputStream &inStream) +{ + YsShellExtPlyReader::ReadOption opt; + YsShellExtPlyReader PlyReader; + return PlyReader.ReadPly(*this,inStream,opt); +} + YsShellExtDrawingBuffer &YsShellExt::GetDrawingBuffer(void) const { return *drawingBuffer; diff --git a/src/ysgebl/src/kernel/ysshellext.h b/src/ysgebl/src/kernel/ysshellext.h index eb18f70..068b6f7 100644 --- a/src/ysgebl/src/kernel/ysshellext.h +++ b/src/ysgebl/src/kernel/ysshellext.h @@ -1224,6 +1224,9 @@ class YsShellExt : protected YsShell /*! This function loads Wavefront .OBJ data. */ YSRESULT LoadObj(YsTextInputStream &inStream); + /*! This function loads Wavefront .OBJ data. */ + YSRESULT LoadPly(YsTextInputStream &inStream); + /*! This function returns a drawing-buffer. A drawing buffer stores primitive informations for rendering. */ YsShellExtDrawingBuffer &GetDrawingBuffer(void) const; diff --git a/src/ysgebl/src/kernel/ysshellextedit.cpp b/src/ysgebl/src/kernel/ysshellextedit.cpp index 1dda1cf..350d07f 100644 --- a/src/ysgebl/src/kernel/ysshellextedit.cpp +++ b/src/ysgebl/src/kernel/ysshellextedit.cpp @@ -397,6 +397,26 @@ YSRESULT YsShellExtEdit::LoadObj(YsTextInputStream &inStream) return objReader.ReadObj(*this,inStream,opt); } +YSRESULT YsShellExtEdit::LoadPly(const char fn[]) +{ + FILE *fp=fopen(fn,"r"); + if(NULL!=fp) + { + YsTextFileInputStream inStream(fp); + YSRESULT res=LoadPly(inStream); + fclose(fp); + return res; + } + return YSERR; +} + +YSRESULT YsShellExtEdit::LoadPly(YsTextInputStream &inStream) +{ + YsShellExtPlyReader::ReadOption opt; + YsShellExtPlyReader PlyReader; + return PlyReader.ReadPly(*this,inStream,opt); +} + YSRESULT YsShellExtEdit::MergeObj(YsTextInputStream &inStream) { YsShellExtObjReader::ReadOption opt; diff --git a/src/ysgebl/src/kernel/ysshellextedit.h b/src/ysgebl/src/kernel/ysshellextedit.h index 4c9f5d6..44aa764 100644 --- a/src/ysgebl/src/kernel/ysshellextedit.h +++ b/src/ysgebl/src/kernel/ysshellextedit.h @@ -634,6 +634,12 @@ class YsShellExtEdit : private YsShellExt /*! This function loads Wavefront .OBJ data. */ YSRESULT LoadObj(YsTextInputStream &inStream); + /*! This function loads .PLY data. */ + YSRESULT LoadPly(const char fn[]); + + /*! This function loads .PLY data. */ + YSRESULT LoadPly(YsTextInputStream &inStream); + /*! This function loads Wavefront .OBJ data. */ YSRESULT MergeObj(YsTextInputStream &inStream); diff --git a/src/ysgebl/src/kernel/ysshellextio.cpp b/src/ysgebl/src/kernel/ysshellextio.cpp index e5b3756..acfc18a 100644 --- a/src/ysgebl/src/kernel/ysshellextio.cpp +++ b/src/ysgebl/src/kernel/ysshellextio.cpp @@ -1950,10 +1950,359 @@ YSRESULT YsShellExtDxfReader::ReadDxf(YsShellExt &shl,YsTextInputStream &inStrea } - //////////////////////////////////////////////////////////// +void YsShellExtPlyReader::BeginRead(const ReadOption &option) +{ + state.Initialize(); + plyOptions.Initialize(); +} +YSRESULT YsShellExtPlyReader::ReadOneLine(YsShellExt &shl,YsString &str) +{ + if(true==state.inHeader) + { + auto argv=str.Argv(); + if(0 vtId; + YsArray texCoord; + for(auto opt : plyOptions.faceProp.propList) + { + if(argv.size()<=i) + { + printf("VERY BAD PLY. WAY TOO FEW ARGUMENTS.\n"); + return YSERR; + } + switch(opt) + { + case PROP_LIST_VTX_IDX: + { + size_t len=argv[i].Atoi(); + ++i; + for(size_t j=0; j plVtHd; + + for(auto id : vtId) + { + if(state.vtHdList.size() propList; + void Initialize(void) + { + propList.clear(); + } + }; + class VertexProperties : public ElementProperties + { + }; + class FaceProperties : public ElementProperties + { + }; + + class ReadOption + { + }; + class ReadState + { + public: + bool inHeader=true; + bool definingVertex=false; + bool definingPolygon=false; + unsigned int nVtxLeft=0; + unsigned int nFaceLeft=0; + YsString textureFileName; + YsArray vtHdList; + + void Initialize(void) + { + inHeader=true; + definingVertex=false; + definingPolygon=false; + nVtxLeft=0; + nFaceLeft=0; + } + }; + class PlyOptions + { + public: + VertexProperties vtxProp; + FaceProperties faceProp; + void Initialize(void) + { + vtxProp.Initialize(); + faceProp.Initialize(); + } + }; + + ReadState state; + PlyOptions plyOptions; + + /*! Begins reading .OBJ file. + It doesn't delete existinv vertices and polygons. It essentially dumps incoming vertices and polygons to the shell. + */ + void BeginRead(const ReadOption &option); + + /*! Read one line of .OBJ file. */ + YSRESULT ReadOneLine(YsShellExt &shl,YsString &str); + + /*! End reading .OBJ file. */ + void EndRead(YsShellExt &shl); + + /*! This function reads a .OBJ file from a text-input stream. Internally this uses BeginReadObj, EndReadObj, and ReadObnOneLine. + It doesn't delete existinv vertices and polygons. It essentially dumps incoming vertices and polygons to the shell. + */ + YSRESULT ReadPly(YsShellExt &shl,YsTextInputStream &inStream,const ReadOption &option); +}; + + /*! Convenience function for reading a file into shl. The file type will be identified by the file extension. */ From 6ed66561fc402c90538741f9a6cc2be41c7ab966 Mon Sep 17 00:00:00 2001 From: Soji Yamakawa Date: Sun, 8 Dec 2024 21:02:23 -0500 Subject: [PATCH 6/8] PLY Loader. --- src/ysgebl/src/kernel/ysshellext.cpp | 21 +++++++++++++++++++++ src/ysgebl/src/kernel/ysshellext.h | 6 ++++++ src/ysgebl/src/kernel/ysshellextio.cpp | 26 ++++++++++++++++++++++++++ src/ysgebl/src/kernel/ysshellextio.h | 3 +++ 4 files changed, 56 insertions(+) diff --git a/src/ysgebl/src/kernel/ysshellext.cpp b/src/ysgebl/src/kernel/ysshellext.cpp index ff5e21c..88e6262 100644 --- a/src/ysgebl/src/kernel/ysshellext.cpp +++ b/src/ysgebl/src/kernel/ysshellext.cpp @@ -796,6 +796,27 @@ YSRESULT YsShellExt::SetVertexPosition(VertexHandle vtHd,const YsVec3 &pos) return ModifyVertexPosition(vtHd,pos); } +YSRESULT YsShellExt::SetVertexNormal(VertexHandle vtHd,const YsVec3 &nom) +{ + auto *vtx=YsShell::GetVertex(vtHd); + if(nullptr!=vtx) + { + vtx->SetNormal(nom); + return YSOK; + } + return YSERR; +} + +YsVec3 YsShellExt::GetVertexNormal(VertexHandle vtHd) const +{ + auto *vtx=YsShell::GetVertex(vtHd); + if(nullptr!=vtx) + { + return vtx->GetNormal(); + } + return YsVec3::Origin(); +} + YSRESULT YsShellExt::SetVertexRoundFlag(YsShellVertexHandle vtHd,YSBOOL round) { VertexAttrib *vtAttrib=GetVertexAttrib(vtHd); diff --git a/src/ysgebl/src/kernel/ysshellext.h b/src/ysgebl/src/kernel/ysshellext.h index 068b6f7..18fab89 100644 --- a/src/ysgebl/src/kernel/ysshellext.h +++ b/src/ysgebl/src/kernel/ysshellext.h @@ -1243,6 +1243,12 @@ class YsShellExt : protected YsShell /*! This function moves vertex. */ YSRESULT SetVertexPosition(VertexHandle VtHd,const YsVec3 &NewPos); + /*! Vertex normal is not undo/redo target. */ + YSRESULT SetVertexNormal(VertexHandle vtHd,const YsVec3 &nom); + + /*! Vertex normal is not undo/redo target. */ + YsVec3 GetVertexNormal(VertexHandle vtHd) const; + /*! This function sets ROUND flag of the vertex. */ YSRESULT SetVertexRoundFlag(YsShellVertexHandle vtHd,YSBOOL round); diff --git a/src/ysgebl/src/kernel/ysshellextio.cpp b/src/ysgebl/src/kernel/ysshellextio.cpp index acfc18a..dcc4cb4 100644 --- a/src/ysgebl/src/kernel/ysshellextio.cpp +++ b/src/ysgebl/src/kernel/ysshellextio.cpp @@ -2162,6 +2162,11 @@ YSRESULT YsShellExtPlyReader::ReadOneLine(YsShellExt &shl,YsString &str) { auto vtHd=shl.AddVertex(vtx); state.vtHdList.push_back(vtHd); + if(true==nomSet) + { + state.vertexHasNormal=true; + shl.SetVertexNormal(vtHd,nom); + } --state.nVtxLeft; } else @@ -2261,6 +2266,18 @@ YSRESULT YsShellExtPlyReader::ReadOneLine(YsShellExt &shl,YsString &str) } plHd=shl.AddPolygon(plVtHd); + + if(true==texCoordSet && plVtHd.size()*2<=texCoord.size()) + { + YsArray plTxHd; + for(size_t i=0; i+1 vtHdList; + bool vertexHasNormal=false; + void Initialize(void) { inHeader=true; @@ -356,6 +358,7 @@ class YsShellExtPlyReader definingPolygon=false; nVtxLeft=0; nFaceLeft=0; + vertexHasNormal=false; } }; class PlyOptions From 4b15e486d98fbed4ddc53f47b178d57983f9166c Mon Sep 17 00:00:00 2001 From: Soji Yamakawa Date: Sun, 8 Dec 2024 21:33:16 -0500 Subject: [PATCH 7/8] PLY writer. --- src/ysgebl/src/gui/filemenu/filemenu.cpp | 1 + src/ysgebl/src/gui/fsgui3dapp.cpp | 27 ++++++ src/ysgebl/src/kernel/ysshellextio.cpp | 100 +++++++++++++++++++++++ src/ysgebl/src/kernel/ysshellextio.h | 11 +++ 4 files changed, 139 insertions(+) diff --git a/src/ysgebl/src/gui/filemenu/filemenu.cpp b/src/ysgebl/src/gui/filemenu/filemenu.cpp index a4a9825..4093c6b 100644 --- a/src/ysgebl/src/gui/filemenu/filemenu.cpp +++ b/src/ysgebl/src/gui/filemenu/filemenu.cpp @@ -234,6 +234,7 @@ void GeblGuiEditorBase::File_SaveAs(FsGuiPopUpMenuItem *) fdlg->fileExtensionArray.Append(L".dnm"); fdlg->fileExtensionArray.Append(L".stl"); fdlg->fileExtensionArray.Append(L".obj"); + fdlg->fileExtensionArray.Append(L".ply"); fdlg->fileExtensionArray.Append(L".off"); fdlg->fileExtensionArray.Append(L".t3d"); fdlg->defaultFileName=def; diff --git a/src/ysgebl/src/gui/fsgui3dapp.cpp b/src/ysgebl/src/gui/fsgui3dapp.cpp index f7c726d..9bcfb1b 100644 --- a/src/ysgebl/src/gui/fsgui3dapp.cpp +++ b/src/ysgebl/src/gui/fsgui3dapp.cpp @@ -1003,6 +1003,33 @@ void GeblGuiEditorBase::SaveGeneral(const YsShellExtEdit &shl,const wchar_t fn[] MessageDialog(FSGUI_COMMON_ERROR,L"Cannot open the file in write-mode."); } } + else if(0==ext.STRCMP(".PLY")) + { + FILE *fp=YsFileIO::Fopen(fn,"w"); + if(NULL!=fp) + { + YsTextFileOutputStream outStream(fp); + + YsShellExtPlyWriter writer; + YsShellExtPlyWriter::WriteOption option; + writer.WritePly(outStream,(const YsShellExt &)shl,option); + fclose(fp); + + shl.SetFileName(fn); + shl.Saved(); + lastAccessedFileName.Set(fn); + if(YSTRUE==recordRecentFiles) + { + AddRecentlyUsedFile(fn); + } + + MessageDialog(FSGUI_DLG_SAVED_TITLE,savedMsg); + } + else + { + MessageDialog(FSGUI_COMMON_ERROR,L"Cannot open the file in write-mode."); + } + } else if(0==ext.STRCMP(".STL")) { /* for(auto plHd : shl.AllPolygon()) diff --git a/src/ysgebl/src/kernel/ysshellextio.cpp b/src/ysgebl/src/kernel/ysshellextio.cpp index dcc4cb4..e9f0b28 100644 --- a/src/ysgebl/src/kernel/ysshellextio.cpp +++ b/src/ysgebl/src/kernel/ysshellextio.cpp @@ -1578,6 +1578,91 @@ YSRESULT YsShellExtObjWriter::WriteObj(YsTextOutputStream &outStream,const YsShe return YSOK; } +//////////////////////////////////////////////////////////// + +YSRESULT YsShellExtPlyWriter::WritePly(YsTextOutputStream &outStream,const YsShellExt &shl,const WriteOption &option) +{ + shl.Encache(); + + outStream.Printf("ply\n"); + outStream.Printf("format ascii 1.0\n"); + outStream.Printf("comment PolygonCrest generated\n"); + + auto texFile=shl.FindMetaData(YsString("TextureFile")); + if(nullptr!=texFile && 0size()) + { + for(auto mdHd : *texFile) + { + auto str=shl.GetMetaDataValue(mdHd); + outStream.Printf("comment TextureFile %s\n",str.data()); + } + } + + bool vtxHasNormal=(nullptr!=shl.FindMetaData(YsString("VertexHasNormal"))); + outStream.Printf("element vertex %d\n",shl.GetNumVertex()); + outStream.Printf("property float x\n"); + outStream.Printf("property float y\n"); + outStream.Printf("property float z\n"); + if(true==vtxHasNormal) + { + outStream.Printf("property float nx\n"); + outStream.Printf("property float ny\n"); + outStream.Printf("property float nz\n"); + } + + bool plgHasTexCoord=(shl.FindNextTexCoord(nullptr)!=nullptr); + outStream.Printf("element face %d\n",shl.GetNumPolygon()); + outStream.Printf("property list uchar int vertex_indices\n"); + if(true==plgHasTexCoord) + { + outStream.Printf("property list uchar float texcoord\n"); + } + outStream.Printf("property uchar red\n"); + outStream.Printf("property uchar green\n"); + outStream.Printf("property uchar blue\n"); + outStream.Printf("property uchar alpha\n"); + + outStream.Printf("end_header\n"); + + for(auto vtHd : shl.AllVertex()) + { + YsVec3 vtx,nom; + vtx=shl.GetVertexPosition(vtHd); + nom=shl.GetVertexNormal(vtHd); + outStream.Printf("%lf %lf %lf",vtx.x(),vtx.y(),vtx.z()); + if(true==vtxHasNormal) + { + outStream.Printf(" %lf %lf %lf",nom.x(),nom.y(),nom.z()); + } + outStream.Printf("\n"); + } + for(auto plHd : shl.AllPolygon()) + { + auto plVtHd=shl.GetPolygonVertex(plHd); + auto plTcHd=shl.GetPolygonTexCoord(plHd); + auto col=shl.GetColor(plHd); + outStream.Printf("%d",plVtHd.size()); + for(auto vtHd : plVtHd) + { + outStream.Printf(" %d",shl.GetVertexIdFromHandle(vtHd)); + } + if(true==plgHasTexCoord) + { + outStream.Printf(" %d",plTcHd.size()*2); + for(auto tcHd : plTcHd) + { + auto tcPos=shl.GetTexCoordUV(tcHd); + outStream.Printf(" %lf %lf",tcPos.x(),tcPos.y()); + } + } + outStream.Printf(" %d %d %d %d\n",col.Ri(),col.Gi(),col.Bi(),col.Ai()); + } + + return YSOK; +} + +//////////////////////////////////////////////////////////// + YSRESULT YsShellExtFMTOWNSWriter::WriteFMTOWNST3D(FILE *ofp,const YsShellExt &shl,const WriteOption &opt) { if(nullptr!=ofp) @@ -2493,6 +2578,21 @@ YSRESULT YsShellExt_SaveGeneral(const char fnIn[],const YsShellExt &shl) return res; } } + else if(0==ext.STRCMP(".PLY")) + { + FILE *fp=fopen(fn,"w"); + if(nullptr!=fp) + { + YsShellExtPlyWriter::WriteOption defaultOption; + + YsShellExtPlyWriter writer; + YsTextFileOutputStream outStream(fp); + auto res=writer.WritePly(outStream,shl,defaultOption); + + fclose(fp); + return res; + } + } else if(0==ext.STRCMP(".T3D")) { FILE *fp=fopen(fn,"w"); diff --git a/src/ysgebl/src/kernel/ysshellextio.h b/src/ysgebl/src/kernel/ysshellextio.h index 21dcacf..435da1e 100644 --- a/src/ysgebl/src/kernel/ysshellextio.h +++ b/src/ysgebl/src/kernel/ysshellextio.h @@ -215,6 +215,17 @@ class YsShellExtObjWriter YSRESULT WriteObj(YsTextOutputStream &outStream,const YsShellExt &shl,const WriteOption &option); }; +class YsShellExtPlyWriter +{ +public: + class WriteOption + { + }; + +public: + YSRESULT WritePly(YsTextOutputStream &outStream,const YsShellExt &shl,const WriteOption &option); +}; + class YsShellExtFMTOWNSWriter { public: From b5ffdc85be0880aeebd3e355246d829e3b2980f4 Mon Sep 17 00:00:00 2001 From: Soji Yamakawa Date: Sun, 8 Dec 2024 22:16:50 -0500 Subject: [PATCH 8/8] github workflow macos-12 -> macos-latest --- .github/workflows/continuous.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/continuous.yml b/.github/workflows/continuous.yml index 9842b03..91dc5e5 100644 --- a/.github/workflows/continuous.yml +++ b/.github/workflows/continuous.yml @@ -48,7 +48,7 @@ jobs: build-macos: - runs-on: macos-12 + runs-on: macos-latest steps: - uses: actions/checkout@v2