[prev in list] [next in list] [prev in thread] [next in thread] 

List:       graphicsmagick-commit
Subject:    [GM-commit] GraphicsMagick: VisualMagick/CMakeLists.txt Add posibility to us...
From:       GraphicsMagick Commits <graphicsmagick-commit () lists ! sourceforge ! net>
Date:       2023-04-16 12:22:44
Message-ID: mailman.7116.1681647774.6776.graphicsmagick-commit () lists ! sourceforge ! net
[Download RAW message or body]

changeset 39183dc52a35 in /hg/GraphicsMagick
details: http://hg.GraphicsMagick.org/hg/GraphicsMagick?cmd=changeset;node=39183dc52a35
                
summary: VisualMagick/CMakeLists.txt Add posibility to use CMake for configure.exe \
(not for whole project).

diffstat:

 ChangeLog                               |    9 +
 VisualMagick/CMakeLists.txt             |   49 +++
 VisualMagick/README.txt                 |   12 +
 VisualMagick/configure/CStringEx.cpp    |  403 --------------------------------
 VisualMagick/configure/CStringEx.h      |   50 ---
 VisualMagick/configure/configure.cpp    |    3 +-
 VisualMagick/configure/configure.exe    |  Bin 
 VisualMagick/configure/configure.vcproj |    2 +-
 8 files changed, 72 insertions(+), 456 deletions(-)

diffs (truncated from 581 to 500 lines):

diff -r 6233512cbb36 -r 39183dc52a35 ChangeLog
--- a/ChangeLog	Sat Apr 15 18:43:01 2023 -0500
+++ b/ChangeLog	Sun Apr 16 14:22:16 2023 +0200
@@ -1,3 +1,12 @@
+2023-04-16 Fojtik Jaroslav  <JaFojtik@yandex.com>
+
+        *VisualMagick/CMakeLists.txt Add posibility to use CMake for
+        configure.exe
+        *VisualMagick/README.txt Update description for building
+        configure.exe
+        -VisualMagick/configure/CStringEx.cpp
+        -VisualMagick/configure/CStringEx.h removed useless code.
+
 2023-04-15  Bob Friesenhahn  <bfriesen@simple.dallas.tx.us>
 
 	* magick/attribute.c (SetImageAttribute): Eliminate memory leak
diff -r 6233512cbb36 -r 39183dc52a35 VisualMagick/CMakeLists.txt
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/VisualMagick/CMakeLists.txt	Sun Apr 16 14:22:16 2023 +0200
@@ -0,0 +1,49 @@
+cmake_minimum_required(VERSION 3.10)
+
+# SET THE PROJECT NAME
+project(configure)
+
+# SET CPP STANDARD
+set(CMAKE_CXX_STANDARD_REQUIRED True)
+if(MSVC)
+  add_compile_options(/W4)
+endif()
+
+add_compile_definitions(_AFXDLL WINVER=0x500 _CRT_SECURE_NO_WARNINGS)
+
+
+if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+  set(CMAKE_INSTALL_PREFIX ${PROJECT_SOURCE_DIR}/ CACHE PATH "Install path that is \
not program files" FORCE) +endif(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+
+
+#list(APPEND EXTRA_INCLUDES "${PROJECT_SOURCE_DIR}/Sdl/include")
+
+
+# CREATE TARGET EXECUTABLE + INCLUDE DIRECTORIES + LINKING
+add_executable(${PROJECT_NAME} ${PROJECT_SOURCE_DIR}/configure/configure.cpp \
${PROJECT_SOURCE_DIR}/configure/configure_wizard.cpp +               \
${PROJECT_SOURCE_DIR}/configure/finished_page.cpp \
${PROJECT_SOURCE_DIR}/configure/stdafx.cpp \
${PROJECT_SOURCE_DIR}/configure/system_page.cpp +               \
${PROJECT_SOURCE_DIR}/configure/target_page.cpp \
${PROJECT_SOURCE_DIR}/configure/WaitDlg.cpp \
${PROJECT_SOURCE_DIR}/configure/welcome_page.cpp) +
+target_sources(${PROJECT_NAME} PRIVATE ${PROJECT_SOURCE_DIR}/configure/configure.rc)
+#${PROJECT_SOURCE_DIR}/configure/configure.rc2
+
+target_include_directories(${PROJECT_NAME} PUBLIC ${EXTRA_INCLUDES} \
"${PROJECT_SOURCE_DIR}/configure") +
+target_link_libraries(${PROJECT_NAME} rpcrt4.lib)
+set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:WINDOWS")
+
+
+set_target_properties(${PROJECT_NAME} PROPERTIES DEBUG_POSTFIX _d)
+install(TARGETS ${PROJECT_NAME} CONFIGURATIONS Debug RUNTIME DESTINATION Debug)
+install(TARGETS ${PROJECT_NAME} CONFIGURATIONS Release RUNTIME DESTINATION Release)
+install(TARGETS ${PROJECT_NAME} CONFIGURATIONS MinSizeRel RUNTIME DESTINATION \
MinSizeRel) +install(TARGETS ${PROJECT_NAME} CONFIGURATIONS RelWithDebInfo RUNTIME \
DESTINATION RelWithDebInfo) +
+# POST BUILD COMMAND TO COPY EXE TO .. DIR
+set(CONFIGURE_API_BIN "${CMAKE_BINARY_DIR}")
+ADD_CUSTOM_COMMAND(TARGET ${PROJECT_NAME} POST_BUILD
+    COMMAND ${CMAKE_COMMAND} -E copy_if_different "$<TARGET_FILE:${PROJECT_NAME}>" \
${CONFIGURE_API_BIN} +    COMMENT "Copying configure.exe to ${CONFIGURE_API_BIN}." \
VERBATIM +)
+
diff -r 6233512cbb36 -r 39183dc52a35 VisualMagick/README.txt
--- a/VisualMagick/README.txt	Sat Apr 15 18:43:01 2023 -0500
+++ b/VisualMagick/README.txt	Sun Apr 16 14:22:16 2023 +0200
@@ -1,3 +1,15 @@
+Update 2023:
+
+It is preferred to use CMake build system for configure.exe:
+1, Run Cmake-GUI
+2, Point sources to ..../GraphicsMagick/VisualMagick
+3, Point build directory to ..../GraphicsMagick/VisualMagick/build
+4, Click on "Configure" button
+5, Click on "Generate" button
+6, Open your project in Visual studio from:
+   ..../GraphicsMagick/VisualMagick/build/configure.sln
+
+-----------------------------------------------
 Before you can build the GraphicsMagick system, you must first build
 and run the configure utility. You will find it in the "configure"
 subdirectory inside this directory. Open its workspace "configure.dsw"
diff -r 6233512cbb36 -r 39183dc52a35 VisualMagick/configure/CStringEx.cpp
--- a/VisualMagick/configure/CStringEx.cpp	Sat Apr 15 18:43:01 2023 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,403 +0,0 @@
-//////////////////////////////////////////////////////////////////////
-// StringEx.cpp
-//
-//////////////////////////////////////////////////////////////////////
-
-#include "stdafx.h"
-#include "CStringEx.h"
-
-
-// Insert	- Inserts a sub string into the string
-// Returns	- Reference to the same string object
-// pos		- Position to insert at. Extends the string with spaces if needed
-// s		- Sub string to insert
-CStringEx& CStringEx::Insert(int pos, LPCTSTR s)
-{
-	int len = lstrlen(s);
-	if ( len == 0 )
-		return *this;
-
-	int oldlen = GetLength();
-	int newlen = oldlen + len;
-	LPTSTR str;
-	if ( pos >= oldlen ) 
-	{			
-		// insert after end of string
-		newlen += pos - oldlen ;
-		str = GetBuffer( newlen );
-		_tcsnset( str+oldlen, _T(' '), pos-oldlen );
-		_tcsncpy( str+pos, s, len );
-	} 
-	else 
-	{	
-		// normal insert
-		str = GetBuffer( newlen );
-		memmove( str+pos+len, str+pos, sizeof(_T(' ')) *(oldlen-pos) );
-		_tcsncpy( str+pos, s, len );
-	}
-	ReleaseBuffer( newlen );
-
-	return *this;
-}
-
-
-// Insert	- Inserts a character into the string
-// Returns	- Reference to the same string object
-// pos		- Position to insert at. Extends the string with spaces if needed
-// c		- Char to insert
-CStringEx& CStringEx::Insert(int pos, TCHAR c)
-{
-	TCHAR buf[2];
-	buf[0] = c;
-	buf[1] = _T('\0');
-	return Insert( pos, buf );
-}
-
-
-// Delete	- Deletes a segment of the string and resizes it
-// Returns	- Reference to the same string object
-// pos		- Position of the string segment to remove
-// len		- Number of characters to remove
-CStringEx& CStringEx::Delete(int pos, int len)
-{
-	int strLen = GetLength();
-
-	if( pos >= strLen)
-		return *this;
-	if(len < 0 ||len > strLen - pos)
-		len = strLen - pos;
-
-	LPTSTR str = GetBuffer( strLen );
-	memmove(str+pos, str+pos+len, sizeof(_T(' ')) *(strLen-pos));
-	ReleaseBuffer( strLen - len );
-
-	return *this;
-}
-
-
-// Replace	- Replaces a substring with another
-// Returns	- Reference to the same string object
-// pos		- Position of the substring
-// len		- Length of substring to be replaced
-// s		- New substring
-CStringEx& CStringEx::Replace(int pos, int len, LPCTSTR s)
-{
-	Delete(pos, len);
-	Insert(pos, s);
-
-	return *this;
-}
-
-
-// Find 	- Finds the position of a character in a string
-// Returns	- A zero-based index
-// ch		- Character to look for
-// startpos	- Position to start looking from
-int CStringEx::Find( TCHAR ch, int startpos /*= 0*/ ) const
-{
-	// find first single character
-	LPTSTR lpsz = _tcschr(m_pchData + startpos, (_TUCHAR)ch);
-
-	// return -1 if not found and index otherwise
-	return (lpsz == NULL) ? -1 : (int)(lpsz - m_pchData);
-}
-
-
-// Find 	- Finds the position of a substring in a string
-// Returns	- A zero-based index
-// lpszSub	- Substring to look for
-// startpos	- Position to start looking from
-int CStringEx::Find( LPCTSTR lpszSub, int startpos /*= 0*/ ) const
-{
-	ASSERT(AfxIsValidString(lpszSub, FALSE));
-
-	// find first matching substring
-	LPTSTR lpsz = _tcsstr(m_pchData+startpos, lpszSub);
-
-	// return -1 for not found, distance from beginning otherwise
-	return (lpsz == NULL) ? -1 : (int)(lpsz - m_pchData);
-}
-
-
-// FindNoCase	- Case insensitive find
-// Returns	    - A zero-based index
-// ch		    - Char to search for
-// startpos 	- Position to start looking from
-int CStringEx::FindNoCase( TCHAR ch, int startpos /*= 0*/ ) const
-{
-	unsigned int locase = Find( tolower( ch ), startpos );
-	unsigned int upcase = Find( toupper( ch ), startpos );
-
-	return locase < upcase ? locase : upcase;
-}
-
-
-// FindNoCase	- Case insensitive find
-// Returns		- A zero-based index
-// lpszSub		- Substring to search for
-// startpos 	- Position to start looking from
-int CStringEx::FindNoCase( LPCTSTR lpszSub, int startpos /*= 0*/ ) const
-{
-	CStringEx sLowerThis = *this;
-	sLowerThis.MakeLower();
-
-	CStringEx sLowerSub = lpszSub;
-	sLowerSub.MakeLower();
-
-	return sLowerThis.Find( sLowerSub, startpos );
-}
-
-
-// FindReplace		- Find a substring and replace with another
-// Returns			- Number of instances replaced
-// lpszSub			- Substring to look for
-// lpszReplaceWith	- Substring to replace with
-// bGlobal			- Flag to indicate whether all occurances 
-//					  should be replaced
-int CStringEx::FindReplace( LPCTSTR lpszSub, LPCTSTR lpszReplaceWith, 
-					BOOL bGlobal /*= TRUE*/ )
-{
-	int iReplaced = 0;
-
-	// find first matching substring
-	LPTSTR lpsz;
-	
-	int pos = 0;
-	int lenSub = lstrlen( lpszSub );
-	int lenReplaceWith = lstrlen( lpszReplaceWith );
-	while( (lpsz = _tcsstr(m_pchData + pos, lpszSub)) != NULL )
-	{
-		pos = (int)(lpsz - m_pchData);
-		Replace( pos, lenSub, lpszReplaceWith );
-		pos += lenReplaceWith;
-		iReplaced++;
-		if( !bGlobal ) break;
-	}
-
-	return iReplaced;
-}
-
-
-// FindReplaceNoCase	- Find a substring and replace with another
-//						  Does case insensitive search
-// Returns				- Number of instances replaced
-// lpszSub				- Substring to look for
-// lpszReplaceWith		- Substring to replace with
-// bGlobal				- Flag to indicate whether all occurances 
-//						  should be replaced
-int CStringEx::FindReplaceNoCase( LPCTSTR lpszSub, LPCTSTR lpszReplaceWith, 
-					 BOOL bGlobal /*= TRUE*/ )
-{
-	CStringEx sLowerThis = *this;
-	sLowerThis.MakeLower();
-
-	CStringEx sLowerSub = lpszSub;
-	sLowerSub.MakeLower();
-
-	int iReplaced = 0;
-
-	// find first matching substring
-	LPTSTR lpsz;
-	
-	int pos = 0, offset = 0;
-	int lenSub = lstrlen( lpszSub );
-	int lenReplaceWith = lstrlen( lpszReplaceWith );
-	while( (lpsz = _tcsstr(sLowerThis.m_pchData + pos, sLowerSub.m_pchData)) != NULL )
-	{
-		pos = (int)(lpsz - sLowerThis.m_pchData);
-		Replace( pos+offset, lenSub, lpszReplaceWith );
-		offset += lenReplaceWith - lenSub;
-		pos += lenSub;
-		iReplaced++;
-		if( !bGlobal ) break;
-	}
-
-	return iReplaced;
-}
-
-
-// ReverseFind	- Searches for the last match of a substring
-// Returns		- A zero-based index
-// lpszSub		- Substring to search for
-// startpos 	- Position to start looking from, in reverse dir
-int CStringEx::ReverseFind( LPCTSTR lpszSub, int startpos /*= -1*/ ) const
-{
-	int lenSub = lstrlen( lpszSub );
-	int len = lstrlen( m_pchData );
-
-	if(0 < lenSub && 0 < len)
-	{
-		if( startpos == -1 || startpos >= len ) startpos = len - 1;
-		for ( LPTSTR lpszReverse = m_pchData + startpos ; 
-						lpszReverse != m_pchData ; --lpszReverse)
-			if (_tcsncmp(lpszSub, lpszReverse, lenSub ) == 0)
-				return (lpszReverse - m_pchData);
-	}
-	return -1;
-}
-
-
-// ReverseFindNoCase	- Searches for the last match of a substring
-//						  Search is case insensitive
-// Returns				- A zero-based index
-// lpszSub				- Character to search for
-// startpos 			- Position to start looking from, in reverse dir
-int CStringEx::ReverseFindNoCase(TCHAR ch, int startpos /*= -1*/ ) const
-{
-	TCHAR a[2];
-	a[1] = ch;
-	a[2] = 0;
-	return ReverseFindNoCase( a, startpos );
-}
-
-
-// ReverseFindNoCase	- Searches for the last match of a substring
-//						  Search is case insensitive
-// Returns				- A zero-based index
-// lpszSub				- Substring to search for
-// startpos 			- Position to start looking from, in reverse dir
-int CStringEx::ReverseFindNoCase( LPCTSTR lpszSub, int startpos /*= -1*/ ) const
-{
-	//LPTSTR lpszEnd = m_pchData + lstrlen
-
-	int lenSub = lstrlen( lpszSub );
-	int len = lstrlen( m_pchData );
-	
-
-	if(0 < lenSub && 0 < len)
-	{
-		if( startpos == -1 || startpos >= len ) startpos = len - 1;
-		for ( LPTSTR lpszReverse = m_pchData + startpos ; 
-				lpszReverse >= m_pchData ; --lpszReverse)
-			if (_tcsnicmp(lpszSub, lpszReverse, lenSub ) == 0)
-				return (lpszReverse - m_pchData);
-	}
-	return -1;
-}
-
-
-// GetField 	- Gets a delimited field
-// Returns		- A CStringEx object that contains a copy of 
-//				  the specified field
-// delim		- The delimiter string
-// fieldnum 	- The field index - zero is the first
-// NOTE 		- Returns the whole string for field zero
-//				  if delim not found
-//				  Returns empty string if # of delim found
-//				  is less than fieldnum
-CStringEx CStringEx::GetField( LPCTSTR delim, int fieldnum)
-{
-	LPTSTR lpsz, lpszRemainder = m_pchData, lpszret;
-	int retlen, lenDelim = lstrlen( delim );
-
-	while( fieldnum-- >= 0 )
-	{
-		lpszret = lpszRemainder;
-		lpsz = _tcsstr(lpszRemainder, delim);
-		if( lpsz )
-		{
-			// We did find the delim
-			retlen = lpsz - lpszRemainder;
-			lpszRemainder = lpsz + lenDelim;
-		}
-		else
-		{
-			retlen = lstrlen( lpszRemainder );
-			lpszRemainder += retlen;	// change to empty string
-		}
-	}
-	return Mid( lpszret - m_pchData, retlen );
-}
-
-// GetField 	- Gets a delimited field
-// Returns		- A CStringEx object that contains a copy of 
-//				  the specified field
-// delim		- The delimiter char
-// fieldnum 	- The field index - zero is the first
-// NOTE 		- Returns the whole string for field zero
-//				  if delim not found
-//				  Returns empty string if # of delim found
-//				  is less than fieldnum
-CStringEx CStringEx::GetField( TCHAR delim, int fieldnum)
-{
-	LPTSTR lpsz, lpszRemainder = m_pchData, lpszret;
-	int retlen;
-
-	while( fieldnum-- >= 0 )
-	{
-		lpszret = lpszRemainder;
-		lpsz = _tcschr(lpszRemainder, (_TUCHAR)delim);
-		if( lpsz )
-		{
-			// We did find the delim
-			retlen = lpsz - lpszRemainder;
-			lpszRemainder = lpsz + 1;
-		}
-		else
-		{
-			retlen = lstrlen( lpszRemainder );
-			lpszRemainder += retlen;	// change to empty string
-		}
-	}
-	return Mid( lpszret - m_pchData, retlen );
-}
-
-
-// GetFieldCount	- Get number of fields in a string
-// Returns			- The number of fields
-//					  Is always greater than zero
-// delim			- The delimiter character
-int CStringEx::GetFieldCount( TCHAR delim )
-{
-	TCHAR a[2];
-	a[0] = delim;
-	a[1] = 0;
-	return GetFieldCount( a );
-}
-
-
-// GetFieldCount	- Get number of fields in a string
-// Returns			- The number of fields
-//					  Is always greater than zero
-// delim			- The delimiter string
-int CStringEx::GetFieldCount( LPCTSTR delim )
-{
-	LPTSTR lpsz, lpszRemainder = m_pchData;
-	int lenDelim = lstrlen( delim );
-
-	int iCount = 1;
-	while( (lpsz = _tcsstr(lpszRemainder, delim)) != NULL )
-	{
-		lpszRemainder = lpsz + lenDelim;
-		iCount++;
-	}
-
-	return iCount;
-}
-
-
-// GetDelimitedField	- Finds a field delimited on both ends
-// Returns				- A CStringEx object that contains a copy of 
-//						  the specified field
-// delimStart			- Delimiter at the start of the field
-// delimEnd 			- Delimiter at the end of the field
-CStringEx CStringEx::GetDelimitedField( LPCTSTR delimStart, LPCTSTR delimEnd, int \
                fieldnum /*= 0*/)
-{
-	LPTSTR lpsz, lpszEnd, lpszRet, lpszRemainder = m_pchData ;
-	int lenDelimStart = lstrlen( delimStart ), lenDelimEnd = lstrlen( delimEnd );
-
-	while( fieldnum-- >= 0 )
-	{
-		lpsz = _tcsstr(lpszRemainder, delimStart);
-		if( lpsz )
-		{
-			// We did find the Start delim
-			lpszRet = lpszRemainder = lpsz + lenDelimStart;
-			lpszEnd = _tcsstr(lpszRemainder, delimEnd);
-			if( lpszEnd == NULL ) return"";
-			lpszRemainder = lpsz + lenDelimEnd;
-		}
-		else return "";
-	}
-	return Mid( lpszRet - m_pchData, lpszEnd - lpszRet );
-}
diff -r 6233512cbb36 -r 39183dc52a35 VisualMagick/configure/CStringEx.h
--- a/VisualMagick/configure/CStringEx.h	Sat Apr 15 18:43:01 2023 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-//////////////////////////////////////////////////////////////////////


_______________________________________________
Graphicsmagick-commit mailing list
Graphicsmagick-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/graphicsmagick-commit


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic