summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2009-09-03 21:01:07 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2009-09-03 21:01:07 (GMT)
commit1554265aa6db4cf4b77bb6d034b8127611530bca (patch)
tree42edfc6f5c0d9915750a3be10f103dae2681022d
parent766f6608bf27c1e9134ba9413e33450f7af99d8d (diff)
downloadCMake-1554265aa6db4cf4b77bb6d034b8127611530bca.zip
CMake-1554265aa6db4cf4b77bb6d034b8127611530bca.tar.gz
CMake-1554265aa6db4cf4b77bb6d034b8127611530bca.tar.bz2
Remove CMakeSetup. Long live cmake-gui, start building Qt now.
-rw-r--r--CMakeCPackOptions.cmake.in5
-rw-r--r--CMakeLists.txt54
-rw-r--r--Source/CMakeLists.txt6
-rw-r--r--Source/MFCDialog/.cvsignore1
-rw-r--r--Source/MFCDialog/CMakeCommandLineInfo.cpp142
-rw-r--r--Source/MFCDialog/CMakeCommandLineInfo.h70
-rw-r--r--Source/MFCDialog/CMakeGenDialog.cpp122
-rw-r--r--Source/MFCDialog/CMakeGenDialog.h70
-rw-r--r--Source/MFCDialog/CMakeLists.txt109
-rw-r--r--Source/MFCDialog/CMakeSetup.cpp158
-rw-r--r--Source/MFCDialog/CMakeSetup.h65
-rw-r--r--Source/MFCDialog/CMakeSetup.rc246
-rw-r--r--Source/MFCDialog/CMakeSetupDialog.cpp1550
-rw-r--r--Source/MFCDialog/CMakeSetupDialog.h152
-rw-r--r--Source/MFCDialog/CMakeSetupManifest.xml10
-rw-r--r--Source/MFCDialog/MakeHelp.cpp43
-rw-r--r--Source/MFCDialog/MakeHelp.h62
-rw-r--r--Source/MFCDialog/PathDialog.cpp377
-rw-r--r--Source/MFCDialog/PathDialog.h90
-rw-r--r--Source/MFCDialog/PropertyList.cpp847
-rw-r--r--Source/MFCDialog/PropertyList.h179
-rw-r--r--Source/MFCDialog/StdAfx.cpp8
-rw-r--r--Source/MFCDialog/StdAfx.h49
-rw-r--r--Source/MFCDialog/res/CMakeSetupDialog.icobin24542 -> 0 bytes
-rw-r--r--Source/MFCDialog/res/CMakeSetupDialog.rc213
-rw-r--r--Source/MFCDialog/resource.h48
-rw-r--r--Source/cmDocumentVariables.cxx8
-rw-r--r--Source/cmake.cxx2
28 files changed, 9 insertions, 4477 deletions
diff --git a/CMakeCPackOptions.cmake.in b/CMakeCPackOptions.cmake.in
index a3e2504..a12b10a 100644
--- a/CMakeCPackOptions.cmake.in
+++ b/CMakeCPackOptions.cmake.in
@@ -18,14 +18,9 @@ if(CPACK_GENERATOR MATCHES "NSIS")
"doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/ctest.html" "CTest Help"
"doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cmake-modules.html" "CMake Modules Help"
"doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cmake-commands.html" "CMake Commands Help"
- "doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/CMakeSetup.html" "CMakeSetup Help"
"doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cpack.html" "CPack Help"
"http://www.cmake.org" "CMake Web Site"
)
- # tell cpack the executables you want in the start menu as links
- SET(CPACK_PACKAGE_EXECUTABLES "CMakeSetup" "CMakeSetup(deprecated)" )
- # tell cpack to create a desktop link to CMakeSetup
- SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\CMakeSetup.exe")
SET(CPACK_NSIS_DISPLAY_NAME "CMake @CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@ a cross-platform, open-source build system")
SET(CPACK_NSIS_PACKAGE_NAME "CMake @CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@")
SET(CPACK_NSIS_HELP_LINK "http://www.cmake.org")
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9f76a8d..dc96548 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -76,54 +76,11 @@ ENDMACRO(CMAKE_HANDLE_SYSTEM_LIBRARIES)
-#-----------------------------------------------------------------------
-# a macro to check for MFC and setup to build the MFC Dialog
-# simply to improve readability of the main script
-#-----------------------------------------------------------------------
-MACRO(CMAKE_TEST_FOR_MFC)
- SET(CMAKE_BUILD_ON_VISUAL_STUDIO 0)
- IF(WIN32 AND NOT UNIX AND NOT BORLAND AND NOT MINGW )
- SET(CMAKE_BUILD_ON_VISUAL_STUDIO 1)
- ENDIF(WIN32 AND NOT UNIX AND NOT BORLAND AND NOT MINGW )
-
- IF(CMAKE_BUILD_ON_VISUAL_STUDIO)
- IF("CMake_HAVE_MFC" MATCHES "^CMake_HAVE_MFC$")
- SET(CHECK_INCLUDE_FILE_VAR "afxwin.h")
- CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CheckIncludeFile.cxx.in
- ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.cxx)
- MESSAGE(STATUS "Looking for MFC")
- TRY_COMPILE(CMake_HAVE_MFC
- ${CMAKE_BINARY_DIR}
- ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.cxx
- CMAKE_FLAGS
- -DCMAKE_MFC_FLAG:STRING=2
- -DCOMPILE_DEFINITIONS:STRING=-D_AFXDLL
- OUTPUT_VARIABLE OUTPUT)
- IF(CMake_HAVE_MFC)
- MESSAGE(STATUS "Looking for MFC - found")
- SET(CMake_HAVE_MFC 1 CACHE INTERNAL "Have MFC?")
- FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
- "Determining if MFC exists passed with the following output:\n"
- "${OUTPUT}\n\n")
- ELSE(CMake_HAVE_MFC)
- MESSAGE(STATUS "Looking for MFC - not found")
- SET(CMake_HAVE_MFC 0 CACHE INTERNAL "Have MFC?")
- FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
- "Determining if MFC exists failed with the following output:\n"
- "${OUTPUT}\n\n")
- ENDIF(CMake_HAVE_MFC)
- ENDIF("CMake_HAVE_MFC" MATCHES "^CMake_HAVE_MFC$")
-
- IF(CMake_HAVE_MFC)
- OPTION(BUILD_MFCDialog "Whether to build the CMakeSetup MFC dialog." ON)
- ELSE(CMake_HAVE_MFC)
- SET(BUILD_MFCDialog 0)
- ENDIF(CMake_HAVE_MFC)
- ELSE(CMAKE_BUILD_ON_VISUAL_STUDIO)
- SET(BUILD_MFCDialog 0)
- ENDIF(CMAKE_BUILD_ON_VISUAL_STUDIO)
-ENDMACRO(CMAKE_TEST_FOR_MFC)
+SET(CMAKE_BUILD_ON_VISUAL_STUDIO 0)
+IF(WIN32 AND NOT UNIX AND NOT BORLAND AND NOT MINGW )
+ SET(CMAKE_BUILD_ON_VISUAL_STUDIO 1)
+ENDIF(WIN32 AND NOT UNIX AND NOT BORLAND AND NOT MINGW )
#-----------------------------------------------------------------------
@@ -447,9 +404,6 @@ IF (UNIX)
ENDIF (UNIX)
-# should we build the MFC dialog? (a macro defined in this file)
-CMAKE_TEST_FOR_MFC()
-
# add the uninstall support
CONFIGURE_FILE(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index 99810d9..7bfb385 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -469,12 +469,6 @@ IF(BUILD_CursesDialog)
INCLUDE(${CMake_SOURCE_DIR}/Source/CursesDialog/CMakeLists.txt)
ENDIF(BUILD_CursesDialog)
-# MFC GUI
-# MFC libraries are only available on Visual Studio
-IF(BUILD_MFCDialog)
- SUBDIRS(MFCDialog)
-ENDIF(BUILD_MFCDialog)
-
# Qt GUI
OPTION(BUILD_QtDialog "Build Qt dialog for CMake" FALSE)
IF(BUILD_QtDialog)
diff --git a/Source/MFCDialog/.cvsignore b/Source/MFCDialog/.cvsignore
deleted file mode 100644
index 329d484..0000000
--- a/Source/MFCDialog/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-Debug
diff --git a/Source/MFCDialog/CMakeCommandLineInfo.cpp b/Source/MFCDialog/CMakeCommandLineInfo.cpp
deleted file mode 100644
index 15c5c81..0000000
--- a/Source/MFCDialog/CMakeCommandLineInfo.cpp
+++ /dev/null
@@ -1,142 +0,0 @@
-// CMakeCommandLineInfo.cpp : command line arguments
-//
-
-#include "stdafx.h"
-#include "CMakeCommandLineInfo.h"
-#include "cmSystemTools.h"
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-///////////////////////////////////////////////////////////////
-// CMakeCommandLineInfo
-
-CMakeCommandLineInfo::CMakeCommandLineInfo()
-{
- this->m_WhereSource = _T("");
- this->m_WhereBuild = _T("");
- this->m_AdvancedValues = FALSE;
- this->m_GeneratorChoiceString = _T("");
- this->m_LastUnknownParameter = _T("");
-
- // Find the path to the CMakeSetup executable.
- char fname[4096];
- ::GetModuleFileName(0, fname, 4096);
- m_Argv0 = fname;
- m_Argv.push_back(m_Argv0.c_str());
-}
-
-CMakeCommandLineInfo::~CMakeCommandLineInfo()
-{
-}
-
-int CMakeCommandLineInfo::GetBoolValue(const CString& v) {
- CString value = v;
- value.MakeLower();
- if (value == "1" ||
- value == "on" ||
- value == "true" ||
- value == "yes")
- {
- return 1;
- }
- else if (value == "0" ||
- value == "off" ||
- value == "false" ||
- value == "no")
- {
- return -1;
- }
- return 0;
-}
-
-///////////////////////////////////////////////////////////////
-// Parse param
-
-void CMakeCommandLineInfo::ParseParam(LPCTSTR lpszParam, BOOL bFlag, BOOL bLast)
-{
- // Construct the full name of the argument.
- cmStdString param = lpszParam;
- cmStdString value;
- if(bFlag)
- {
- // Since bFlag is set, either a - or a / was removed from the
- // parameter value. Assume it was a - unless the second character
- // was a / which indicates a network path argument.
- if(param.length() > 0 && param[0] == '/')
- {
- value = "/";
- }
- else
- {
- value = "-";
- }
- }
- value += param;
-
- // Add the argument and reset the argv table in case strings were
- // moved.
- m_Arguments.push_back(value);
- m_Argv.clear();
- m_Argv.push_back(m_Argv0.c_str());
- for(unsigned int i=0; i < m_Arguments.size(); ++i)
- {
- m_Argv.push_back(m_Arguments[i].c_str());
- }
-
- // Look for known flags.
- if(!bFlag)
- {
- this->m_LastUnknownParameter = lpszParam;
- }
- else
- {
- CString sParam(lpszParam);
- // Single letter valued flag like /B=value or /B:value
- CString value;
- if (sParam[1] == '=' || sParam[1] == ':')
- {
- value = sParam.Right(sParam.GetLength() - 2);
- }
- else
- {
- value = sParam.Right(sParam.GetLength()-1);
- }
- int res;
- switch (sParam[0])
- {
- case 'A':
- res = CMakeCommandLineInfo::GetBoolValue(value);
- if (res == 1)
- {
- this->m_AdvancedValues = TRUE;
- }
- else if (res == -1)
- {
- this->m_AdvancedValues = FALSE;
- }
- break;
- case 'B':
- {
- std::string path = cmSystemTools::CollapseFullPath((const char*)value);
- this->m_WhereBuild = path.c_str();
- break;
- }
- case 'G':
- this->m_GeneratorChoiceString = value;
- break;
- case 'H':
- {
- std::string path = cmSystemTools::CollapseFullPath((const char*)value);
- this->m_WhereSource = path.c_str();
- break;
- }
- }
- }
-
- // Call the base class to ensure proper command line processing
- CCommandLineInfo::ParseParam(lpszParam, bFlag, bLast);
-}
diff --git a/Source/MFCDialog/CMakeCommandLineInfo.h b/Source/MFCDialog/CMakeCommandLineInfo.h
deleted file mode 100644
index 4dee8eb..0000000
--- a/Source/MFCDialog/CMakeCommandLineInfo.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/*=========================================================================
-
- Program: CMake - Cross-Platform Makefile Generator
- Module: $RCSfile$
- Language: C++
- Date: $Date$
- Version: $Revision$
-
- Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
- See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
-
- This software is distributed WITHOUT ANY WARRANTY; without even
- the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- PURPOSE. See the above copyright notices for more information.
-
-=========================================================================*/
-// CMakeCommandLineInfo.h : main header file for the command line arguments
-//
-
-#if !defined(CMAKECOMMANDLINEINFO_H)
-#define CMAKECOMMANDLINEINFO_H
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-#ifndef __AFXWIN_H__
-#error include 'stdafx.h' before including this file for PCH
-#endif
-
-#include "../cmStandardIncludes.h"
-
-///////////////////////////////////////////////////////////////
-// CMakeCommandLineInfo:
-// See CMakeCommandLineInfo.cpp for the implementation of this class
-//
-
-class CMakeCommandLineInfo : public CCommandLineInfo
-{
- // Construction
-public:
- CMakeCommandLineInfo();
-
- // Attributes
-public:
- CString m_WhereSource;
- CString m_WhereBuild;
- BOOL m_AdvancedValues;
- CString m_GeneratorChoiceString;
- CString m_LastUnknownParameter;
-
- int GetArgC() { return static_cast<int>(m_Argv.size()); }
- const char*const* GetArgV() { return &*m_Argv.begin(); }
-
- std::string m_Argv0;
- std::vector<cmStdString> m_Arguments;
- std::vector<const char*> m_Argv;
-
- // Operations
-public:
- void ParseParam(const TCHAR* pszParam, BOOL bFlag, BOOL bLast);
-
- // Implementation
-public:
- virtual ~CMakeCommandLineInfo();
-protected:
- static int GetBoolValue(const CString&);
-};
-
-#endif // !defined(CMAKECOMMANDLINEINFO_H)
diff --git a/Source/MFCDialog/CMakeGenDialog.cpp b/Source/MFCDialog/CMakeGenDialog.cpp
deleted file mode 100644
index e1769b6..0000000
--- a/Source/MFCDialog/CMakeGenDialog.cpp
+++ /dev/null
@@ -1,122 +0,0 @@
-// CMakeGenDialog.cpp : implementation file
-//
-
-#include "stdafx.h"
-#include "CMakeSetup.h"
-#include "CMakeGenDialog.h"
-#include "../cmake.h"
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-// CCMakeGenDialog dialog
-
-
-CCMakeGenDialog::CCMakeGenDialog(CWnd* pParent /*=NULL*/)
- : CDialog(CCMakeGenDialog::IDD, pParent)
-{
- //{{AFX_DATA_INIT(CCMakeGenDialog)
- //}}AFX_DATA_INIT
-}
-
-
-void CCMakeGenDialog::DoDataExchange(CDataExchange* pDX)
-{
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CCMakeGenDialog)
- DDX_Control(pDX, IDC_BuildForLabel, m_BuildForLabel);
- DDX_Control(pDX, IDC_Generator, m_GeneratorChoice);
- DDX_CBStringExact(pDX, IDC_Generator, m_GeneratorChoiceString);
- //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(CCMakeGenDialog, CDialog)
- //{{AFX_MSG_MAP(CCMakeGenDialog)
- // NOTE: the ClassWizard will add message map macros here
- ON_CBN_EDITCHANGE(IDC_Generator, OnEditchangeGenerator)
- //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// CCMakeGenDialog message handler
-
- void CCMakeGenDialog::OnEditchangeGenerator()
-{
- // TODO: Add your control notification handler code here
-
-}
-
-
-BOOL CCMakeGenDialog::OnInitDialog()
-{
- CDialog::OnInitDialog();
- std::vector<std::string> names;
- this->m_CMakeInstance->GetRegisteredGenerators(names);
- for(std::vector<std::string>::iterator i = names.begin();
- i != names.end(); ++i)
- {
- m_GeneratorChoice.AddString(i->c_str());
- }
-
- // we want to pick the best generator for their system first we check to
- // see if they have run cmake before, if so we use that generator
- std::string mp;
- bool done = false;
-
- // is the last generator set? If so use it
- mp = "[HKEY_CURRENT_USER\\Software\\Kitware"
- "\\CMakeSetup\\Settings\\StartPath;LastGenerator]";
- cmSystemTools::ExpandRegistryValues(mp);
- if(mp != "/registry")
- {
- m_GeneratorChoiceString = mp.c_str();
- done = true;
- }
- struct regToGen
- {
- const char* Registry;
- const char* GeneratorName;
- };
- regToGen installedGenerators[] = {
- // VS 9
- { "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft"
- "\\VisualStudio\\9.0\\Setup;Dbghelp_path]", "Visual Studio 9 2008"},
- // VS 8
- { "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft"
- "\\VisualStudio\\8.0\\Setup;Dbghelp_path]", "Visual Studio 8 2005"},
- // VS 7.1
- {"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft"
- "\\VisualStudio\\7.1;InstallDir]", "Visual Studio 7 .NET 2003"},
- // VS 7
- {"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft"
- "\\VisualStudio\\7.0;InstallDir]", "Visual Studio 7"},
- {0,0}
- };
- for(regToGen* ptr = installedGenerators; ptr->Registry != 0 && !done; ptr++)
- {
- mp = ptr->Registry;
- cmSystemTools::ExpandRegistryValues(mp);
- if(mp != "/registry")
- {
- m_GeneratorChoiceString = ptr->GeneratorName;
- done = true;
- }
- }
-
- // if still not done just guess on VS 6
- if (!done)
- {
- m_GeneratorChoiceString = "Visual Studio 6";
- }
-
- this->UpdateData(FALSE);
-
- return TRUE; // return TRUE unless you set the focus to a control
-}
-
-
diff --git a/Source/MFCDialog/CMakeGenDialog.h b/Source/MFCDialog/CMakeGenDialog.h
deleted file mode 100644
index f921f18..0000000
--- a/Source/MFCDialog/CMakeGenDialog.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/*=========================================================================
-
- Program: CMake - Cross-Platform Makefile Generator
- Module: $RCSfile$
- Language: C++
- Date: $Date$
- Version: $Revision$
-
- Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
- See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
-
- This software is distributed WITHOUT ANY WARRANTY; without even
- the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- PURPOSE. See the above copyright notices for more information.
-
-=========================================================================*/
-#if !defined(CMAKE_GEN_DIALOG_INCLUDED)
-#define CMAKE_GEN_DIALOG_INCLUDED
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-// CMakeGenDialog.h : header file
-//
-
-/////////////////////////////////////////////////////////////////////////////
-// CCMakeGenDialog dialog
-
-class cmake;
-
-class CCMakeGenDialog : public CDialog
-{
-// Construction
-public:
- CCMakeGenDialog(CWnd* pParent = NULL); // standard constructor
-
-// Dialog Data
- //{{AFX_DATA(CCMakeGenDialog)
- enum { IDD = IDD_GEN_DIALOG };
- CStatic m_BuildForLabel;
- CComboBox m_GeneratorChoice;
- CString m_GeneratorChoiceString;
- //}}AFX_DATA
-
-
-// Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CCMakeGenDialog)
- protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
- // Generated message map functions
- //{{AFX_MSG(CCMakeGenDialog)
- virtual BOOL OnInitDialog();
- afx_msg void OnEditchangeGenerator();
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-
- public:
- cmake *m_CMakeInstance;
-};
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
-
-#endif
diff --git a/Source/MFCDialog/CMakeLists.txt b/Source/MFCDialog/CMakeLists.txt
deleted file mode 100644
index 3b1f3b9..0000000
--- a/Source/MFCDialog/CMakeLists.txt
+++ /dev/null
@@ -1,109 +0,0 @@
-SET( SRCS
- CMakeSetup.h
- CMakeSetup.cpp
- MakeHelp.h
- MakeHelp.cpp
- CMakeGenDialog.h
- CMakeGenDialog.cpp
- CMakeSetup.rc
- CMakeSetupDialog.h
- CMakeSetupDialog.cpp
- PathDialog.h
- PathDialog.cpp
- PropertyList.cpp
- StdAfx.h
- StdAfx.cpp
- resource.h
- CMakeCommandLineInfo.cpp
-)
-
-# add stuff to use MFC in this executable
-ADD_DEFINITIONS(-D_AFXDLL)
-
-# Use of CMAKE_MFC_FLAG
-# Values:
-# 0: Use Standard Windows Libraries
-# 1: Use MFC in a Static Library
-# 2: Use MFC in a Shared DLL
-SET(CMAKE_MFC_FLAG 2)
-
-ADD_EXECUTABLE(CMakeSetup WIN32 ${SRCS})
-TARGET_LINK_LIBRARIES(CMakeSetup CMakeLib)
-ADD_DEPENDENCIES(CMakeSetup cmake)
-
-
-# some older versions of cmake do not have
-# a patch version set so we need to set it
-# so that a later if will not fail, this has
-# to be done all the time for all generators
-# since if statements are evaluated even if
-# inside a false if, they must still parse so for
-# if (CMAKE_PATCH_VERSION GREATER 4) not to
-# fail CMAKE_PATCH_VERSION must be set
-IF(${CMAKE_MAJOR_VERSION} LESS 3)
- IF(NOT DEFINED CMAKE_PATCH_VERSION)
- SET(CMAKE_PATCH_VERSION 0)
- ENDIF(NOT DEFINED CMAKE_PATCH_VERSION)
-ENDIF(${CMAKE_MAJOR_VERSION} LESS 3)
-
-# for MSVC greater than 71 assume mt is around
-# for other versions allow for the cache to be
-# seeded with a value for CMAKE_MT_EXECUTABLE
-# this allows for MSVC71 to build CMakeSetup that
-# will have the manifest stuff for windows vista
-IF(MSVC AND NOT MSVC60 AND NOT MSVC70 AND NOT MSVC71)
- SET(CMAKE_MT_EXECUTABLE mt)
-ENDIF(MSVC AND NOT MSVC60 AND NOT MSVC70 AND NOT MSVC71)
-IF(CMAKE_MT_EXECUTABLE)
- SET(exe "${CMAKE_CFG_INTDIR}/CMakeSetup.exe")
- IF(EXECUTABLE_OUTPUT_PATH)
- SET(exe "${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/CMakeSetup.exe")
- ENDIF(EXECUTABLE_OUTPUT_PATH)
-
- # VERBATIM flag should be avoided if building with Visual Studio.
- # (OK to add the flag if ${CMAKE_CFG_INTDIR} is "." which is one
- # indicator that you are not building with Visual Studio.)
- #
- SET(verbatim_flag)
- IF(NOT CMAKE_CONFIGURATION_TYPES)
- # VERBATIM flag should also be avoided if using an older CMake.
- # VERBATIM flag support was added in CMake 2.4.5
- #
- IF(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} EQUAL 2.4)
- IF(${CMAKE_PATCH_VERSION} GREATER 4)
- SET(verbatim_flag "VERBATIM")
- ENDIF(${CMAKE_PATCH_VERSION} GREATER 4)
- ENDIF(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} EQUAL 2.4)
-
- IF(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.4)
- SET(verbatim_flag "VERBATIM")
- ENDIF(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.4)
-
- IF(NOT verbatim_flag)
- MESSAGE("${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}): warning
- warning: The VERBATIM flag for ADD_CUSTOM_COMMAND may be required to execute mt correctly,
- but you are using a CMake ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} which does not parse the VERBATIM flag.
- Upgrade to CMake 2.4.5 or later to eliminate this warning.")
- ENDIF(NOT verbatim_flag)
- ENDIF(NOT CMAKE_CONFIGURATION_TYPES)
-
- SET(_CMAKE_INPUT_RESOURCE "-inputresource:${exe};#1")
- # if msvc71 then you can not replace the resource
- # but you can add one, so set the input resource to empty
- IF(MSVC71)
- SET(_CMAKE_INPUT_RESOURCE )
- ENDIF(MSVC71)
- # Solve the "things named like *Setup prompt for admin privileges
- # on Vista" problem by merging a manifest fragment that contains a
- # requestedExecutionLevel element:
- #
- ADD_CUSTOM_COMMAND(TARGET CMakeSetup
- POST_BUILD COMMAND mt
- "${_CMAKE_INPUT_RESOURCE}"
- -manifest "${CMAKE_CURRENT_SOURCE_DIR}/CMakeSetupManifest.xml"
- "-outputresource:${exe};#1"
- ${verbatim_flag}
- )
-ENDIF(CMAKE_MT_EXECUTABLE)
-
-INSTALL_TARGETS(/bin CMakeSetup)
diff --git a/Source/MFCDialog/CMakeSetup.cpp b/Source/MFCDialog/CMakeSetup.cpp
deleted file mode 100644
index 8d318a6..0000000
--- a/Source/MFCDialog/CMakeSetup.cpp
+++ /dev/null
@@ -1,158 +0,0 @@
-// CMakeSetupdialog.cpp : Defines the class behaviors for the application.
-//
-
-#include "stdafx.h"
-#include "CMakeSetup.h"
-#include "CMakeSetupDialog.h"
-#include "CMakeCommandLineInfo.h"
-#include "../cmDocumentation.h"
-#include "../cmake.h"
-#include "../cmSystemTools.h"
-
-
-//----------------------------------------------------------------------------
-static const char * cmDocumentationName[][3] =
-{
- {0,
- " CMakeSetup - CMake Windows GUI.", 0},
- {0,0,0}
-};
-
-//----------------------------------------------------------------------------
-static const char * cmDocumentationUsage[][3] =
-{
- {0,
- " CMakeSetup [options]\n"
- " CMakeSetup [options] <path-to-source>\n"
- " CMakeSetup [options] <path-to-existing-build>", 0},
- {0,0,0}
-};
-
-//----------------------------------------------------------------------------
-static const char * cmDocumentationDescription[][3] =
-{
- {0,
- "The \"CMakeSetup\" executable is the CMake Windows GUI. Project "
- "configuration settings may be specified interactively. "
- "Brief instructions are provided at the bottom of the "
- "window when the program is running.", 0},
- CMAKE_STANDARD_INTRODUCTION,
- {0,0,0}
-};
-
-//----------------------------------------------------------------------------
-static const char * cmDocumentationOptions[][3] =
-{
- {"-A[on|off]", "Enable/disable display of advanced cache values.",
- "There are two categories of CMake cache values: non-advanced and "
- "advanced. Most users will not need to change the advanced options. "
- "The CMakeSetup GUI contains a checkbox to enable/disable display of "
- "advanced options. This command line flag changes its default setting."},
- {0,0,0}
-};
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-// CMakeSetup
-
-BEGIN_MESSAGE_MAP(CMakeSetup, CWinApp)
- //{{AFX_MSG_MAP(CMakeSetup)
- // NOTE - the ClassWizard will add and remove mapping macros here.
- // DO NOT EDIT what you see in these blocks of generated code!
- //}}AFX_MSG
- ON_COMMAND(ID_HELP, CWinApp::OnHelp)
- END_MESSAGE_MAP();
-
-
-/////////////////////////////////////////////////////////////////////////////
-// CMakeSetup construction
-CMakeSetup::CMakeSetup()
-{
- // TODO: add construction code here,
- // Place all significant initialization in InitInstance
-}
-
-/////////////////////////////////////////////////////////////////////////////
-// The one and only CMakeSetup object
-
-CMakeSetup theApp;
-
-/////////////////////////////////////////////////////////////////////////////
-// CMakeSetup initialization
-
-BOOL CMakeSetup::InitInstance()
-{
- AfxEnableControlContainer();
-
- // Standard initialization
- // If you are not using these features and wish to reduce the size
- // of your final executable, you should remove from the following
- // the specific initialization routines you do not need.
-#if _MFC_VER <= 0x421
-#ifdef _AFXDLL
- Enable3dControls(); // Call this when using MFC in a shared DLL
-#else
- Enable3dControlsStatic(); // Call this when linking to MFC statically
-#endif
-#endif
- CMakeCommandLineInfo cmdInfo;
- ParseCommandLine(cmdInfo);
- cmSystemTools::FindExecutableDirectory(cmdInfo.GetArgV()[0]);
-
- // Check for documentation options. If there are no arguments skip
- // the check because the GUI should be displayed instead of showing
- // usage in this case.
- cmDocumentation doc;
- if(cmdInfo.GetArgC() > 1 &&
- doc.CheckOptions(cmdInfo.GetArgC(), cmdInfo.GetArgV()))
- {
- // Construct and print requested documentation.
- cmake hcm;
- hcm.AddCMakePaths();
- doc.SetCMakeRoot(hcm.GetCacheDefinition("CMAKE_ROOT"));
- std::vector<cmDocumentationEntry> commands;
- std::vector<cmDocumentationEntry> compatCommands;
- std::map<std::string,cmDocumentationSection *> propDocs;
-
- std::vector<cmDocumentationEntry> generators;
- hcm.GetCommandDocumentation(commands, true, false);
- hcm.GetCommandDocumentation(compatCommands, false, true);
- hcm.GetGeneratorDocumentation(generators);
- hcm.GetPropertiesDocumentation(propDocs);
- doc.SetName("cmake");
- doc.SetSection("Name",cmDocumentationName);
- doc.SetSection("Usage",cmDocumentationUsage);
- doc.SetSection("Description",cmDocumentationDescription);
- doc.AppendSection("Generators",generators);
- doc.PrependSection("Options",cmDocumentationOptions);
- doc.SetSection("Commands",commands);
- doc.SetSection("Compatilbility Commands", compatCommands);
- doc.SetSections(propDocs);
-
- return (doc.PrintRequestedDocumentation(std::cout)? 0:1);
- }
-
- CMakeSetupDialog dlg(cmdInfo);
-
- m_pMainWnd = &dlg;
- INT_PTR nResponse = dlg.DoModal();
- if (nResponse == IDOK)
- {
- // TODO: Place code here to handle when the dialog is
- // dismissed with OK
- }
- else if (nResponse == IDCANCEL)
- {
- // TODO: Place code here to handle when the dialog is
- // dismissed with Cancel
- }
-
- // Since the dialog has been closed, return FALSE so that we exit the
- // application, rather than start the application's message pump.
- return FALSE;
-}
diff --git a/Source/MFCDialog/CMakeSetup.h b/Source/MFCDialog/CMakeSetup.h
deleted file mode 100644
index 2d565d4..0000000
--- a/Source/MFCDialog/CMakeSetup.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/*=========================================================================
-
- Program: CMake - Cross-Platform Makefile Generator
- Module: $RCSfile$
- Language: C++
- Date: $Date$
- Version: $Revision$
-
- Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
- See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
-
- This software is distributed WITHOUT ANY WARRANTY; without even
- the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- PURPOSE. See the above copyright notices for more information.
-
-=========================================================================*/
-// CMakeSetupdialog.h : main header file for the CMakeSetupDIALOG application
-//
-
-#if !defined(AFX_CMakeSetupDIALOG_H__AC17A6F4_4634_11D4_8F21_00A0CC33FCD3__INCLUDED_)
-#define AFX_CMakeSetupDIALOG_H__AC17A6F4_4634_11D4_8F21_00A0CC33FCD3__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-#ifndef __AFXWIN_H__
-#error include 'stdafx.h' before including this file for PCH
-#endif
-
-#include "resource.h" // main symbols
-
-/////////////////////////////////////////////////////////////////////////////
-// CMakeSetup:
-// See CMakeSetupdialog.cpp for the implementation of this class
-//
-
-class CMakeSetup : public CWinApp
-{
-public:
- CMakeSetup();
-
-// Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CMakeSetup)
-public:
- virtual BOOL InitInstance();
- //}}AFX_VIRTUAL
-
-// Implementation
-
- //{{AFX_MSG(CMakeSetup)
- // NOTE - the ClassWizard will add and remove member functions here.
- // DO NOT EDIT what you see in these blocks of generated code !
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-};
-
-
-/////////////////////////////////////////////////////////////////////////////
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_CMakeSetupDIALOG_H__AC17A6F4_4634_11D4_8F21_00A0CC33FCD3__INCLUDED_)
diff --git a/Source/MFCDialog/CMakeSetup.rc b/Source/MFCDialog/CMakeSetup.rc
deleted file mode 100644
index 3e144e4..0000000
--- a/Source/MFCDialog/CMakeSetup.rc
+++ /dev/null
@@ -1,246 +0,0 @@
-// Microsoft Visual C++ generated resource script.
-//
-#include "resource.h"
-
-#define APSTUDIO_READONLY_SYMBOLS
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 2 resource.
-//
-#include "afxres.h"
-
-/////////////////////////////////////////////////////////////////////////////
-#undef APSTUDIO_READONLY_SYMBOLS
-
-/////////////////////////////////////////////////////////////////////////////
-// English (U.S.) resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
-#ifdef _WIN32
-LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
-#pragma code_page(1252)
-#endif //_WIN32
-
-#ifdef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// TEXTINCLUDE
-//
-
-1 TEXTINCLUDE
-BEGIN
- "resource.h\0"
-END
-
-2 TEXTINCLUDE
-BEGIN
- "#include ""afxres.h""\r\n"
- "\0"
-END
-
-3 TEXTINCLUDE
-BEGIN
- "#define _AFX_NO_SPLITTER_RESOURCES\r\n"
- "#define _AFX_NO_OLE_RESOURCES\r\n"
- "#define _AFX_NO_TRACKER_RESOURCES\r\n"
- "#define _AFX_NO_PROPERTY_RESOURCES\r\n"
- "\r\n"
- "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
- "#ifdef _WIN32\r\n"
- "LANGUAGE 9, 1\r\n"
- "#pragma code_page(1252)\r\n"
- "#endif //_WIN32\r\n"
- "#include ""res\\CMakeSetupDialog.rc2"" // non-Microsoft Visual C++ edited resources\r\n"
- "#include ""afxres.rc"" // Standard components\r\n"
- "#endif\r\n"
- "\0"
-END
-
-#endif // APSTUDIO_INVOKED
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Icon
-//
-
-// Icon with lowest ID value placed first to ensure application icon
-// remains consistent on all systems.
-IDR_MAINFRAME ICON "res\\CMakeSetupDialog.ico"
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Dialog
-//
-
-IDD_ABOUTBOX DIALOGEX 0, 0, 235, 55
-STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
-CAPTION "About CMakeSetup"
-BEGIN
- ICON IDR_MAINFRAME,IDC_STATIC,11,17,20,20
- LTEXT "CMakeSetup\nwww.cmake.org",IDC_STATIC,40,18,119,16
- DEFPUSHBUTTON "OK",IDOK,178,7,50,14,WS_GROUP
-END
-
-IDD_CMakeSetupDialog_DIALOG DIALOGEX 0, 0, 447, 255
-STYLE DS_SETFONT | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
-EXSTYLE WS_EX_APPWINDOW
-CAPTION "CMakeSetupDialog"
-FONT 8, "MS Sans Serif", 0, 0, 0x0
-BEGIN
- RTEXT "Where is the source code:",IDC_STATIC,6,7,86,9
- COMBOBOX IDC_WhereSource,96,6,169,12,CBS_SIMPLE | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
- PUSHBUTTON "Browse...",IDC_BROWSE_SOURCE,267,6,34,13
- RTEXT "Where to build the binaries:",IDC_STATIC,5,27,90,9
- COMBOBOX IDC_WhereBuild,96,26,169,68,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
- PUSHBUTTON "Browse...",IDC_BROWSE_BUILD,267,25,34,13
- CONTROL "Show Advanced Values",IDC_AdvancedValues,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,321,9,98,9
- DEFPUSHBUTTON "Configure",IDC_BuildProjects,84,221,51,15
- PUSHBUTTON "OK",IDC_OK,141,221,51,15
- PUSHBUTTON "Cancel",IDCANCEL,198,221,51,15
- PUSHBUTTON "Help",IDC_HELP_BUTTON,312,221,51,15
- LISTBOX IDC_LIST2,15,53,419,126,LBS_SORT | LBS_OWNERDRAWVARIABLE | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_HSCROLL
- GROUPBOX "Cache Values",IDC_FRAME,10,44,432,140
- CTEXT "Right click on a cache value for additional options (delete, ignore, and help).\nPress Configure to update and display new values in red.\nPress OK to generate selected build files and exit.",IDC_MouseHelpCaption,0,191,442,27
- LTEXT "Static",IDC_PROGRESS,2,240,442,12,SS_CENTERIMAGE | SS_SUNKEN
- PUSHBUTTON "Delete Cache",IDC_DELETE_BUTTON,255,221,51,15
- CONTROL "Suppress dev Warnings",IDC_SUPPRESS_DEV_WARNINGS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,321,28,108,10
-END
-
-IDD_CMAKE_HELP_DIALOG DIALOG 0, 0, 365, 183
-STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
-CAPTION "CMake Help"
-BEGIN
- DEFPUSHBUTTON "OK",IDOK,155,159,50,14
- EDITTEXT IDC_EDIT1,7,7,351,152,ES_MULTILINE | ES_READONLY | NOT WS_BORDER
-END
-
-IDD_GEN_DIALOG DIALOGEX 0, 0, 263, 86
-STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
-CAPTION "Select Generator"
-BEGIN
- DEFPUSHBUTTON "OK",IDOK,70,65,50,14
- PUSHBUTTON "Cancel",IDCANCEL,143,65,50,14
- RTEXT "Build For:",IDC_BuildForLabel,7,45,34,11,SS_CENTERIMAGE
- COMBOBOX IDC_Generator,52,45,204,117,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP
- CTEXT "Please select what build system you want CMake to generate files for.\nYou should select the tool that you will use to build the project.\nPress OK once you have made your selection.",IDC_MouseHelpCaption,7,7,245,36
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Version
-//
-
-VS_VERSION_INFO VERSIONINFO
- FILEVERSION 2,2,0,0
- PRODUCTVERSION 2,2,0,0
- FILEFLAGSMASK 0x3fL
-#ifdef _DEBUG
- FILEFLAGS 0x1L
-#else
- FILEFLAGS 0x0L
-#endif
- FILEOS 0x4L
- FILETYPE 0x1L
- FILESUBTYPE 0x0L
-BEGIN
- BLOCK "StringFileInfo"
- BEGIN
- BLOCK "040904b0"
- BEGIN
- VALUE "FileDescription", "CMakeSetup MFC Application"
- VALUE "FileVersion", "2, 2, 0, 0"
- VALUE "InternalName", "CMakeSetup"
- VALUE "LegalCopyright", "Copyright (C) 2000"
- VALUE "OriginalFilename", "CMakeSetup.EXE"
- VALUE "ProductName", "CMakeSetup Application"
- VALUE "ProductVersion", "2, 2, 0, 0"
- END
- END
- BLOCK "VarFileInfo"
- BEGIN
- VALUE "Translation", 0x409, 1200
- END
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// DESIGNINFO
-//
-
-#ifdef APSTUDIO_INVOKED
-GUIDELINES DESIGNINFO
-BEGIN
- IDD_ABOUTBOX, DIALOG
- BEGIN
- LEFTMARGIN, 7
- RIGHTMARGIN, 228
- TOPMARGIN, 7
- BOTTOMMARGIN, 48
- END
-
- IDD_CMakeSetupDialog_DIALOG, DIALOG
- BEGIN
- RIGHTMARGIN, 442
- BOTTOMMARGIN, 252
- END
-
- IDD_CMAKE_HELP_DIALOG, DIALOG
- BEGIN
- LEFTMARGIN, 7
- RIGHTMARGIN, 358
- TOPMARGIN, 7
- BOTTOMMARGIN, 176
- END
-
- IDD_GEN_DIALOG, DIALOG
- BEGIN
- LEFTMARGIN, 7
- RIGHTMARGIN, 256
- TOPMARGIN, 7
- BOTTOMMARGIN, 79
- END
-END
-#endif // APSTUDIO_INVOKED
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// String Table
-//
-
-STRINGTABLE
-BEGIN
- IDS_ABOUTBOX "&About CMakeSetup..."
- IDS_CREATESHORTCUT "&Create shortcut"
-END
-
-#endif // English (U.S.) resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-
-#ifndef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 3 resource.
-//
-#define _AFX_NO_SPLITTER_RESOURCES
-#define _AFX_NO_OLE_RESOURCES
-#define _AFX_NO_TRACKER_RESOURCES
-#define _AFX_NO_PROPERTY_RESOURCES
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
-#ifdef _WIN32
-LANGUAGE 9, 1
-#pragma code_page(1252)
-#endif //_WIN32
-#include "res\CMakeSetupDialog.rc2" // non-Microsoft Visual C++ edited resources
-#include "afxres.rc" // Standard components
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-#endif // not APSTUDIO_INVOKED
-
diff --git a/Source/MFCDialog/CMakeSetupDialog.cpp b/Source/MFCDialog/CMakeSetupDialog.cpp
deleted file mode 100644
index 1098c97..0000000
--- a/Source/MFCDialog/CMakeSetupDialog.cpp
+++ /dev/null
@@ -1,1550 +0,0 @@
-// pcbuilderdialogDlg.cpp : implementation file
-//
-
-#include "stdafx.h"
-#include "shellapi.h"
-// a fun undef for DOT NET
-#undef DEBUG
-#include "CMakeSetup.h"
-#include "MakeHelp.h"
-#include "cmVersion.h"
-#include "PathDialog.h"
-#include "CMakeSetupDialog.h"
-#include "CMakeCommandLineInfo.h"
-#include "../cmExternalMakefileProjectGenerator.h"
-#include "../cmListFileCache.h"
-#include "../cmCacheManager.h"
-#include "../cmake.h"
-#include "../cmGlobalGenerator.h"
-#include "../cmDynamicLoader.h"
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-
-/////////////////////////////////////////////////////////////////////////////
-// CAboutDlg dialog used for App About
-
-class CAboutDlg : public CDialog
-{
-public:
- CAboutDlg();
-
- // Dialog Data
- //{{AFX_DATA(CAboutDlg)
- enum { IDD = IDD_ABOUTBOX };
- //}}AFX_DATA
-
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CAboutDlg)
-protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- //}}AFX_VIRTUAL
-
-// Implementation
-protected:
- //{{AFX_MSG(CAboutDlg)
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
- };
-
-CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
-{
- //{{AFX_DATA_INIT(CAboutDlg)
- //}}AFX_DATA_INIT
-}
-
-void CAboutDlg::DoDataExchange(CDataExchange* pDX)
-{
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CAboutDlg)
- //}}AFX_DATA_MAP
-}
-
-BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
- //{{AFX_MSG_MAP(CAboutDlg)
- // No message handlers
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP();
-
-
-void MFCMessageCallback(const char* m, const char* title, bool& nomore, void*)
-{
- std::string message = m;
- message += "\n\n(Press Cancel to suppress any further messages.)";
- if(::MessageBox(0, message.c_str(), title,
- MB_OKCANCEL|MB_TASKMODAL) == IDCANCEL)
- {
- nomore = true;
- }
-}
-
-/////////////////////////////////////////////////////////////////////////////
-// CMakeSetupDialog dialog
-void updateProgress(const char *msg, float prog, void *cd)
-{
- char* tmp = new char[strlen(msg) + 40];
- if (prog >= 0)
- {
- sprintf(tmp,"%s %i%%",msg,(int)(100*prog));
- }
- else
- {
- sprintf(tmp,"%s",msg);
- }
- CMakeSetupDialog *self = (CMakeSetupDialog *)cd;
- self->SetDlgItemText(IDC_PROGRESS, tmp);
- CWnd* cancel = self->GetDlgItem(IDCANCEL);
- //
- // Retrieve and dispatch any waiting messages.
- //
- MSG wmsg;
- while (::PeekMessage (&wmsg, NULL, 0, 0, PM_REMOVE))
- {
- switch(wmsg.message)
- {
- case WM_LBUTTONDOWN:
- case WM_LBUTTONUP:
- case WM_LBUTTONDBLCLK:
- {
- if(wmsg.hwnd == cancel->m_hWnd)
- {
- ::DispatchMessage(&wmsg);
- }
- }
- break;
- case WM_COMMAND:
- case WM_SETCURSOR:
- case WM_PAINT:
- ::DispatchMessage(&wmsg);
- break;
- }
- }
- delete [] tmp;
-}
-
-// Convert to Win32 path (slashes). This calls the system tools one and then
-// removes the spaces. It is not in system tools because we don't want any
-// generators accidentally use it
-std::string ConvertToWindowsPath(const char* path)
-{
- // Convert to output path.
- // Remove the "" around it (if any) since it's an output path for
- // the shell. If another shell-oriented feature is not designed
- // for a GUI use, then we are in trouble.
- // save the value of the force to unix path option
- bool saveForce = cmSystemTools::GetForceUnixPaths();
- // make sure we get windows paths no matter what for the GUI
- cmSystemTools::SetForceUnixPaths(false);
- std::string s = cmSystemTools::ConvertToOutputPath(path);
- // now restore the force unix path to its previous value
- cmSystemTools::SetForceUnixPaths(saveForce);
- if (s.size())
- {
- std::string::iterator i = s.begin();
- if (*i == '\"')
- {
- s.erase(i, i + 1);
- }
- i = s.begin() + s.length() - 1;
- if (*i == '\"')
- {
- s.erase(i, i + 1);
- }
- }
- return s;
-}
-
-CMakeSetupDialog::CMakeSetupDialog(const CMakeCommandLineInfo& cmdInfo,
- CWnd* pParent /*=NULL*/)
- : CDialog(CMakeSetupDialog::IDD, pParent)
-{
- m_GeneratorPicked = false;
- m_Cursor = LoadCursor(NULL, IDC_ARROW);
- m_RunningConfigure = false;
- cmSystemTools::SetRunCommandHideConsole(true);
- cmSystemTools::SetErrorCallback(MFCMessageCallback);
- m_RegistryKey = "Software\\Kitware\\CMakeSetup\\Settings\\StartPath";
- m_CacheEntriesList.m_CMakeSetupDialog = this;
-
- m_CMakeInstance = new cmake;
- m_CMakeInstance->SetCMakeEditCommand("CMakeSetup");
- m_CMakeInstance->SetProgressCallback(updateProgress, (void *)this);
-
- //{{AFX_DATA_INIT(CMakeSetupDialog)
- //}}AFX_DATA_INIT
-
- // Get the parameters from the command line info
- // If an unknown parameter is found, try to interpret it too, since it
- // is likely to be a file dropped on the shortcut :)
- if (cmdInfo.m_LastUnknownParameter.IsEmpty())
- {
- this->m_WhereSource = cmdInfo.m_WhereSource;
- this->m_WhereBuild = cmdInfo.m_WhereBuild;
- this->m_GeneratorDialog.m_GeneratorChoiceString =
- cmdInfo.m_GeneratorChoiceString;
- this->m_AdvancedValues = cmdInfo.m_AdvancedValues;
- }
- else
- {
- this->m_WhereSource = _T("");
- this->m_WhereBuild = _T("");
- this->m_AdvancedValues = FALSE;
- this->m_GeneratorDialog.m_GeneratorChoiceString =
- cmdInfo.m_GeneratorChoiceString;
- this->ChangeDirectoriesFromFile((LPCTSTR)cmdInfo.m_LastUnknownParameter);
- }
-
- // Note that LoadIcon does not require a subsequent DestroyIcon in Win32
- m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
- m_BuildPathChanged = false;
- // Find the path to the cmake.exe executable
- char fname[1024];
- ::GetModuleFileName(NULL,fname,1023);
- // extract just the path part
- m_PathToExecutable = cmSystemTools::GetProgramPath(fname).c_str();
- // add the cmake.exe to the path
- m_PathToExecutable += "/cmake.exe";
-
- m_oldCX = -1;
- m_deltaXRemainder = 0;
-}
-
-CMakeSetupDialog::~CMakeSetupDialog()
-{
- delete m_CMakeInstance;
- // clean up globals
- cmDynamicLoader::FlushCache();
-}
-
-void CMakeSetupDialog::DoDataExchange(CDataExchange* pDX)
-{
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CMakeSetupDialog)
- DDX_Control(pDX, IDC_AdvancedValues, m_AdvancedValuesControl);
- DDX_Control(pDX, IDC_SUPPRESS_DEV_WARNINGS, m_SuppressDevWarningsControl);
- DDX_Check(pDX, IDC_SUPPRESS_DEV_WARNINGS, m_SuppressDevValue);
- DDX_Control(pDX, IDC_BROWSE_SOURCE, m_BrowseSource);
- DDX_Control(pDX, IDC_BROWSE_BUILD, m_BrowseBuild);
- DDX_Control(pDX, IDC_DELETE_BUTTON, m_DeleteButton);
- DDX_Control(pDX, IDC_HELP_BUTTON, m_HelpButton);
- DDX_Control(pDX, IDC_OK, m_OKButton);
- DDX_Control(pDX, IDCANCEL, m_CancelButton);
- DDX_CBStringExact(pDX, IDC_WhereSource, m_WhereSource);
- DDX_CBStringExact(pDX, IDC_WhereBuild, m_WhereBuild);
- DDX_Control(pDX, IDC_FRAME, m_ListFrame);
- DDX_Control(pDX, IDC_WhereSource, m_WhereSourceControl);
- DDX_Control(pDX, IDC_WhereBuild, m_WhereBuildControl);
- DDX_Control(pDX, IDC_LIST2, m_CacheEntriesList);
- DDX_Control(pDX, IDC_MouseHelpCaption, m_MouseHelp);
- DDX_Control(pDX, IDC_PROGRESS, m_StatusDisplay);
- DDX_Control(pDX, IDC_BuildProjects, m_Configure);
- DDX_Check(pDX, IDC_AdvancedValues, m_AdvancedValues);
- //}}AFX_DATA_MAP
-}
-
-BEGIN_MESSAGE_MAP(CMakeSetupDialog, CDialog)
- //{{AFX_MSG_MAP(CMakeSetupDialog)
- ON_WM_SYSCOMMAND()
- ON_WM_PAINT()
- ON_WM_QUERYDRAGICON()
- ON_BN_CLICKED(IDC_BUTTON2, OnBrowseWhereSource)
- ON_BN_CLICKED(IDC_BuildProjects, OnConfigure)
- ON_BN_CLICKED(IDC_BUTTON3, OnBrowseWhereBuild)
- ON_CBN_EDITCHANGE(IDC_WhereBuild, OnChangeWhereBuild)
- ON_CBN_SELCHANGE(IDC_WhereBuild, OnSelendokWhereBuild)
- ON_CBN_EDITCHANGE(IDC_WhereSource, OnChangeWhereSource)
- ON_CBN_SELENDOK(IDC_WhereSource, OnSelendokWhereSource)
- ON_WM_SIZE()
- ON_WM_GETMINMAXINFO()
- ON_BN_CLICKED(IDC_OK, OnOk)
- ON_BN_CLICKED(IDC_DELETE_BUTTON, OnDeleteButton)
- ON_BN_CLICKED(IDC_HELP_BUTTON, OnHelpButton)
- ON_BN_CLICKED(IDC_AdvancedValues, OnAdvancedValues)
- ON_BN_CLICKED(IDC_SUPPRESS_DEV_WARNINGS, OnSuppressDevValue)
- ON_BN_DOUBLECLICKED(IDC_SUPPRESS_DEV_WARNINGS, OnDoubleclickedSuppressDevValue)
- ON_BN_DOUBLECLICKED(IDC_AdvancedValues, OnDoubleclickedAdvancedValues)
- ON_WM_DROPFILES()
- ON_BN_CLICKED(IDCANCEL, OnCancel)
- ON_WM_SETCURSOR()
- //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// CMakeSetupDialog message handlers
-
-BOOL CMakeSetupDialog::OnInitDialog()
-{
- CDialog::OnInitDialog();
- this->DragAcceptFiles(true);
-
- // Add "Create shortcut" menu item to system menu.
-
- // IDM_CREATESHORTCUT must be in the system command range.
- ASSERT((IDM_CREATESHORTCUT & 0xFFF0) == IDM_CREATESHORTCUT);
- ASSERT(IDM_CREATESHORTCUT < 0xF000);
-
- // Add "About..." menu item to system menu.
-
- // IDM_ABOUTBOX must be in the system command range.
- ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
- ASSERT(IDM_ABOUTBOX < 0xF000);
-
- CMenu* pSysMenu = GetSystemMenu(FALSE);
- if (pSysMenu != NULL)
- {
- CString strCreateShortcutMenu;
- strCreateShortcutMenu.LoadString(IDS_CREATESHORTCUT);
- if (!strCreateShortcutMenu.IsEmpty())
- {
- pSysMenu->AppendMenu(MF_SEPARATOR);
- pSysMenu->AppendMenu(MF_STRING,
- IDM_CREATESHORTCUT,
- strCreateShortcutMenu);
- }
-
- CString strAboutMenu;
- strAboutMenu.LoadString(IDS_ABOUTBOX);
- if (!strAboutMenu.IsEmpty())
- {
- pSysMenu->AppendMenu(MF_SEPARATOR);
- pSysMenu->AppendMenu(MF_STRING,
- IDM_ABOUTBOX,
- strAboutMenu);
- }
- }
-
- // Set the icon for this dialog. The framework does this automatically
- // when the application's main window is not a dialog
- SetIcon(m_hIcon, TRUE); // Set big icon
- SetIcon(m_hIcon, FALSE); // Set small icon
- // Load source and build dirs from registry
- this->LoadFromRegistry();
-
- // try to load the cmake cache from disk
- this->LoadCacheFromDiskToGUI();
- m_WhereBuildControl.LimitText(2048);
- m_WhereSourceControl.LimitText(2048);
-
- // Set the version number
- char tmp[1024];
- sprintf(tmp,"CMake %s", cmVersion::GetCMakeVersion());
- SetDlgItemText(IDC_PROGRESS, "");
- this->SetWindowText(tmp);
- this->UpdateData(FALSE);
- return TRUE; // return TRUE unless you set the focus to a control
-}
-
-
-// About dialog invoke
-void CMakeSetupDialog::OnSysCommand(UINT nID, LPARAM lParam)
-{
- if ((nID & 0xFFF0) == IDM_ABOUTBOX)
- {
- CAboutDlg dlgAbout;
- dlgAbout.DoModal();
- }
- else if ((nID & 0xFFF0) == IDM_CREATESHORTCUT)
- {
- CreateShortcut();
- }
- else
- {
- CDialog::OnSysCommand(nID, lParam);
- }
-}
-
-// If you add a minimize button to your dialog, you will need the code below
-// to draw the icon. For MFC applications using the document/view model,
-// this is automatically done for you by the framework.
-
-void CMakeSetupDialog::OnPaint()
-{
- if (IsIconic())
- {
- CPaintDC dc(this); // device context for painting
-
- SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
-
- // Center icon in client rectangle
- int cxIcon = GetSystemMetrics(SM_CXICON);
- int cyIcon = GetSystemMetrics(SM_CYICON);
- CRect rect;
- GetClientRect(&rect);
- int x = (rect.Width() - cxIcon + 1) / 2;
- int y = (rect.Height() - cyIcon + 1) / 2;
-
- // Draw the icon
- dc.DrawIcon(x, y, m_hIcon);
- }
- else
- {
- CDialog::OnPaint();
- }
-}
-
-// The system calls this to obtain the cursor to display while the user drags
-// the minimized window.
-HCURSOR CMakeSetupDialog::OnQueryDragIcon()
-{
- return (HCURSOR) m_hIcon;
-}
-
-
-
-// Browse button
-bool CMakeSetupDialog::Browse(CString &result, const char *title)
-{
- CString initialDir = result;
- initialDir.Replace("/", "\\");
- CPathDialog dlg("Select Path", title, initialDir);
- if(dlg.DoModal()==IDOK)
- {
- result = dlg.GetPathName();
- return true;
- }
- else
- {
- return false;
- }
-}
-
-
-
-
-void CMakeSetupDialog::SaveToRegistry()
-{
- HKEY hKey;
- DWORD dwDummy;
-
- if(RegCreateKeyEx(HKEY_CURRENT_USER,
- m_RegistryKey,
- 0, "", REG_OPTION_NON_VOLATILE, KEY_READ|KEY_WRITE,
- NULL, &hKey, &dwDummy) != ERROR_SUCCESS)
- {
- return;
- }
- else
- {
- // save some values
- CString regvalue;
-
- // write the size of the dialog
- CRect size;
- this->GetWindowRect(&size);
- unsigned long width = size.Width();
- unsigned long height = size.Height();
- RegSetValueEx(hKey, _T("Width"), 0, REG_DWORD,
- (CONST BYTE *)(&width),4);
- RegSetValueEx(hKey, _T("Height"), 0, REG_DWORD,
- (CONST BYTE *)(&height),4);
-
- this->ReadRegistryValue(hKey, &(regvalue),"WhereSource1","C:\\");
- int shiftEnd = 9;
- if(m_WhereSource != regvalue)
- {
- char keyName[1024];
- char keyName2[1024];
- int i;
- for (i = 2; i < 10; ++i)
- {
- regvalue = "";
- sprintf(keyName,"WhereSource%i",i);
- this->ReadRegistryValue(hKey, &(regvalue),keyName,"");
- // check for short circuit, if the new value is already in
- // the list then we stop
- if (m_WhereSource == regvalue)
- {
- shiftEnd = i - 1;
- }
- }
-
- for (i = shiftEnd; i; --i)
- {
- regvalue = "";
- sprintf(keyName,"WhereSource%i",i);
- sprintf(keyName2,"WhereSource%i",i+1);
-
- this->ReadRegistryValue(hKey, &(regvalue),keyName,"");
- if (strlen(regvalue))
- {
- RegSetValueEx(hKey, _T(keyName2), 0, REG_SZ,
- (CONST BYTE *)(const char *)regvalue,
- regvalue.GetLength());
- }
- }
- RegSetValueEx(hKey, _T("WhereSource1"), 0, REG_SZ,
- (CONST BYTE *)(const char *)m_WhereSource,
- m_WhereSource.GetLength());
- }
-
- this->ReadRegistryValue(hKey, &(regvalue),"WhereBuild1","C:\\");
- if(m_WhereBuild != regvalue)
- {
- int i;
- char keyName[1024];
- char keyName2[1024];
- for (i = 2; i < 10; ++i)
- {
- regvalue = "";
- sprintf(keyName,"WhereBuild%i",i);
- this->ReadRegistryValue(hKey, &(regvalue),keyName,"");
- // check for short circuit, if the new value is already in
- // the list then we stop
- if (m_WhereBuild == regvalue)
- {
- shiftEnd = i - 1;
- }
- }
- for (i = shiftEnd; i; --i)
- {
- regvalue = "";
- sprintf(keyName,"WhereBuild%i",i);
- sprintf(keyName2,"WhereBuild%i",i+1);
-
- this->ReadRegistryValue(hKey, &(regvalue),keyName,"");
- if (strlen(regvalue))
- {
- RegSetValueEx(hKey, _T(keyName2), 0, REG_SZ,
- (CONST BYTE *)(const char *)regvalue,
- regvalue.GetLength());
- }
- }
- RegSetValueEx(hKey, _T("WhereBuild1"), 0, REG_SZ,
- (CONST BYTE *)(const char *)m_WhereBuild,
- m_WhereBuild.GetLength());
- }
- }
- RegCloseKey(hKey);
-}
-
-
-void CMakeSetupDialog::ReadRegistryValue(HKEY hKey,
- CString *val,
- const char *key,
- const char *adefault)
-{
- DWORD dwType, dwSize;
- char *pb;
-
- dwType = REG_SZ;
- pb = val->GetBuffer(MAX_PATH);
- dwSize = MAX_PATH;
- if(RegQueryValueEx(hKey,_T(key), NULL, &dwType,
- (BYTE *)pb, &dwSize) != ERROR_SUCCESS)
- {
- val->ReleaseBuffer();
- *val = _T(adefault);
- }
- else
- {
- val->ReleaseBuffer();
- }
-}
-
-
-void CMakeSetupDialog::LoadFromRegistry()
-{
- HKEY hKey;
- if(RegOpenKeyEx(HKEY_CURRENT_USER,
- m_RegistryKey,
- 0, KEY_READ, &hKey) != ERROR_SUCCESS)
- {
- return;
- }
- else
- {
- // load some values
- DWORD dwSize = 4;
- DWORD width, height;
-
- if (RegQueryValueEx(hKey,_T("Width"), NULL, NULL,
- (BYTE *)&width, &dwSize) == ERROR_SUCCESS &&
- RegQueryValueEx(hKey,_T("Height"), NULL, NULL,
- (BYTE *)&height, &dwSize) == ERROR_SUCCESS)
- {
- this->SetWindowPos(0,0,0,width,height,SWP_NOZORDER | SWP_NOMOVE);
- }
-
- if (m_WhereSource.IsEmpty())
- {
- this->ReadRegistryValue(hKey, &(m_WhereSource),"WhereSource1","C:\\");
- }
- if (m_WhereBuild.IsEmpty())
- {
- this->ReadRegistryValue(hKey, &(m_WhereBuild),"WhereBuild1","C:\\");
- }
- m_WhereSourceControl.AddString(m_WhereSource);
- m_WhereBuildControl.AddString(m_WhereBuild);
-
- char keyname[1024];
- CString regvalue;
- int i;
- for (i = 2; i <= 10; ++i)
- {
- sprintf(keyname,"WhereSource%i",i);
- regvalue = "";
- this->ReadRegistryValue(hKey, &(regvalue),keyname,"C:\\");
- if (strcmp("C:\\",regvalue))
- {
- m_WhereSourceControl.AddString(regvalue);
- }
- sprintf(keyname,"WhereBuild%i",i);
- regvalue = "";
- this->ReadRegistryValue(hKey, &(regvalue),keyname,"C:\\");
- if (strcmp("C:\\",regvalue))
- {
- m_WhereBuildControl.AddString(regvalue);
- }
- }
- }
- RegCloseKey(hKey);
-}
-
-
-
-// Callback for browse source button
-void CMakeSetupDialog::OnBrowseWhereSource()
-{
- this->UpdateData();
- Browse(m_WhereSource, "Enter Path to Source");
- this->UpdateData(false);
- this->OnChangeWhereSource();
-}
-
-// Callback for browser build button
-void CMakeSetupDialog::OnBrowseWhereBuild()
-{
- this->UpdateData();
- Browse(m_WhereBuild, "Enter Path to Build");
- this->UpdateData(false);
- this->OnChangeWhereBuild();
-}
-
-void CMakeSetupDialog::RunCMake(bool generateProjectFiles)
-{
- if(!cmSystemTools::FileExists(m_WhereBuild))
- {
- std::string message =
- "Build directory does not exist, should I create it?\n\n"
- "Directory: ";
- message += (const char*)m_WhereBuild;
- if(MessageBox(message.c_str(), "Create Directory", MB_OKCANCEL) == IDOK)
- {
- cmSystemTools::MakeDirectory(m_WhereBuild);
- }
- else
- {
- MessageBox("Build Project aborted, nothing done.");
- return;
- }
- }
- // set the wait cursor
- m_Cursor = LoadCursor(NULL, IDC_WAIT);
- ::SetCursor(m_Cursor);
- m_RunningConfigure = true;
-
- // get all the info from the dialog
- this->UpdateData();
- // always save the current gui values to disk
- this->SaveCacheFromGUI();
- // Make sure we are working from the cache on disk
- this->LoadCacheFromDiskToGUI();
- m_OKButton.EnableWindow(false);
-
- // setup the cmake instance
- if (generateProjectFiles)
- {
- if(m_CMakeInstance->Generate() != 0)
- {
- cmSystemTools::Error(
- "Error in generation process, project files may be invalid");
- }
- }
- else
- {
- m_CMakeInstance->SetHomeDirectory(m_WhereSource);
- m_CMakeInstance->SetStartDirectory(m_WhereSource);
- m_CMakeInstance->SetHomeOutputDirectory(m_WhereBuild);
- m_CMakeInstance->SetStartOutputDirectory(m_WhereBuild);
- m_CMakeInstance->SetGlobalGenerator(
- m_CMakeInstance->CreateGlobalGenerator(m_GeneratorDialog.m_GeneratorChoiceString));
- m_CMakeInstance->SetCMakeCommand(m_PathToExecutable);
- m_CMakeInstance->LoadCache();
- if(m_SuppressDevValue)
- {
- m_CMakeInstance->SetSuppressDevWarnings(true);
- }
- else
- {
- m_CMakeInstance->SetSuppressDevWarnings(false);
- }
- if(m_CMakeInstance->Configure() != 0)
- {
- cmSystemTools::Error(
- "Error in configuration process, project files may be invalid");
- }
- // update the GUI with any new values in the caused by the
- // generation process
- this->LoadCacheFromDiskToGUI();
- }
-
- // save source and build paths to registry
- this->SaveToRegistry();
- // path is up-to-date now
- m_BuildPathChanged = false;
- // put the cursor back
- m_Cursor = LoadCursor(NULL, IDC_ARROW);
- ::SetCursor(m_Cursor);
- m_RunningConfigure = false;
- cmSystemTools::ResetErrorOccuredFlag();
-}
-
-
-// Callback for build projects button
-void CMakeSetupDialog::OnConfigure()
-{
- if(!m_GeneratorPicked)
- {
- m_GeneratorDialog.m_CMakeInstance = this->m_CMakeInstance;
- if(m_GeneratorDialog.DoModal() != IDOK)
- {
- return;
- }
- // save the generator choice in the registry
- HKEY hKey;
- DWORD dwDummy;
-
- if(RegCreateKeyEx(HKEY_CURRENT_USER,
- m_RegistryKey,
- 0, "", REG_OPTION_NON_VOLATILE, KEY_READ|KEY_WRITE,
- NULL, &hKey, &dwDummy) == ERROR_SUCCESS)
- {
- // save some values
- RegSetValueEx(hKey, _T("LastGenerator"), 0, REG_SZ,
- (CONST BYTE *)(const char *)m_GeneratorDialog.m_GeneratorChoiceString,
- m_GeneratorDialog.m_GeneratorChoiceString.GetLength());
- }
- }
-
- // enable error messages each time configure is pressed
- cmSystemTools::EnableMessages();
- this->RunCMake(false);
-}
-
-
-
-
-// callback for combo box menu where build selection
-void CMakeSetupDialog::OnSelendokWhereBuild()
-{
- m_WhereBuildControl.GetLBText(m_WhereBuildControl.GetCurSel(),
- m_WhereBuild);
- m_WhereBuildControl.SetWindowText( m_WhereBuild);
- this->UpdateData(FALSE);
- this->OnChangeWhereBuild();
-}
-
-// callback for combo box menu where source selection
-void CMakeSetupDialog::OnSelendokWhereSource()
-{
- m_WhereSourceControl.GetLBText(m_WhereSourceControl.GetCurSel(),
- m_WhereSource);
- this->UpdateData(FALSE);
- this->OnChangeWhereSource();
-}
-
-// callback for chaing source directory
-void CMakeSetupDialog::OnChangeWhereSource()
-{
-}
-
-// callback for changing the build directory
-void CMakeSetupDialog::OnChangeWhereBuild()
-{
- this->UpdateData();
-
- // The build dir has changed, check if there is a cache, and
- // grab the source dir from it
-
- std::string path = this->m_WhereBuild;
- cmSystemTools::ConvertToUnixSlashes(path);
-
- // adjust the cmake instance
- m_CMakeInstance->SetHomeOutputDirectory(m_WhereBuild);
- m_CMakeInstance->SetStartOutputDirectory(m_WhereBuild);
-
- std::string cache_file = path;
- cache_file += "/CMakeCache.txt";
-
- cmCacheManager *cachem = this->m_CMakeInstance->GetCacheManager();
- cmCacheManager::CacheIterator it = cachem->NewIterator();
-
- m_GeneratorPicked = false;
-
- // make sure we have a normal cache file, specifically if one exists make
- // sure it can be read
- if (cmSystemTools::FileExists(cache_file.c_str()))
- {
- if (cachem->LoadCache(path.c_str()))
- {
- if (it.Find("CMAKE_HOME_DIRECTORY"))
- {
- path = ConvertToWindowsPath(it.GetValue());
- this->m_WhereSource = path.c_str();
- this->m_WhereSourceControl.SetWindowText(this->m_WhereSource);
- this->OnChangeWhereSource();
- m_GeneratorPicked = true;
- }
- }
- else
- {
- //file exists but cqnnot be read
- cmSystemTools::Error("There is a CMakeCache.txt file for the current binary tree but cmake does not have permission to read it. Please check the permissions of the directory you are trying to run CMake on.");
- return;
- }
- }
-
- m_CacheEntriesList.RemoveAll();
- m_CacheEntriesList.ShowWindow(SW_SHOW);
- this->LoadCacheFromDiskToGUI();
- m_BuildPathChanged = true;
-}
-
-
-// copy from the cache manager to the cache edit list box
-void CMakeSetupDialog::FillCacheGUIFromCacheManager()
-{
- cmCacheManager *cachem = this->m_CMakeInstance->GetCacheManager();
- cmCacheManager::CacheIterator it = cachem->NewIterator();
-
- // if there are already entries in the cache, then
- // put the new ones in the top, so they show up first
- bool reverseOrder = false;
- // all the current values are not new any more
- std::set<CPropertyItem*> items = m_CacheEntriesList.GetItems();
- for(std::set<CPropertyItem*>::iterator i = items.begin();
- i != items.end(); ++i)
- {
- // first check to see if it is still in the cache
- CPropertyItem* item = *i;
- if ( !it.Find((const char*)item->m_propName) )
- {
- m_CacheEntriesList.RemoveProperty((const char*)item->m_propName);
- }
- else
- {
- // if it is still in the cache then it is no longer new
- item->m_NewValue = false;
- }
- }
- for(cmCacheManager::CacheIterator i = cachem->NewIterator();
- !i.IsAtEnd(); i.Next())
- {
- const char* key = i.GetName();
-
- // if value has trailing space or tab, enclose it in single quotes
- // to enforce the fact that it has 'invisible' trailing stuff
- std::string value = i.GetValue();
- if (value.size() &&
- (value[value.size() - 1] == ' ' ||
- value[value.size() - 1] == '\t'))
- {
- value = '\'' + value + '\'';
- }
- bool advanced = i.GetPropertyAsBool("ADVANCED");
- switch(i.GetType() )
- {
- case cmCacheManager::BOOL:
- if(cmSystemTools::IsOn(value.c_str()))
- {
- m_CacheEntriesList.AddProperty(key,
- "ON",
- i.GetProperty("HELPSTRING"),
- CPropertyList::COMBO,"ON|OFF",
- reverseOrder,
- advanced
- );
- }
- else
- {
- m_CacheEntriesList.AddProperty(key,
- "OFF",
- i.GetProperty("HELPSTRING"),
- CPropertyList::COMBO,"ON|OFF",
- reverseOrder, advanced
- );
- }
- break;
- case cmCacheManager::PATH:
- m_CacheEntriesList.AddProperty(key,
- value.c_str(),
- i.GetProperty("HELPSTRING"),
- CPropertyList::PATH,"",
- reverseOrder, advanced
- );
- break;
- case cmCacheManager::FILEPATH:
- m_CacheEntriesList.AddProperty(key,
- value.c_str(),
- i.GetProperty("HELPSTRING"),
- CPropertyList::FILE,"",
- reverseOrder, advanced
- );
- break;
- case cmCacheManager::STRING:
- m_CacheEntriesList.AddProperty(key,
- value.c_str(),
- i.GetProperty("HELPSTRING"),
- CPropertyList::EDIT,"",
- reverseOrder, advanced
- );
- break;
- case cmCacheManager::INTERNAL:
- m_CacheEntriesList.RemoveProperty(key);
- break;
- }
- }
- if(m_CacheEntriesList.GetShowAdvanced())
- {
- m_CacheEntriesList.ShowAdvanced();
- }
- else
- {
- m_CacheEntriesList.HideAdvanced();
- }
-
- m_OKButton.EnableWindow(false);
- if(cachem->GetSize() > 0 && !cmSystemTools::GetErrorOccuredFlag())
- {
- bool enable = true;
- items = m_CacheEntriesList.GetItems();
- for(std::set<CPropertyItem*>::iterator i = items.begin();
- i != items.end(); ++i)
- {
- CPropertyItem* item = *i;
- if(item->m_Advanced )
- {
- if(item->m_NewValue && m_CacheEntriesList.GetShowAdvanced())
- {
- enable = false;
- break;
- }
- }
- else
- {
- if(item->m_NewValue)
- {
- // if one new value then disable to OK button
- enable = false;
- break;
- }
- }
- }
- if(enable)
- {
- m_OKButton.EnableWindow(true);
- }
- }
-
- // redraw the list
- m_CacheEntriesList.SetTopIndex(0);
- m_CacheEntriesList.Invalidate();
-}
-
-// copy from the list box to the cache manager
-void CMakeSetupDialog::FillCacheManagerFromCacheGUI()
-{
- cmCacheManager *cachem = this->m_CMakeInstance->GetCacheManager();
- std::set<CPropertyItem*> items = m_CacheEntriesList.GetItems();
- cmCacheManager::CacheIterator it = cachem->NewIterator();
- for(std::set<CPropertyItem*>::iterator i = items.begin();
- i != items.end(); ++i)
- {
- CPropertyItem* item = *i;
- if ( it.Find((const char*)item->m_propName) )
- {
- // if value is enclosed in single quotes ('foo') then remove them
- // they were used to enforce the fact that it had 'invisible'
- // trailing stuff
- if (item->m_curValue.GetLength() >= 2 &&
- item->m_curValue[0] == '\'' &&
- item->m_curValue[item->m_curValue.GetLength() - 1] == '\'')
- {
- it.SetValue(item->m_curValue.Mid(
- 1, item->m_curValue.GetLength() - 2));
- }
- else
- {
- it.SetValue(item->m_curValue);
- }
- }
- }
-}
-
-
-
-//! Load cache file from m_WhereBuild and display in GUI editor
-void CMakeSetupDialog::LoadCacheFromDiskToGUI()
-{
- cmCacheManager *cachem = this->m_CMakeInstance->GetCacheManager();
- if(m_WhereBuild != "")
- {
- if (!cachem->LoadCache(m_WhereBuild))
- {
- // if it does exist, but isn;t readable then warn the user
- std::string cacheFile = m_WhereBuild;
- cacheFile += "/CMakeCache.txt";
- if(cmSystemTools::FileExists(cacheFile.c_str()))
- {
- cmSystemTools::Error("There is a CMakeCache.txt file for the current binary tree but cmake does not have permission to read it. Please check the permissions of the directory you are trying to run CMake on.");
- return;
- }
- }
- cmCacheManager::CacheIterator itm = cachem->NewIterator();
- if ( itm.Find("CMAKE_HOME_DIRECTORY"))
- {
- std::string path = ConvertToWindowsPath(itm.GetValue());
- this->m_WhereSource = path.c_str();
- this->m_WhereSourceControl.SetWindowText(this->m_WhereSource);
- this->OnChangeWhereSource();
- }
- m_CMakeInstance->SetHomeDirectory(m_WhereSource);
- m_CMakeInstance->SetStartDirectory(m_WhereSource);
- m_CMakeInstance->SetHomeOutputDirectory(m_WhereBuild);
- m_CMakeInstance->SetStartOutputDirectory(m_WhereBuild);
- m_CMakeInstance->PreLoadCMakeFiles();
- this->FillCacheGUIFromCacheManager();
- cmCacheManager::CacheIterator it =
- cachem->GetCacheIterator("CMAKE_GENERATOR");
- if(!it.IsAtEnd())
- {
- m_GeneratorPicked = true;
- const char* extraGen = cachem->GetCacheValue("CMAKE_EXTRA_GENERATOR");
- std::string curGen = cmExternalMakefileProjectGenerator::
- CreateFullGeneratorName(it.GetValue(), extraGen);
-
- if(m_GeneratorDialog.m_GeneratorChoiceString != curGen.c_str())
- {
- m_GeneratorDialog.m_GeneratorChoiceString = curGen.c_str();
- this->UpdateData(FALSE);
- }
- }
- }
-}
-
-//! Save GUI values to cmCacheManager and then save to disk.
-void CMakeSetupDialog::SaveCacheFromGUI()
-{
- cmCacheManager *cachem = this->m_CMakeInstance->GetCacheManager();
- this->FillCacheManagerFromCacheGUI();
- if(m_WhereBuild != "")
- {
- cachem->SaveCache(m_WhereBuild);
- }
-}
-
-
-void CMakeSetupDialog::OnSize(UINT nType, int cx, int cy)
-{
- if (nType == SIZE_MINIMIZED)
- {
- CDialog::OnSize(nType, cx, cy);
- return;
- }
- if (m_oldCX == -1)
- {
- m_oldCX = cx;
- m_oldCY = cy;
- }
- int deltax = cx - m_oldCX;
- int deltay = cy - m_oldCY;
-
- m_oldCX = cx;
- m_oldCY = cy;
-
- CDialog::OnSize(nType, cx, cy);
-
- if (deltax == 0 && deltay == 0)
- {
- return;
- }
-
- if(m_CacheEntriesList.m_hWnd)
- {
- // get the original sizes/positions
- CRect cRect;
- m_AdvancedValuesControl.GetWindowRect(&cRect);
- this->ScreenToClient(&cRect);
- m_AdvancedValuesControl.SetWindowPos(&wndTop, cRect.left + deltax,
- cRect.top,
- 0, 0,
- SWP_NOCOPYBITS |
- SWP_NOSIZE | SWP_NOZORDER);
- m_SuppressDevWarningsControl.GetWindowRect(&cRect);
- this->ScreenToClient(&cRect);
- m_SuppressDevWarningsControl.SetWindowPos(&wndTop, cRect.left + deltax,
- cRect.top,
- 0, 0,
- SWP_NOCOPYBITS |
- SWP_NOSIZE | SWP_NOZORDER);
- m_BrowseSource.GetWindowRect(&cRect);
- this->ScreenToClient(&cRect);
- m_BrowseSource.SetWindowPos(&wndTop, cRect.left + deltax,
- cRect.top,
- 0, 0,
- SWP_NOCOPYBITS | SWP_NOSIZE | SWP_NOZORDER);
- m_BrowseBuild.GetWindowRect(&cRect);
- this->ScreenToClient(&cRect);
- m_BrowseBuild.SetWindowPos(&wndTop, cRect.left + deltax,
- cRect.top,
- 0, 0,
- SWP_NOCOPYBITS | SWP_NOSIZE | SWP_NOZORDER);
-
- m_WhereSourceControl.GetWindowRect(&cRect);
- m_WhereSourceControl.SetWindowPos(&wndTop, cRect.left, cRect.top,
- cRect.Width() + deltax,
- cRect.Height(),
- SWP_NOCOPYBITS |
- SWP_NOMOVE | SWP_NOZORDER);
- m_WhereBuildControl.GetWindowRect(&cRect);
- m_WhereBuildControl.SetWindowPos(&wndTop, cRect.left, cRect.top,
- cRect.Width() + deltax,
- cRect.Height(),
- SWP_NOCOPYBITS |
- SWP_NOMOVE | SWP_NOZORDER);
- m_ListFrame.GetWindowRect(&cRect);
- m_ListFrame.SetWindowPos(&wndTop, cRect.left, cRect.top,
- cRect.Width() + deltax,
- cRect.Height() + deltay,
- SWP_NOCOPYBITS | SWP_NOMOVE | SWP_NOZORDER);
- m_CacheEntriesList.GetWindowRect(&cRect);
- m_CacheEntriesList.SetWindowPos(&wndTop, cRect.left, cRect.top,
- cRect.Width() + deltax,
- cRect.Height() + deltay,
- SWP_NOCOPYBITS | SWP_NOMOVE | SWP_NOZORDER);
-
- m_StatusDisplay.GetWindowRect(&cRect);
- this->ScreenToClient(&cRect);
- m_StatusDisplay.SetWindowPos(&wndBottom, cRect.left,
- cRect.top + deltay,
- cRect.Width() + deltax, cRect.Height(),
- SWP_NOCOPYBITS);
-
- m_MouseHelp.GetWindowRect(&cRect);
- this->ScreenToClient(&cRect);
- m_MouseHelp.SetWindowPos(&wndTop, cRect.left ,
- cRect.top + deltay,
- cRect.Width() + deltax, cRect.Height(),
- SWP_NOCOPYBITS | SWP_NOZORDER);
-
- deltax = int(deltax + m_deltaXRemainder);
- m_deltaXRemainder = float(deltax%2);
-
-
- m_Configure.GetWindowRect(&cRect);
- this->ScreenToClient(&cRect);
- m_Configure.SetWindowPos(&wndTop, cRect.left + deltax/2,
- cRect.top + deltay,
- 0, 0,
- SWP_NOCOPYBITS | SWP_NOSIZE);
- m_CancelButton.GetWindowRect(&cRect);
- this->ScreenToClient(&cRect);
- m_CancelButton.SetWindowPos(&wndTop, cRect.left + deltax/2,
- cRect.top + deltay,
- 0, 0,
- SWP_NOCOPYBITS | SWP_NOSIZE);
- m_OKButton.GetWindowRect(&cRect);
- this->ScreenToClient(&cRect);
- m_OKButton.SetWindowPos(&wndTop, cRect.left + deltax/2,
- cRect.top + deltay,
- 0, 0,
- SWP_NOCOPYBITS | SWP_NOSIZE);
- m_DeleteButton.GetWindowRect(&cRect);
- this->ScreenToClient(&cRect);
- m_DeleteButton.SetWindowPos(&wndTop, cRect.left + deltax/2,
- cRect.top + deltay,
- 0, 0,
- SWP_NOCOPYBITS | SWP_NOSIZE);
- m_HelpButton.GetWindowRect(&cRect);
- this->ScreenToClient(&cRect);
- m_HelpButton.SetWindowPos(&wndTop, cRect.left + deltax/2,
- cRect.top + deltay,
- 0, 0,
- SWP_NOCOPYBITS | SWP_NOSIZE);
- }
-
-}
-
-
-void CMakeSetupDialog::OnGetMinMaxInfo( MINMAXINFO FAR* lpMMI )
-{
- lpMMI->ptMinTrackSize.x = 550;
- lpMMI->ptMinTrackSize.y = 272;
-}
-
-void CMakeSetupDialog::OnCancel()
-{
- if(m_RunningConfigure)
- {
- if(MessageBox("You are in the middle of a Configure.\n"
- "If you Cancel now the configure information will be lost.\n"
- "Are you sure you want to Cancel?", "Confirm Exit",
- MB_YESNO) == IDYES)
- {
- cmSystemTools::SetFatalErrorOccured();
- }
- return;
- }
- if(m_CacheEntriesList.IsDirty())
- {
- if(MessageBox("You have changed options but not rebuilt, "
- "are you sure you want to exit?", "Confirm Exit",
- MB_YESNO) == IDYES)
- {
- CDialog::OnOK();
- }
- }
- else
- {
- CDialog::OnOK();
- }
-}
-
-void CMakeSetupDialog::OnOk()
-{
- // enable error messages each time configure is pressed
- cmSystemTools::EnableMessages();
- m_CacheEntriesList.ClearDirty();
- this->RunCMake(true);
-
- // save the size of the dialog
-
-
- if (!(::GetKeyState(VK_SHIFT) & 0x1000))
- {
- CDialog::OnOK();
- }
-}
-
-// Create a shortcut on the desktop with the current Source/Build dir.
-int CMakeSetupDialog::CreateShortcut()
-{
- // Find the desktop folder and create the link name
-
- HKEY hKey;
- if(RegOpenKeyEx(HKEY_CURRENT_USER,
- "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders",
- 0, KEY_READ, &hKey) != ERROR_SUCCESS)
- {
- AfxMessageBox ("Create shortcut: unable to find 'Shell Folders' key in registry!");
- return 1;
- }
-
- DWORD dwType, dwSize;
-#define MAXPATH 1024
- char link_name[MAXPATH];
- dwSize = MAXPATH;
- if(RegQueryValueEx(hKey,
- (LPCTSTR)"Desktop",
- NULL,
- &dwType,
- (BYTE *)link_name,
- &dwSize) != ERROR_SUCCESS)
- {
- AfxMessageBox ("Create shortcut: unable to find 'Desktop' registry value in 'Shell Folders' key!");
- return 1;
- }
-
- if(dwType != REG_SZ)
- {
- AfxMessageBox ("Create shortcut: 'Desktop' registry value in 'Shell Folders' key has wrong type!");
- return 1;
- }
-
- strcat(link_name, "\\CMake - ");
- std::string current_dir = cmSystemTools::GetFilenameName((LPCTSTR)m_WhereSource);
- strcat(link_name, current_dir.c_str());
- strcat(link_name, ".lnk");
-
- // Find the path to the current executable
-
- char path_to_current_exe[MAXPATH];
- ::GetModuleFileName(NULL, path_to_current_exe, MAXPATH);
-
- // Create the shortcut
-
- HRESULT hres;
- IShellLink *psl;
-
- // Initialize the COM library
-
- hres = CoInitialize(NULL);
-
- if (! SUCCEEDED (hres))
- {
- AfxMessageBox ("Create shortcut: unable to initialize the COM library!");
- return 1;
- }
-
- // Create an IShellLink object and get a pointer to the IShellLink
- // interface (returned from CoCreateInstance).
-
- hres = CoCreateInstance(CLSID_ShellLink,
- NULL,
- CLSCTX_INPROC_SERVER,
- IID_IShellLink,
- (void **)&psl);
-
- if (! SUCCEEDED (hres))
- {
- AfxMessageBox ("Create shortcut: unable to create IShellLink instance!");
- return 1;
- }
-
- IPersistFile *ppf;
-
- // Query IShellLink for the IPersistFile interface for
- // saving the shortcut in persistent storage.
-
- hres = psl->QueryInterface(IID_IPersistFile, (void **)&ppf);
-
- if (SUCCEEDED (hres))
- {
- // Set the path to the shortcut target.
- hres = psl->SetPath(path_to_current_exe);
-
- if (! SUCCEEDED (hres))
- {
- AfxMessageBox ("Create shortcut: SetPath failed!");
- }
-
- // Set the arguments of the shortcut.
- CString args = " /H=\"" + m_WhereSource + "\" /B=\"" + m_WhereBuild + "\" /G=\"" + m_GeneratorDialog.m_GeneratorChoiceString + "\" /A=\"" + (m_AdvancedValues ? "TRUE" : "FALSE") + "\"";
-
- hres = psl->SetArguments(args);
-
- if (! SUCCEEDED (hres))
- {
- AfxMessageBox ("Create shortcut: SetArguments failed!");
- }
-
- // Set the description of the shortcut.
- hres = psl->SetDescription("Shortcut to CMakeSetup");
-
- if (! SUCCEEDED (hres))
- {
- AfxMessageBox ("Create shortcut: SetDescription failed!");
- }
-
- // Ensure that the string consists of ANSI characters.
- WORD wszAr[MAX_PATH];
- LPWSTR wsz = (LPWSTR)wszAr;
- MultiByteToWideChar(CP_ACP, 0, link_name, -1, (LPWSTR)(wsz), MAX_PATH);
-
- // Save the shortcut via the IPersistFile::Save member function.
- hres = ppf->Save(wsz, TRUE);
-
- if (! SUCCEEDED (hres))
- {
- AfxMessageBox ("Create shortcut: Save failed!");
- }
-
- // Release the pointer to IPersistFile.
- ppf->Release ();
- }
- // Release the pointer to IShellLink.
- psl->Release ();
-
- return 0;
-}
-
-void CMakeSetupDialog::OnHelpButton()
-{
- CMakeHelp dialog;
- dialog.DoModal();
-}
-
-void CMakeSetupDialog::OnDeleteButton()
-{
- std::string message = "Are you sure you want to delete the CMakeCache.txt file for:\n";
- message += m_WhereBuild;
- if(::MessageBox(0, message.c_str(), "Delete Cache?",
- MB_YESNO|MB_TASKMODAL) == IDNO)
- {
- return;
- }
- m_GeneratorPicked = false;
-
- if(m_WhereBuild != "" && this->m_CMakeInstance)
- {
- this->m_CMakeInstance->GetCacheManager()->DeleteCache(m_WhereBuild);
- }
-
- // Make sure we are working from the cache on disk
- this->LoadCacheFromDiskToGUI();
-
- m_OKButton.EnableWindow(false);
-}
-
-void CMakeSetupDialog::ShowAdvancedValues()
-{
- m_CacheEntriesList.ShowAdvanced();
-}
-
-void CMakeSetupDialog::RemoveAdvancedValues()
-{
- m_CacheEntriesList.HideAdvanced();
-}
-
-
-void CMakeSetupDialog::OnSuppressDevValue()
-{
-}
-
-void CMakeSetupDialog::OnDoubleclickedSuppressDevValue()
-{
- this->OnSuppressDevValue();
-}
-
-void CMakeSetupDialog::OnAdvancedValues()
-{
- this->UpdateData();
- if(m_AdvancedValues)
- {
- this->ShowAdvancedValues();
- }
- else
- {
- this->RemoveAdvancedValues();
- }
-}
-
-void CMakeSetupDialog::OnDoubleclickedAdvancedValues()
-{
- this->OnAdvancedValues();
-}
-
-// Handle param or single dropped file.
-void CMakeSetupDialog::ChangeDirectoriesFromFile(const char* arg)
-{
- // Check if the argument refers to a CMakeCache.txt or
- // CMakeLists.txt file.
- std::string listPath;
- std::string cachePath;
- bool argIsFile = false;
- if(cmSystemTools::FileIsDirectory(arg))
- {
- std::string path = cmSystemTools::CollapseFullPath(arg);
- cmSystemTools::ConvertToUnixSlashes(path);
- std::string cacheFile = path;
- cacheFile += "/CMakeCache.txt";
- std::string listFile = path;
- listFile += "/CMakeLists.txt";
- if(cmSystemTools::FileExists(cacheFile.c_str()))
- {
- cachePath = path;
- }
- if(cmSystemTools::FileExists(listFile.c_str()))
- {
- listPath = path;
- }
- }
- else if(cmSystemTools::FileExists(arg))
- {
- argIsFile = true;
- std::string fullPath = cmSystemTools::CollapseFullPath(arg);
- std::string name = cmSystemTools::GetFilenameName(fullPath.c_str());
- name = cmSystemTools::LowerCase(name);
- if(name == "cmakecache.txt")
- {
- cachePath = cmSystemTools::GetFilenamePath(fullPath.c_str());
- }
- else if(name == "cmakelists.txt")
- {
- listPath = cmSystemTools::GetFilenamePath(fullPath.c_str());
- }
- }
-
- // If there is a CMakeCache.txt file, use its settings.
- if(cachePath.length() > 0)
- {
- cmCacheManager* cachem = m_CMakeInstance->GetCacheManager();
- cmCacheManager::CacheIterator it = cachem->NewIterator();
- if(cachem->LoadCache(cachePath.c_str()) && it.Find("CMAKE_HOME_DIRECTORY"))
- {
- std::string path = ConvertToWindowsPath(cachePath.c_str());
- m_WhereBuild = path.c_str();
-
- path = ConvertToWindowsPath(it.GetValue());
- m_WhereSource = path.c_str();
-
- m_GeneratorDialog.m_GeneratorChoiceString = _T("");
- return;
- }
- }
-
- // If there is a CMakeLists.txt file, use it as the source tree.
- if(listPath.length() > 0)
- {
- std::string path = ConvertToWindowsPath(listPath.c_str());
- m_WhereSource = path.c_str();
-
- if(argIsFile)
- {
- // Source CMakeLists.txt file given. It was probably dropped
- // onto the window or executable. Default to an in-source
- // build.
- m_WhereBuild = path.c_str();
- }
- else
- {
- // Source directory given on command line. Use current working
- // directory as build tree.
- std::string cwd = cmSystemTools::GetCurrentWorkingDirectory();
- path = ConvertToWindowsPath(cwd.c_str());
- m_WhereBuild = path.c_str();
- }
- }
-}
-
-
-// The framework calls this member function when the user releases the
-// left mouse button over a window that has registered itself as the
-// recipient of dropped files.
-
-void CMakeSetupDialog::OnDropFiles(HDROP hDropInfo)
-{
- UINT nb_files = DragQueryFile(hDropInfo, 0xFFFFFFFF, NULL, 0);
- if (nb_files > 0)
- {
- UINT buffer_size = DragQueryFile(hDropInfo, 0, NULL, 0);
- char *buffer = new char [buffer_size + 1];
- DragQueryFile(hDropInfo, 0, buffer, buffer_size + 1);
-
- this->ChangeDirectoriesFromFile(buffer);
- delete [] buffer;
-
- this->m_WhereSourceControl.SetWindowText(this->m_WhereSource);
- this->m_WhereBuildControl.SetWindowText(this->m_WhereBuild);
-
- this->UpdateData(FALSE);
-
- this->OnChangeWhereSource();
- this->OnChangeWhereBuild();
- }
-
- DragFinish(hDropInfo);
-}
-
-BOOL CMakeSetupDialog::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
-{
- CDialog::OnSetCursor(pWnd, nHitTest, message);
- if(m_Cursor == LoadCursor(NULL, IDC_WAIT))
- {
- ::SetCursor(m_Cursor);
- }
- return true;
-}
diff --git a/Source/MFCDialog/CMakeSetupDialog.h b/Source/MFCDialog/CMakeSetupDialog.h
deleted file mode 100644
index d20a765..0000000
--- a/Source/MFCDialog/CMakeSetupDialog.h
+++ /dev/null
@@ -1,152 +0,0 @@
-/*=========================================================================
-
-Program: CMake - Cross-Platform Makefile Generator
-Module: $RCSfile$
-Language: C++
-Date: $Date$
-Version: $Revision$
-
-Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
-See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
-
-This software is distributed WITHOUT ANY WARRANTY; without even
-the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the above copyright notices for more information.
-
-=========================================================================*/
-// CMakeSetupDialogDlg.h : header file
-//
-
-#if !defined(AFX_CMakeSetupDialogDLG_H__AC17A6F6_4634_11D4_8F21_00A0CC33FCD3__INCLUDED_)
-#define AFX_CMakeSetupDialogDLG_H__AC17A6F6_4634_11D4_8F21_00A0CC33FCD3__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-
-#include "PropertyList.h"
-#include "CMakeGenDialog.h"
-
-/////////////////////////////////////////////////////////////////////////////
-// CMakeSetupDialog dialog
-
-class CMakeCommandLineInfo;
-class cmake;
-
-class CMakeSetupDialog : public CDialog
-{
-// Construction
-public:
- CMakeSetupDialog(const CMakeCommandLineInfo& cmdInfo,
- CWnd* pParent = NULL);
-
- ~CMakeSetupDialog();
- // return the cmake that is currently being used
- cmake *GetCMakeInstance() {
- return m_CMakeInstance; }
-protected:
- //! Load cache file from m_WhereBuild and display in GUI editor
- void LoadCacheFromDiskToGUI();
- //! Save GUI values to cmCacheManager and then save to disk.
- void SaveCacheFromGUI();
- void SaveToRegistry();
- void LoadFromRegistry();
- bool Browse(CString&, const char* title);
- void ReadRegistryValue(HKEY hKey,
- CString *val,
- const char *key,
- const char *aadefault);
- void ShowAdvancedValues();
- void RemoveAdvancedValues();
- // Dialog Data
- //{{AFX_DATA(CMakeSetupDialog)
- enum { IDD = IDD_CMakeSetupDialog_DIALOG };
- CButton m_AdvancedValuesControl;
- CButton m_SuppressDevWarningsControl;
- CButton m_BrowseSource;
- CButton m_BrowseBuild;
- CButton m_HelpButton;
- CButton m_DeleteButton;
- CButton m_OKButton;
- CButton m_CancelButton;
- CString m_WhereSource;
- CString m_WhereBuild;
- CButton m_ListFrame;
- bool m_BuildPathChanged;
- CComboBox m_WhereSourceControl;
- CComboBox m_WhereBuildControl;
- CPropertyList m_CacheEntriesList;
- CStatic m_MouseHelp;
- CStatic m_StatusDisplay;
- CButton m_Configure;
- BOOL m_AdvancedValues;
- BOOL m_SuppressDevValue;
- //}}AFX_DATA
-
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CMakeSetupDialog)
-protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- //}}AFX_VIRTUAL
-
-// Implementation
-protected:
- void RunCMake(bool generateProjectFiles);
- // copy from the cache manager to the cache edit list box
- void FillCacheGUIFromCacheManager();
- // copy from the list box to the cache manager
- void FillCacheManagerFromCacheGUI();
- // Create a shortcut on the desktop with the current Source/Build dir.
- int CreateShortcut();
-
- // Set initial directories from a file path.
- void ChangeDirectoriesFromFile(const char* arg);
-
- HICON m_hIcon;
- CString m_RegistryKey;
- CString m_PathToExecutable;
- // Generated message map functions
- //{{AFX_MSG(CMakeSetupDialog)
- virtual BOOL OnInitDialog();
- afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
- afx_msg void OnCancel();
- afx_msg void OnPaint();
- afx_msg HCURSOR OnQueryDragIcon();
- afx_msg void OnBrowseWhereSource();
- virtual void OnConfigure();
- afx_msg void OnBrowseWhereBuild();
- afx_msg void OnChangeWhereBuild();
- afx_msg void OnSelendokWhereBuild();
- afx_msg void OnChangeWhereSource();
- afx_msg void OnSelendokWhereSource();
- afx_msg void OnSize(UINT nType, int cx, int cy);
- afx_msg void OnGetMinMaxInfo( MINMAXINFO FAR* lpMMI );
- afx_msg void OnOk();
- afx_msg void OnHelpButton();
- afx_msg void OnDeleteButton();
- afx_msg void OnAdvancedValues();
- afx_msg void OnDoubleclickedAdvancedValues();
- afx_msg void OnSuppressDevValue();
- afx_msg void OnDoubleclickedSuppressDevValue();
- afx_msg void OnDropFiles(HDROP);
- afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-
- int m_oldCX;
- int m_oldCY;
- float m_deltaXRemainder;
- cmake *m_CMakeInstance;
- HCURSOR m_Cursor;
- bool m_RunningConfigure;
- bool m_GeneratorPicked;
-
- CCMakeGenDialog m_GeneratorDialog;
-
-};
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_CMakeSetupDialogDLG_H__AC17A6F6_4634_11D4_8F21_00A0CC33FCD3__INCLUDED_)
diff --git a/Source/MFCDialog/CMakeSetupManifest.xml b/Source/MFCDialog/CMakeSetupManifest.xml
deleted file mode 100644
index 1a662f3..0000000
--- a/Source/MFCDialog/CMakeSetupManifest.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
-<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
- <security>
- <requestedPrivileges>
- <requestedExecutionLevel level="asInvoker"/>
- </requestedPrivileges>
- </security>
-</trustInfo>
-</assembly>
diff --git a/Source/MFCDialog/MakeHelp.cpp b/Source/MFCDialog/MakeHelp.cpp
deleted file mode 100644
index 53ee3ee..0000000
--- a/Source/MFCDialog/MakeHelp.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-// MakeHelp.cpp : implementation file
-//
-
-#include "stdafx.h"
-#include "CMakeSetup.h"
-#include "MakeHelp.h"
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-// CMakeHelp dialog
-
-
-CMakeHelp::CMakeHelp(CWnd* pParent /*=NULL*/)
- : CDialog(CMakeHelp::IDD, pParent)
-{
- //{{AFX_DATA_INIT(CMakeHelp)
- m_HelpMessage = _T("CMake is used to configure and generate build files for software projects. The basic steps for configuring a project are as follows:\r\n\r\n1. Select the source directory for the project. This should contain the CMakeLists.txt files for the project.\r\n\r\n2. Select the build directory for the project. This is the directory where the project will be built. It can be the same or a different directory than the source directory. For easy clean up, a separate build directory is recommended. CMake will create the directory if it does not exist.\r\n\r\n3. Once the source and binary directories are selected, it is time to press the Configure button. This will cause CMake to read all of the input files and discover all the variables used by the project. The first time a variable is displayed it will be in Red. Users should inspect red variables making sure the values are correct. For some projects the Configure process can be iterative, so continue to press the Configure button until there are no longer red entries.\r\n\r\n4. Once there are no longer red entries, you should click the OK button. This will write the build files to the build directory and exit CMake.");
- //}}AFX_DATA_INIT
-}
-
-
-void CMakeHelp::DoDataExchange(CDataExchange* pDX)
-{
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CMakeHelp)
- DDX_Text(pDX, IDC_EDIT1, m_HelpMessage);
- //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(CMakeHelp, CDialog)
- //{{AFX_MSG_MAP(CMakeHelp)
- // NOTE: the ClassWizard will add message map macros here
- //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// CMakeHelp message handlers
diff --git a/Source/MFCDialog/MakeHelp.h b/Source/MFCDialog/MakeHelp.h
deleted file mode 100644
index 3d9ac0f..0000000
--- a/Source/MFCDialog/MakeHelp.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*=========================================================================
-
- Program: CMake - Cross-Platform Makefile Generator
- Module: $RCSfile$
- Language: C++
- Date: $Date$
- Version: $Revision$
-
- Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
- See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
-
- This software is distributed WITHOUT ANY WARRANTY; without even
- the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- PURPOSE. See the above copyright notices for more information.
-
-=========================================================================*/
-#if !defined(AFX_MAKEHELP_H__DD327AED_1E65_43E8_A605_0933065D1757__INCLUDED_)
-#define AFX_MAKEHELP_H__DD327AED_1E65_43E8_A605_0933065D1757__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-// MakeHelp.h : header file
-//
-
-/////////////////////////////////////////////////////////////////////////////
-// CMakeHelp dialog
-
-class CMakeHelp : public CDialog
-{
-// Construction
-public:
- CMakeHelp(CWnd* pParent = NULL); // standard constructor
-
-// Dialog Data
- //{{AFX_DATA(CMakeHelp)
- enum { IDD = IDD_CMAKE_HELP_DIALOG };
- CString m_HelpMessage;
- //}}AFX_DATA
-
-
-// Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CMakeHelp)
- protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
- // Generated message map functions
- //{{AFX_MSG(CMakeHelp)
- // NOTE: the ClassWizard will add member functions here
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-};
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_MAKEHELP_H__DD327AED_1E65_43E8_A605_0933065D1757__INCLUDED_)
diff --git a/Source/MFCDialog/PathDialog.cpp b/Source/MFCDialog/PathDialog.cpp
deleted file mode 100644
index d7bd427..0000000
--- a/Source/MFCDialog/PathDialog.cpp
+++ /dev/null
@@ -1,377 +0,0 @@
-//////////////////////////////////////////////////////////////////////////
-//PathDialog.h file
-//
-//Written by Nguyen Tan Hung <tanhung@yahoo.com>
-//////////////////////////////////////////////////////////////////////////
-
-#include "stdafx.h"
-#include "PathDialog.h"
-#include <io.h>
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-#define IDC_FOLDERTREE 0x3741
-#define IDC_TITLE 0x3742
-#define IDC_STATUSTEXT 0x3743
-
-#define IDC_NEW_EDIT_PATH 0x3744
-
-// Class CDlgWnd
-BEGIN_MESSAGE_MAP(CPathDialogSub, CWnd)
- ON_BN_CLICKED(IDOK, OnOK)
- ON_EN_CHANGE(IDC_NEW_EDIT_PATH, OnChangeEditPath)
- END_MESSAGE_MAP()
-
- void CPathDialogSub::OnOK()
-{
- ::GetWindowText(::GetDlgItem(m_hWnd, IDC_NEW_EDIT_PATH),
- m_pPathDialog->m_szPathName, MAX_PATH);
-
- if(CPathDialog::MakeSurePathExists(m_pPathDialog->m_szPathName)==0)
- {
- m_pPathDialog->m_bGetSuccess=TRUE;
- ::EndDialog(m_pPathDialog->m_hWnd, IDOK);
- }
- else
- {
- ::SetFocus(::GetDlgItem(m_hWnd, IDC_NEW_EDIT_PATH));
- }
-}
-
-void CPathDialogSub::OnChangeEditPath()
-{
- ::GetWindowText(::GetDlgItem(m_hWnd, IDC_NEW_EDIT_PATH),
- m_pPathDialog->m_szPathName, MAX_PATH);
- BOOL bEnableOKButton = (_tcslen(m_pPathDialog->m_szPathName)>0);
- SendMessage(BFFM_ENABLEOK, 0, bEnableOKButton);
-}
-/////////////////////////////////////////////////////////////////////////////
-// CPathDialog dialog
-
-
-CPathDialog::CPathDialog(LPCTSTR lpszCaption,
- LPCTSTR lpszTitle,
- LPCTSTR lpszInitialPath,
- CWnd* pParent)
-{
- m_hWnd=NULL;
- m_PathDialogSub.m_pPathDialog= this;
- m_bParentDisabled = FALSE;
-
- // Get the true parent of the dialog
- m_pParentWnd = CWnd::GetSafeOwner(pParent);
-
- m_lpszCaption = lpszCaption;
- m_lpszInitialPath = lpszInitialPath;
-
- memset(&m_bi, 0, sizeof(BROWSEINFO) );
- m_bi.hwndOwner = (m_pParentWnd==NULL)?NULL:m_pParentWnd->GetSafeHwnd();
- m_bi.pszDisplayName = 0;
- m_bi.pidlRoot = 0;
- m_bi.ulFlags = BIF_RETURNONLYFSDIRS | BIF_STATUSTEXT;
- m_bi.lpfn = BrowseCallbackProc;
- m_bi.lpszTitle = lpszTitle;
-}
-
-
-/////////////////////////////////////////////////////////////////////////////
-// CPathDialog message handlers
-
-CString CPathDialog::GetPathName()
-{
- return CString(m_szPathName);
-}
-
-int CALLBACK CPathDialog::BrowseCallbackProc(HWND hwnd,UINT uMsg,LPARAM lParam, LPARAM pData)
-{
- CPathDialog* pDlg = (CPathDialog*)pData;
-
- switch(uMsg)
- {
- case BFFM_INITIALIZED:
- {
- RECT rc;
- HWND hEdit;
- HFONT hFont;
-
- pDlg->m_hWnd = hwnd;
-
- if(pDlg->m_lpszCaption!=NULL)
- {
- ::SetWindowText(hwnd, pDlg->m_lpszCaption);
- }
-
- VERIFY(pDlg->m_PathDialogSub.SubclassWindow(hwnd));
- ::ShowWindow(::GetDlgItem(hwnd, IDC_STATUSTEXT), SW_HIDE);
- ::GetWindowRect(::GetDlgItem(hwnd, IDC_FOLDERTREE), &rc);
- rc.bottom = rc.top - 4;
- rc.top = rc.bottom - 23;
- ::ScreenToClient(hwnd, (LPPOINT)&rc);
- ::ScreenToClient(hwnd, ((LPPOINT)&rc)+1);
- hEdit = ::CreateWindowEx(WS_EX_CLIENTEDGE, _T("EDIT"), _T(""),
- WS_CHILD|WS_TABSTOP|WS_VISIBLE|ES_AUTOHSCROLL,
- rc.left, rc.top,
- rc.right-rc.left, rc.bottom-rc.top,
- hwnd, NULL, NULL, NULL);
- ::SetWindowLong(hEdit, GWL_ID, IDC_NEW_EDIT_PATH);
- ::ShowWindow(hEdit, SW_SHOW);
-
- hFont = (HFONT)::SendMessage(hwnd, WM_GETFONT, 0, 0);
- ::SendMessage(hEdit, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0));
-
- LPCTSTR lpszPath = pDlg->m_lpszInitialPath;
- TCHAR szTemp[MAX_PATH];
- if(lpszPath==NULL)
- {
- ::GetCurrentDirectory(MAX_PATH, szTemp );
- lpszPath = szTemp;
- }
- // WParam is TRUE since you are passing a path.
- // It would be FALSE if you were passing a pidl.
- ::SendMessage(hwnd,BFFM_SETSELECTION,TRUE,
- (LPARAM)lpszPath);
- break;
- }
- case BFFM_SELCHANGED:
- {
- char szSelection[MAX_PATH];
- if(!::SHGetPathFromIDList((LPITEMIDLIST)lParam, szSelection) ||
- (szSelection[1] !=':' && szSelection[1] != '\\'))
- {
- szSelection[0] = '\0';
- ::SendMessage(hwnd, BFFM_ENABLEOK, 0, FALSE);
- }
- else
- {
- ::SendMessage(hwnd, BFFM_ENABLEOK, 0, TRUE);
- }
- ::SendMessage(hwnd,BFFM_SETSTATUSTEXT,0,(LPARAM)szSelection);
- ::SetWindowText(::GetDlgItem(hwnd, IDC_NEW_EDIT_PATH), szSelection);
- break;
- }
- default:
- break;
- }
- return 0;
-}
-
-
-
-int CPathDialog::DoModal()
-{
-
- /////////////////////////////////////////////////////////
- TCHAR szPathTemp[MAX_PATH];
- m_bi.lpfn = BrowseCallbackProc; // address of callback function
- m_bi.lParam = (LPARAM)this; // pass address of object to callback function
- m_bi.pszDisplayName = szPathTemp;
-
- LPITEMIDLIST pidl;
- LPMALLOC pMalloc;
-
- int iResult=-1;
- if(SUCCEEDED(SHGetMalloc(&pMalloc)))
- {
- m_bGetSuccess = FALSE;
- pidl = SHBrowseForFolder(&m_bi);
- if (pidl!=NULL)
- {
-#if defined(_WIN64) && defined(__INTEL_COMPILER)
-# pragma warning ( disable : 167)
-#endif
- // In C++:
- pMalloc->Free(pidl);
- //In C:
- //pMalloc->lpVtbl->Free(pMalloc,pidl);
- //pMalloc->lpVtbl->Release(pMalloc);
- }
- if(m_bGetSuccess)
- {
- iResult = IDOK;
- }
- pMalloc->Release();
- }
-
- if(m_bParentDisabled && (m_pParentWnd!=NULL))
- {
- m_pParentWnd->EnableWindow(TRUE);
- }
- m_bParentDisabled=FALSE;
-
- return iResult;
-}
-
-BOOL CPathDialog::IsFileNameValid(LPCTSTR /* lpFileName */)
-{
- return TRUE;
-}
-
-const TCHAR c_FolderDoesNotExist[] = _T(
- "The folder:\n\n"
- "%s\n\n"
- "does not exist. Do you want the folder to be created?");
-const TCHAR c_szErrInvalidPath[] = _T(
- "The folder:"
- "\n\n"
- "%s\n\n"
- "is invalid. Please reenter.");
-const TCHAR c_szErrCreatePath[] = _T(
- "The folder:"
- "\n\n"
- "%s"
- "\n\ncan not be created. Please double check.");
-
-//return -1: user break;
-//return 0: no error
-//return 1: lpPath is invalid
-//return 2: can not create lpPath
-int CPathDialog::MakeSurePathExists(LPCTSTR lpPath)
-{
- CString strMsg;
- int iRet = -1;
- try
- {
- //validate path
- iRet=Touch(lpPath, TRUE);
- if(iRet!=0)
- {
- throw iRet;
- }
-
- if(_taccess(lpPath, 0)==0)
- {
- return (int)0;
- }
-
- strMsg.Format(c_FolderDoesNotExist, lpPath);
- if(AfxMessageBox(strMsg, MB_YESNO|MB_ICONQUESTION) == IDYES)
- {
- //create path
- iRet=Touch(lpPath, FALSE);
- if(iRet!=0)
- {
- throw iRet;
- }
- }
- return 0;
- }
- catch(int nErrCode)
- {
- switch(nErrCode)
- {
- case 1:
- strMsg.Format(c_szErrInvalidPath, lpPath);
- break;
- case 2:
- default:
- strMsg.Format(c_szErrCreatePath, lpPath);
- break;
- }
-
- AfxMessageBox(strMsg, MB_OK|MB_ICONEXCLAMATION);
- }
-
- return iRet;
-}
-
-//return 0: no error
-//return 1: lpPath is invalid
-//return 2: lpPath can not be created(bValidate==FALSE)
-int CPathDialog::Touch(LPCTSTR lpPath, BOOL bValidate)
-{
- if(lpPath==NULL)
- {
- return 1;
- }
-
- TCHAR szPath[MAX_PATH];
- _tcscpy(szPath, lpPath);
- size_t nLen = _tcslen(szPath);
-
- int i;
- if(nLen==3)
- {
- if(!bValidate)
- {
- if(_access(szPath, 0)!=0)
- {
- return 2;
- }
- }
- return 0;
- }
-
- i = 3;
- BOOL bLastOne=TRUE;
- LPTSTR lpCurrentName;
- while(szPath[i]!=0)
- {
- lpCurrentName = &szPath[i];
- while( (szPath[i]!=0) && (szPath[i]!=_T('\\')) )
- {
- i++;
- }
-
- bLastOne =(szPath[i]==0);
- szPath[i] = 0;
-
- if(!bValidate)
- {
- CreateDirectory(szPath, NULL);
- if(_taccess(szPath, 0)!=0)
- {
- return 2;
- }
- }
-
- if(bLastOne)
- {
- break; //it's done
- }
- else
- {
- szPath[i] = _T('\\');
- }
-
- i++;
- }
-
- return (bLastOne?0:1);
-}
-
-//return 0: ok
-//return 1: error
-int CPathDialog::ConcatPath(LPTSTR lpRoot, LPCTSTR lpMorePath)
-{
- if(lpRoot==NULL)
- {
- return 1;
- }
-
- size_t nLen = _tcslen(lpRoot);
-
- if(nLen<3)
- {
- return 1;
- }
-
- if(lpMorePath==NULL)
- {
- return 0;
- }
-
- if(nLen==3)
- {
- _tcscat(lpRoot, lpMorePath);
- return 0;
- }
-
- _tcscat(lpRoot, _T("\\"));
- _tcscat(lpRoot, lpMorePath);
-
- return 0;
-}
diff --git a/Source/MFCDialog/PathDialog.h b/Source/MFCDialog/PathDialog.h
deleted file mode 100644
index 4c8fed2..0000000
--- a/Source/MFCDialog/PathDialog.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*=========================================================================
-
- Program: CMake - Cross-Platform Makefile Generator
- Module: $RCSfile$
- Language: C++
- Date: $Date$
- Version: $Revision$
-
- Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
- See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
-
- This software is distributed WITHOUT ANY WARRANTY; without even
- the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- PURPOSE. See the above copyright notices for more information.
-
-=========================================================================*/
-//////////////////////////////////////////////////////////////////////////
-//PathDialog.h file
-//
-//Written by Nguyen Tan Hung <tanhung@yahoo.com>
-//////////////////////////////////////////////////////////////////////////
-
-#if !defined(AFX_PATHDIALOG_H__0F70BC86_11DB_11D4_B012_0000E8DD8DAA__INCLUDED_)
-#define AFX_PATHDIALOG_H__0F70BC86_11DB_11D4_B012_0000E8DD8DAA__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-// PathDialog.h : header file
-//
-#include "shlobj.h"
-
-class CPathDialog;
-
-// CPathDialogSub - intercepts messages from child controls
-class CPathDialogSub : public CWnd
-{
- friend CPathDialog;
-public:
- CPathDialog* m_pPathDialog;
-protected:
- afx_msg void OnOK(); // OK button clicked
- afx_msg void OnChangeEditPath();
- DECLARE_MESSAGE_MAP()
-private:
-};
-
-/////////////////////////////////////////////////////////////////////////////
-// CPathDialog dialog
-
-class CPathDialog
-{
- friend CPathDialogSub;
-// Construction
-public:
- CPathDialog(LPCTSTR lpszCaption=NULL,
- LPCTSTR lpszTitle=NULL,
- LPCTSTR lpszInitialPath=NULL,
- CWnd* pParent = NULL);
-
- CString GetPathName();
- virtual int DoModal();
-
- static int Touch(LPCTSTR lpPath, BOOL bValidate=TRUE);
- static int MakeSurePathExists(LPCTSTR lpPath);
- static BOOL IsFileNameValid(LPCTSTR lpFileName);
- static int ConcatPath(LPTSTR lpRoot, LPCTSTR lpMorePath);
-
-private:
- static int CALLBACK BrowseCallbackProc(HWND hwnd,UINT uMsg,LPARAM lParam, LPARAM pData);
-
- LPCTSTR m_lpszCaption;
- LPCTSTR m_lpszInitialPath;
-
- TCHAR m_szPathName[MAX_PATH];
-
- BROWSEINFO m_bi;
- HWND m_hWnd;
- CWnd* m_pParentWnd;
- BOOL m_bParentDisabled;
- BOOL m_bGetSuccess;
-
- CPathDialogSub m_PathDialogSub;
-
-};
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_PATHDIALOG_H__0F70BC86_11DB_11D4_B012_0000E8DD8DAA__INCLUDED_)
diff --git a/Source/MFCDialog/PropertyList.cpp b/Source/MFCDialog/PropertyList.cpp
deleted file mode 100644
index e316451..0000000
--- a/Source/MFCDialog/PropertyList.cpp
+++ /dev/null
@@ -1,847 +0,0 @@
-// PropertyList.cpp : implementation file
-//
-
-#include "stdafx.h"
-#include "shellapi.h"
-#include "CMakeSetup.h"
-#include "CMakeSetupDialog.h"
-#include "PathDialog.h"
-#include "../cmCacheManager.h"
-#include "../cmSystemTools.h"
-#include "../cmake.h"
-#define IDC_PROPCMBBOX 712
-#define IDC_PROPEDITBOX 713
-#define IDC_PROPBTNCTRL 714
-#define IDC_PROPCHECKBOXCTRL 715
-
-/////////////////////////////////////////////////////////////////////////////
-// CPropertyList
-
-CPropertyList::CPropertyList()
-{
- m_Dirty = false;
- m_ShowAdvanced = false;
- m_curSel = -1;
-}
-
-CPropertyList::~CPropertyList()
-{
- for(std::set<CPropertyItem*>::iterator i = m_PropertyItems.begin();
- i != m_PropertyItems.end(); ++i)
- {
- delete *i;
- }
-}
-
-
-BEGIN_MESSAGE_MAP(CPropertyList, CListBox)
- //{{AFX_MSG_MAP(CPropertyList)
- ON_WM_CREATE()
- ON_WM_VSCROLL()
- ON_CONTROL_REFLECT(LBN_SELCHANGE, OnSelchange)
- ON_WM_LBUTTONUP()
- ON_WM_KILLFOCUS()
- ON_WM_LBUTTONDOWN()
- ON_WM_RBUTTONUP()
- ON_WM_MOUSEMOVE()
- //}}AFX_MSG_MAP
- ON_CBN_KILLFOCUS(IDC_PROPCMBBOX, OnKillfocusCmbBox)
- ON_CBN_SELCHANGE(IDC_PROPCMBBOX, OnSelchangeCmbBox)
- ON_EN_KILLFOCUS(IDC_PROPEDITBOX, OnKillfocusEditBox)
- ON_EN_CHANGE(IDC_PROPEDITBOX, OnChangeEditBox)
- ON_BN_CLICKED(IDC_PROPBTNCTRL, OnButton)
- ON_BN_CLICKED(IDC_PROPCHECKBOXCTRL, OnCheckBox)
- ON_COMMAND(42, OnDelete)
- ON_COMMAND(43, OnHelp)
- ON_COMMAND(44, OnIgnore)
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// CPropertyList message handlers
-
-BOOL CPropertyList::PreCreateWindow(CREATESTRUCT& cs)
-{
- if (!CListBox::PreCreateWindow(cs))
- return FALSE;
-
- cs.style &= ~(LBS_OWNERDRAWVARIABLE | LBS_SORT);
- cs.style |= LBS_OWNERDRAWFIXED;
-
- m_bTracking = FALSE;
- m_nDivider = 0;
- m_bDivIsSet = FALSE;
-
- return TRUE;
-}
-
-void CPropertyList::MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct)
-{
- lpMeasureItemStruct->itemHeight = 20; //pixels
-}
-
-
-void CPropertyList::DrawItem(LPDRAWITEMSTRUCT lpDIS)
-{
- CDC dc;
- dc.Attach(lpDIS->hDC);
- CRect rectFull = lpDIS->rcItem;
- CRect rect = rectFull;
- if (m_nDivider==0)
- m_nDivider = rect.Width() / 2;
- rect.left = m_nDivider;
- CRect rect2 = rectFull;
- rect2.right = rect.left - 1;
- UINT nIndex = lpDIS->itemID;
-
- if (nIndex != (UINT) -1)
- {
- //get the CPropertyItem for the current row
- CPropertyItem* pItem = (CPropertyItem*) GetItemDataPtr(nIndex);
- //draw two rectangles, one for each row column
- if(pItem->m_NewValue)
- {
- dc.FillSolidRect(rect2,RGB(255,100, 100));
- }
- else
- {
- dc.FillSolidRect(rect2,RGB(192,192,192));
- }
-
- dc.DrawEdge(rect2,EDGE_SUNKEN,BF_BOTTOMRIGHT);
- dc.DrawEdge(rect,EDGE_SUNKEN,BF_BOTTOM);
-
-
- //write the property name in the first rectangle
- dc.SetBkMode(TRANSPARENT);
- dc.DrawText(pItem->m_propName,CRect(rect2.left+3,rect2.top+3,
- rect2.right-3,rect2.bottom+3),
- DT_LEFT | DT_SINGLELINE);
-
- //write the initial property value in the second rectangle
- dc.DrawText(pItem->m_curValue,CRect(rect.left+3,rect.top+3,
- rect.right+3,rect.bottom+3),
- DT_LEFT | DT_SINGLELINE);
- }
- dc.Detach();
-}
-
-int CPropertyList::AddItem(CString txt)
-{
- int nIndex = AddString(txt);
- return nIndex;
-}
-// order = 0 sorted
-// order = 1 add to top
-// order = 2 add to bottom
-int CPropertyList::AddPropItem(CPropertyItem* pItem, int order)
-{
- if(pItem->m_Advanced && ! m_ShowAdvanced)
- {
- m_PropertyItems.insert(pItem);
- return 0;
- }
- this->HideControls();
- int nIndex;
- if(order)
- {
- if(order == 1)
- {
- order = 0;
- }
- if(order == 2)
- {
- order = -1;
- }
- nIndex = InsertString(order, _T(""));
- }
- else
- {
- nIndex = AddString(pItem->m_propName);
- }
- SetItemDataPtr(nIndex,pItem);
- m_PropertyItems.insert(pItem);
- return nIndex;
-}
-
-void CPropertyList::AddProperty(const char* name,
- const char* value,
- const char* helpString,
- int type,
- const char* comboItems,
- bool reverseOrder,
- bool advanced)
-{
- CPropertyItem* pItem = 0;
- for(std::set<CPropertyItem*>::iterator i = m_PropertyItems.begin();
- i != m_PropertyItems.end(); ++i)
- {
- CPropertyItem* item = *i;
- if(item->m_propName == name)
- {
- pItem = item;
- if(pItem->m_curValue != value)
- {
- pItem->m_curValue = value;
- pItem->m_HelpString = helpString;
- InvalidateList();
- }
- pItem->m_Advanced = advanced;
- return;
- }
- }
- // if it is not found, then create a new one
- if(!pItem)
- {
- pItem = new CPropertyItem(name, value, helpString, type, comboItems);
- pItem->m_NewValue = true;
- }
- pItem->m_Advanced = advanced;
- int order = 0;
- if(reverseOrder)
- {
- order = 1;
- }
- this->AddPropItem(pItem, order);
- return;
-}
-
-int CPropertyList::OnCreate(LPCREATESTRUCT lpCreateStruct)
-{
- if (CListBox::OnCreate(lpCreateStruct) == -1)
- return -1;
-
- m_bDivIsSet = FALSE;
- m_nDivider = 0;
- m_bTracking = FALSE;
-
- m_hCursorSize = AfxGetApp()->LoadStandardCursor(IDC_SIZEWE);
- m_hCursorArrow = AfxGetApp()->LoadStandardCursor(IDC_ARROW);
-
- m_SSerif8Font.CreatePointFont(80,_T("MS Sans Serif"));
-
- return 0;
-}
-
-void CPropertyList::OnSelchange()
-{
- CRect rect;
- CString lBoxSelText;
-
- GetItemRect(m_curSel,rect);
- rect.left = m_nDivider;
-
- CPropertyItem* pItem = (CPropertyItem*) GetItemDataPtr(m_curSel);
-
- if (m_btnCtrl)
- m_btnCtrl.ShowWindow(SW_HIDE);
- if (m_CheckBoxControl)
- m_CheckBoxControl.ShowWindow(SW_HIDE);
-
- if (pItem->m_nItemType==CPropertyList::COMBO)
- {
- //display the combo box. If the combo box has already been
- //created then simply move it to the new location, else create it
- m_nLastBox = 0;
- if (m_cmbBox)
- m_cmbBox.MoveWindow(rect);
- else
- {
- rect.bottom += 100;
- m_cmbBox.Create(CBS_DROPDOWNLIST
- | CBS_NOINTEGRALHEIGHT | WS_VISIBLE
- | WS_CHILD | WS_BORDER,
- rect,this,IDC_PROPCMBBOX);
- m_cmbBox.SetFont(&m_SSerif8Font);
- }
-
- //add the choices for this particular property
- CString cmbItems = pItem->m_cmbItems;
- lBoxSelText = pItem->m_curValue;
-
- m_cmbBox.ResetContent();
- int i,i2;
- i=0;
- while ((i2=cmbItems.Find('|',i)) != -1)
- {
- m_cmbBox.AddString(cmbItems.Mid(i,i2-i));
- i=i2+1;
- }
- if(i != 0)
- m_cmbBox.AddString(cmbItems.Mid(i));
-
- m_cmbBox.ShowWindow(SW_SHOW);
- m_cmbBox.SetFocus();
-
- //jump to the property's current value in the combo box
- int j = m_cmbBox.FindStringExact(0,lBoxSelText);
- if (j != CB_ERR)
- m_cmbBox.SetCurSel(j);
- else
- m_cmbBox.SetCurSel(0);
- }
- else if (pItem->m_nItemType==CPropertyList::EDIT)
- {
- //display edit box
- m_nLastBox = 1;
- m_prevSel = m_curSel;
- rect.bottom -= 3;
- if (m_editBox)
- m_editBox.MoveWindow(rect);
- else
- {
- m_editBox.Create(ES_LEFT | ES_AUTOHSCROLL | WS_VISIBLE
- | WS_CHILD | WS_BORDER,
- rect,this,IDC_PROPEDITBOX);
- m_editBox.SetFont(&m_SSerif8Font);
- }
-
- lBoxSelText = pItem->m_curValue;
-
- m_editBox.ShowWindow(SW_SHOW);
- m_editBox.SetFocus();
- //set the text in the edit box to the property's current value
- m_editBox.SetWindowText(lBoxSelText);
- }
- else if (pItem->m_nItemType == CPropertyList::CHECKBOX)
- {
- rect.bottom -= 3;
- if (m_CheckBoxControl)
- m_CheckBoxControl.MoveWindow(rect);
- else
- {
- m_CheckBoxControl.Create("check",BS_CHECKBOX
- | BM_SETCHECK |BS_LEFTTEXT
- | WS_VISIBLE | WS_CHILD,
- rect,this,IDC_PROPCHECKBOXCTRL);
- m_CheckBoxControl.SetFont(&m_SSerif8Font);
- }
-
- lBoxSelText = pItem->m_curValue;
-
- m_CheckBoxControl.ShowWindow(SW_SHOW);
- m_CheckBoxControl.SetFocus();
- //set the text in the edit box to the property's current value
- if(lBoxSelText == "ON")
- {
- m_CheckBoxControl.SetCheck(1);
- }
- else
- {
- m_CheckBoxControl.SetCheck(0);
- }
- }
-
- else
- {
- DisplayButton(rect);
- m_nLastBox = 1;
- m_prevSel = m_curSel;
- rect.bottom -= 3;
- rect.right -= 25;
- if (m_editBox)
- {
- m_editBox.MoveWindow(rect);
- }
- else
- {
- m_editBox.Create(ES_LEFT | ES_AUTOHSCROLL | WS_VISIBLE
- | WS_CHILD | WS_BORDER,
- rect,this,IDC_PROPEDITBOX);
- m_editBox.SetFont(&m_SSerif8Font);
- }
-
- lBoxSelText = pItem->m_curValue;
-
- m_editBox.ShowWindow(SW_SHOW);
- m_editBox.SetFocus();
- //set the text in the edit box to the property's current value
- m_editBox.SetWindowText(lBoxSelText);
- }
-}
-
-void CPropertyList::DisplayButton(CRect region)
-{
- //displays a button if the property is a file/color/font chooser
- m_nLastBox = 2;
- m_prevSel = m_curSel;
-
- if (region.Width() > 25)
- region.left = region.right - 25;
- region.bottom -= 3;
-
- if (m_btnCtrl)
- m_btnCtrl.MoveWindow(region);
- else
- {
- m_btnCtrl.Create("...",BS_PUSHBUTTON | WS_VISIBLE | WS_CHILD,
- region,this,IDC_PROPBTNCTRL);
- m_btnCtrl.SetFont(&m_SSerif8Font);
- }
-
- m_btnCtrl.ShowWindow(SW_SHOW);
- m_btnCtrl.SetFocus();
-}
-
-void CPropertyList::OnKillFocus(CWnd* pNewWnd)
-{
- //m_btnCtrl.ShowWindow(SW_HIDE);
-
- CListBox::OnKillFocus(pNewWnd);
-}
-
-void CPropertyList::OnKillfocusCmbBox()
-{
- m_cmbBox.ShowWindow(SW_HIDE);
-
- Invalidate();
-}
-
-void CPropertyList::OnKillfocusEditBox()
-{
- CString newStr;
- m_editBox.ShowWindow(SW_HIDE);
-
- Invalidate();
-}
-
-void CPropertyList::OnSelchangeCmbBox()
-{
- CString selStr;
- if (m_cmbBox)
- {
- m_cmbBox.GetLBText(m_cmbBox.GetCurSel(),selStr);
- CPropertyItem* pItem = (CPropertyItem*) GetItemDataPtr(m_curSel);
- pItem->m_curValue = selStr;
- m_Dirty = true;
- }
-}
-
-void CPropertyList::OnChangeEditBox()
-{
- CString newStr;
- m_editBox.GetWindowText(newStr);
-
- CPropertyItem* pItem = (CPropertyItem*) GetItemDataPtr(m_curSel);
- if(pItem->m_curValue != newStr)
- {
- pItem->m_curValue = newStr;
- m_Dirty = true;
- }
-}
-
-void CPropertyList::HideControls()
-{
- if(m_editBox)
- {
- m_editBox.ShowWindow(SW_HIDE);
- }
- if(m_cmbBox)
- {
- m_cmbBox.ShowWindow(SW_HIDE);
- }
- if(m_CheckBoxControl)
- {
- m_CheckBoxControl.ShowWindow(SW_HIDE);
- }
- if(m_btnCtrl)
- {
- m_btnCtrl.ShowWindow(SW_HIDE);
- }
-}
-
-void CPropertyList::OnVScroll( UINT nSBCode, UINT nPos, CScrollBar* pScrollBar )
-{
- this->HideControls();
- CListBox::OnVScroll(nSBCode, nPos, pScrollBar);
-}
-
-void CPropertyList::OnCheckBox()
-{
- CPropertyItem* pItem = (CPropertyItem*) GetItemDataPtr(m_curSel);
- if(m_CheckBoxControl.GetCheck())
- {
- pItem->m_curValue = "ON";
- }
- else
- {
- pItem->m_curValue = "OFF";
- }
- m_Dirty = true;
-}
-
-
-void CPropertyList::OnButton()
-{
- if(m_PropertyItems.size() == 0)
- {
- return;
- }
-
- CPropertyItem* pItem = (CPropertyItem*) GetItemDataPtr(m_curSel);
-
- // The dialogs might change the working directory. Save it.
- std::string cwd = cmSystemTools::GetCurrentWorkingDirectory();
-
- //display the appropriate common dialog depending on what type
- //of chooser is associated with the property
-
- if (pItem->m_nItemType == CPropertyList::FILE)
- {
- CString SelectedFile;
- CString Filter("All Files (*.*)||");
-
- CFileDialog FileDlg(TRUE, NULL, NULL, NULL,
- Filter);
- CString initialDir;
- CString currPath = pItem->m_curValue;
- if (currPath.Right(9) == "-NOTFOUND" || currPath == "NOTFOUND")
- {
- currPath = "";
- }
- if (currPath.GetLength() > 0)
- {
- int endSlash = currPath.ReverseFind('\\');
- if(endSlash == -1)
- {
- endSlash = currPath.ReverseFind('/');
- }
- initialDir = currPath.Left(endSlash);
- }
- initialDir.Replace("/", "\\");
- FileDlg.m_ofn.lpstrTitle = "Select file";
- if (currPath.GetLength() > 0)
- FileDlg.m_ofn.lpstrInitialDir = initialDir;
-
- if(IDOK == FileDlg.DoModal())
- {
- SelectedFile = FileDlg.GetPathName();
-
- m_btnCtrl.ShowWindow(SW_HIDE);
- std::string path = SelectedFile;
- cmSystemTools::ConvertToUnixSlashes(path);
- pItem->m_curValue = path.c_str();
- m_Dirty = true;
- InvalidateList();
- }
- }
- else if (pItem->m_nItemType == CPropertyList::PATH)
- {
- CString initialDir = pItem->m_curValue;
- // convert back to windos style path
- initialDir.Replace("/", "\\");
- CString title = "Setting Cache Value: ";
- title += pItem->m_propName;
- CPathDialog dlg("Select Path", title, initialDir);
- if(dlg.DoModal()==IDOK)
- {
- CString SelectedFile = dlg.GetPathName();
- m_btnCtrl.ShowWindow(SW_HIDE);
- std::string path = SelectedFile;
- cmSystemTools::ConvertToUnixSlashes(path);
- pItem->m_curValue = path.c_str();
- m_Dirty = true;
- InvalidateList();
- }
- }
-
- cmSystemTools::ChangeDirectory(cwd.c_str());
-}
-
-void CPropertyList::OnLButtonUp(UINT nFlags, CPoint point)
-{
- if (m_bTracking)
- {
- //if columns were being resized then this indicates
- //that mouse is up so resizing is done. Need to redraw
- //columns to reflect their new widths.
-
- m_bTracking = FALSE;
- //if mouse was captured then release it
- if (GetCapture()==this)
- ::ReleaseCapture();
-
- ::ClipCursor(NULL);
-
- CClientDC dc(this);
- InvertLine(&dc,CPoint(point.x,m_nDivTop),CPoint(point.x,m_nDivBtm));
- //set the divider position to the new value
- m_nDivider = point.x;
-
- //redraw
- Invalidate();
- }
- else
- {
- BOOL loc;
- int i = ItemFromPoint(point,loc);
- m_curSel = i;
- CListBox::OnLButtonUp(nFlags, point);
- }
-}
-
-void CPropertyList::OnLButtonDown(UINT nFlags, CPoint point)
-{
- if ((point.x>=m_nDivider-5) && (point.x<=m_nDivider+5))
- {
- //if mouse clicked on divider line, then start resizing
-
- ::SetCursor(m_hCursorSize);
-
- CRect windowRect;
- GetWindowRect(windowRect);
- windowRect.left += 10; windowRect.right -= 10;
- //do not let mouse leave the list box boundary
- ::ClipCursor(windowRect);
-
- if (m_cmbBox)
- m_cmbBox.ShowWindow(SW_HIDE);
- if (m_editBox)
- m_editBox.ShowWindow(SW_HIDE);
-
- CRect clientRect;
- GetClientRect(clientRect);
-
- m_bTracking = TRUE;
- m_nDivTop = clientRect.top;
- m_nDivBtm = clientRect.bottom;
- m_nOldDivX = point.x;
-
- CClientDC dc(this);
- InvertLine(&dc,CPoint(m_nOldDivX,m_nDivTop),CPoint(m_nOldDivX,m_nDivBtm));
-
- //capture the mouse
- SetCapture();
- }
- else
- {
- m_bTracking = FALSE;
- CListBox::OnLButtonDown(nFlags, point);
- }
-}
-
-void CPropertyList::OnMouseMove(UINT nFlags, CPoint point)
-{
- if (m_bTracking)
- {
- //move divider line to the mouse pos. if columns are
- //currently being resized
- CClientDC dc(this);
- //remove old divider line
- InvertLine(&dc,CPoint(m_nOldDivX,m_nDivTop),CPoint(m_nOldDivX,m_nDivBtm));
- //draw new divider line
- InvertLine(&dc,CPoint(point.x,m_nDivTop),CPoint(point.x,m_nDivBtm));
- m_nOldDivX = point.x;
- }
- else if ((point.x >= m_nDivider-5) && (point.x <= m_nDivider+5))
- //set the cursor to a sizing cursor if the cursor is over the row divider
- ::SetCursor(m_hCursorSize);
- else
- {
- BOOL loc;
- int curSel = ItemFromPoint(point,loc);
- if(!loc && curSel < 65535)
- {
- CPropertyItem* pItem = (CPropertyItem*) GetItemDataPtr(curSel);
- m_CMakeSetupDialog->SetDlgItemText(IDC_PROGRESS, pItem->m_HelpString);
- }
- CListBox::OnMouseMove(nFlags, point);
- }
-
-}
-
-void CPropertyList::InvertLine(CDC* pDC,CPoint ptFrom,CPoint ptTo)
-{
- int nOldMode = pDC->SetROP2(R2_NOT);
-
- pDC->MoveTo(ptFrom);
- pDC->LineTo(ptTo);
-
- pDC->SetROP2(nOldMode);
-}
-
-void CPropertyList::PreSubclassWindow()
-{
- m_bDivIsSet = FALSE;
- m_nDivider = 0;
- m_bTracking = FALSE;
- m_curSel = 1;
-
- m_hCursorSize = AfxGetApp()->LoadStandardCursor(IDC_SIZEWE);
- m_hCursorArrow = AfxGetApp()->LoadStandardCursor(IDC_ARROW);
-
- m_SSerif8Font.CreatePointFont(80,_T("MS Sans Serif"));
-}
-
-CPropertyItem* CPropertyList::GetItem(int index)
-{
- return (CPropertyItem*)GetItemDataPtr(index);
-}
-
-void CPropertyList::OnRButtonUp( UINT /* nFlags */, CPoint point )
-{
- CMenu menu;
- CRect rect;
- this->GetWindowRect(&rect);
- BOOL loc;
- m_curSel = ItemFromPoint(point,loc);
- menu.CreatePopupMenu();
- menu.AppendMenu(MF_STRING | MF_ENABLED, 44, "Ignore Cache Entry");
- menu.AppendMenu(MF_STRING | MF_ENABLED, 42, "Delete Cache Entry");
- menu.AppendMenu(MF_STRING | MF_ENABLED, 43, "Help For Cache Entry");
- menu.TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON,
- rect.TopLeft().x + point.x,
- rect.TopLeft().y + point.y, this, NULL);
-}
-
-void CPropertyList::RemoveProperty(const char* name)
-{
- this->HideControls();
- for(int i =0; i < this->GetCount(); ++i)
- {
- CPropertyItem* pItem = (CPropertyItem*) GetItemDataPtr(i);
- if(pItem->m_propName == name)
- {
- m_PropertyItems.erase(pItem);
- delete pItem;
- this->DeleteString(i);
- return;
- }
- }
-}
-
-void CPropertyList::OnIgnore()
-{
- if(m_curSel == -1 || this->GetCount() <= 0)
- {
- return;
- }
- CPropertyItem* pItem = (CPropertyItem*) GetItemDataPtr(m_curSel);
- pItem->m_curValue = "IGNORE";
- InvalidateList();
-}
-
-
-
-void CPropertyList::OnDelete()
-{
- if(m_curSel == -1 || this->GetCount() <= 0)
- {
- return;
- }
- CPropertyItem* pItem = (CPropertyItem*) GetItemDataPtr(m_curSel);
- m_CMakeSetupDialog->GetCMakeInstance()->GetCacheManager()->RemoveCacheEntry(pItem->m_propName);
- m_PropertyItems.erase(pItem);
- delete pItem;
- this->DeleteString(m_curSel);
- this->HideControls();
- this->SetTopIndex(0);
- InvalidateList();
- m_curSel += 1;
- if(m_curSel > this->GetCount())
- {
- m_curSel = this->GetCount();
- }
- this->SetCurSel(m_curSel);
-}
-
-void CPropertyList::OnHelp()
-{
- if(m_curSel == -1 || this->GetCount() <= 0)
- {
- return;
- }
- CPropertyItem* pItem = (CPropertyItem*) GetItemDataPtr(m_curSel);
- MessageBox(pItem->m_HelpString, pItem->m_propName, MB_OK|MB_ICONINFORMATION);
-}
-
-void CPropertyList::RemoveAll()
-{
- int c = this->GetCount();
- for(int i =0; i < c; ++i)
- {
- this->DeleteString(0);
- }
- for(std::set<CPropertyItem*>::iterator ii = m_PropertyItems.begin();
- ii != m_PropertyItems.end(); ++ii)
- {
- delete *ii;
- }
- m_PropertyItems.clear();
- m_Dirty = false;
- this->HideControls();
- InvalidateList();
-}
-
-void CPropertyList::InvalidateList()
-{
- Invalidate();
- m_Dirty = true;
-}
-
-void CPropertyList::ShowAdvanced()
-{
- this->SetRedraw(FALSE);
- this->ResetContent();
- m_ShowAdvanced = true;
- std::map<std::string, CPropertyItem*> sortProps;
- for(std::set<CPropertyItem*>::iterator i = m_PropertyItems.begin();
- i != m_PropertyItems.end(); ++i)
- {
- sortProps[(const char*)(*i)->m_propName] = *i;
- }
- for(std::map<std::string, CPropertyItem*>::iterator i = sortProps.begin();
- i != sortProps.end(); ++i)
- {
- CPropertyItem* item = i->second;
- if(item->m_NewValue)
- {
- this->AddPropItem(item, 2);
- }
- }
- for(std::map<std::string, CPropertyItem*>::iterator i = sortProps.begin();
- i != sortProps.end(); ++i)
- {
- CPropertyItem* item = i->second;
- if(!item->m_NewValue)
- {
- this->AddPropItem(item, 2);
- }
- }
- this->SetRedraw(TRUE);
- this->InvalidateList();
-}
-
-
-void CPropertyList::HideAdvanced()
-{
- this->SetRedraw(FALSE);
- this->ResetContent();
- m_ShowAdvanced = false;
- std::map<std::string, CPropertyItem*> sortProps;
- for(std::set<CPropertyItem*>::iterator i = m_PropertyItems.begin();
- i != m_PropertyItems.end(); ++i)
- {
- sortProps[(const char*)(*i)->m_propName] = *i;
- }
- for(std::map<std::string, CPropertyItem*>::iterator i = sortProps.begin();
- i != sortProps.end(); ++i)
- {
- CPropertyItem* item = i->second;
- if(item->m_NewValue && !item->m_Advanced)
- {
- this->AddPropItem(item, 2);
- }
- }
- for(std::map<std::string, CPropertyItem*>::iterator i = sortProps.begin();
- i != sortProps.end(); ++i)
- {
- CPropertyItem* item = i->second;
- if(!item->m_Advanced && !item->m_NewValue)
- {
- this->AddPropItem(item, 2);
- }
- }
- this->SetRedraw(TRUE);
- this->InvalidateList();
-}
-
diff --git a/Source/MFCDialog/PropertyList.h b/Source/MFCDialog/PropertyList.h
deleted file mode 100644
index d3992a1..0000000
--- a/Source/MFCDialog/PropertyList.h
+++ /dev/null
@@ -1,179 +0,0 @@
-/*=========================================================================
-
- Program: CMake - Cross-Platform Makefile Generator
- Module: $RCSfile$
- Language: C++
- Date: $Date$
- Version: $Revision$
-
- Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
- See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
-
- This software is distributed WITHOUT ANY WARRANTY; without even
- the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- PURPOSE. See the above copyright notices for more information.
-
-=========================================================================*/
-#ifndef CPROPERTYLIST_H
-#define CPROPERTYLIST_H
-
-
-
-#include "../cmStandardIncludes.h"
-class CMakeSetupDialog;
-
-/////////////////////////////////////////////////////////////////////////////
-//CPropertyList Items
-class CPropertyItem
-{
-// Attributes
-public:
- CString m_HelpString;
- CString m_propName;
- CString m_curValue;
- int m_nItemType;
- CString m_cmbItems;
- bool m_NewValue;
- bool m_Removed;
- bool m_Advanced;
-
-public:
- CPropertyItem(CString propName, CString curValue,
- CString helpString,
- int nItemType, CString cmbItems)
- {
- m_NewValue = true;
- m_HelpString = helpString;
- m_Removed = false;
- m_propName = propName;
- m_curValue = curValue;
- m_nItemType = nItemType;
- m_cmbItems = cmbItems;
- m_Advanced = false;
- }
-};
-
-/////////////////////////////////////////////////////////////////////////////
-// CPropertyList window
-
-class CPropertyList : public CListBox
-{
-// Construction
-public:
- enum ItemType
- {
- COMBO = 0,
- EDIT,
- COLOR,
- FONT,
- FILE,
- CHECKBOX,
- PATH
- };
- CPropertyList();
-
-// Attributes
-public:
- CMakeSetupDialog *m_CMakeSetupDialog;
-
-// Operations
-public:
- bool GetShowAdvanced() {return m_ShowAdvanced;}
- bool IsDirty() { return m_Dirty; }
- void ClearDirty() { m_Dirty = false; }
-
- int AddItem(CString txt);
- void AddProperty(const char* name,
- const char* value,
- const char* helpString,
- int type,
- const char* comboItems,
- bool reverseOrder,
- bool advanced);
- void RemoveProperty(const char* name);
- void HideControls();
- void ShowAdvanced();
- void HideAdvanced();
- std::set<CPropertyItem*> GetItems()
- {
- return m_PropertyItems;
- }
- void RemoveAll();
- CPropertyItem* GetItem(int index);
-// Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CPropertyList)
-public:
- virtual void MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct);
- virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
-protected:
- virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
- virtual void PreSubclassWindow();
- //}}AFX_VIRTUAL
-
-// Implementation
-public:
- virtual ~CPropertyList();
-
- // Generated message map functions
-protected:
- //{{AFX_MSG(CPropertyList)
- afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
- afx_msg void OnSelchange();
- afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
- afx_msg void OnKillFocus(CWnd* pNewWnd);
- afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
- afx_msg void OnMouseMove(UINT nFlags, CPoint point);
- afx_msg void OnRButtonUp( UINT nFlags, CPoint point );
- //}}AFX_MSG
- afx_msg void OnKillfocusCmbBox();
- afx_msg void OnSelchangeCmbBox();
- afx_msg void OnKillfocusEditBox();
- afx_msg void OnChangeEditBox();
- afx_msg void OnButton();
- afx_msg void OnIgnore();
- afx_msg void OnDelete();
- afx_msg void OnHelp();
- afx_msg void OnCheckBox();
- afx_msg void OnVScroll( UINT nSBCode, UINT nPos, CScrollBar* pScrollBar );
-
-
- DECLARE_MESSAGE_MAP()
-
- void InvertLine(CDC* pDC,CPoint ptFrom,CPoint ptTo);
- void DisplayButton(CRect region);
-// order = 0 sorted
-// order = 1 add to top
-// order = 2 add to bottom
- int AddPropItem(CPropertyItem* pItem, int order);
- void InvalidateList();
-
- CComboBox m_cmbBox;
- CEdit m_editBox;
- CButton m_btnCtrl;
- CButton m_CheckBoxControl;
-
- CFont m_SSerif8Font;
-
- bool m_Dirty;
- int m_curSel;
- int m_prevSel;
- int m_nDivider;
- int m_nDivTop;
- int m_nDivBtm;
- int m_nOldDivX;
- int m_nLastBox;
- BOOL m_bTracking;
- BOOL m_bDivIsSet;
- HCURSOR m_hCursorArrow;
- HCURSOR m_hCursorSize;
- bool m_ShowAdvanced;
- std::set<CPropertyItem*> m_PropertyItems;
-};
-
-/////////////////////////////////////////////////////////////////////////////
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_PROPERTYLIST_H__74205380_1B56_11D4_BC48_00105AA2186F__INCLUDED_)
diff --git a/Source/MFCDialog/StdAfx.cpp b/Source/MFCDialog/StdAfx.cpp
deleted file mode 100644
index 4ec72a4..0000000
--- a/Source/MFCDialog/StdAfx.cpp
+++ /dev/null
@@ -1,8 +0,0 @@
-// stdafx.cpp : source file that includes just the standard includes
-// pcbuilderdialog.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-
-
diff --git a/Source/MFCDialog/StdAfx.h b/Source/MFCDialog/StdAfx.h
deleted file mode 100644
index ff1a2d3..0000000
--- a/Source/MFCDialog/StdAfx.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*=========================================================================
-
- Program: CMake - Cross-Platform Makefile Generator
- Module: $RCSfile$
- Language: C++
- Date: $Date$
- Version: $Revision$
-
- Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
- See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
-
- This software is distributed WITHOUT ANY WARRANTY; without even
- the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- PURPOSE. See the above copyright notices for more information.
-
-=========================================================================*/
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#if !defined(AFX_STDAFX_H__AC17A6F8_4634_11D4_8F21_00A0CC33FCD3__INCLUDED_)
-#define AFX_STDAFX_H__AC17A6F8_4634_11D4_8F21_00A0CC33FCD3__INCLUDED_
-#if _MSC_VER < 1600
-#define _WIN32_WINNT 0x0400
-#else
-#define _WIN32_WINNT 0x0500
-#endif
-#define _WIN32_IE 0x0400
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
-
-#include <afxwin.h> // MFC core and standard components
-#include <afxext.h> // MFC extensions
-#include <afxdisp.h> // MFC Automation classes
-#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
-#ifndef _AFX_NO_AFXCMN_SUPPORT
-#include <afxcmn.h> // MFC support for Windows Common Controls
-#endif // _AFX_NO_AFXCMN_SUPPORT
-
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_STDAFX_H__AC17A6F8_4634_11D4_8F21_00A0CC33FCD3__INCLUDED_)
diff --git a/Source/MFCDialog/res/CMakeSetupDialog.ico b/Source/MFCDialog/res/CMakeSetupDialog.ico
deleted file mode 100644
index e13bb15..0000000
--- a/Source/MFCDialog/res/CMakeSetupDialog.ico
+++ /dev/null
Binary files differ
diff --git a/Source/MFCDialog/res/CMakeSetupDialog.rc2 b/Source/MFCDialog/res/CMakeSetupDialog.rc2
deleted file mode 100644
index 8a619b3..0000000
--- a/Source/MFCDialog/res/CMakeSetupDialog.rc2
+++ /dev/null
@@ -1,13 +0,0 @@
-//
-// PCBUILDERDIALOG.RC2 - resources Microsoft Visual C++ does not edit directly
-//
-
-#ifdef APSTUDIO_INVOKED
- #error this file is not editable by Microsoft Visual C++
-#endif //APSTUDIO_INVOKED
-
-
-/////////////////////////////////////////////////////////////////////////////
-// Add manually edited resources here...
-
-/////////////////////////////////////////////////////////////////////////////
diff --git a/Source/MFCDialog/resource.h b/Source/MFCDialog/resource.h
deleted file mode 100644
index 0395b76..0000000
--- a/Source/MFCDialog/resource.h
+++ /dev/null
@@ -1,48 +0,0 @@
-//{{NO_DEPENDENCIES}}
-// Microsoft Visual C++ generated include file.
-// Used by CMakeSetup.rc
-//
-#define IDM_ABOUTBOX 0x0010
-#define IDM_CREATESHORTCUT 0x0020
-#define IDD_ABOUTBOX 100
-#define IDS_ABOUTBOX 101
-#define IDD_CMakeSetupDialog_DIALOG 102
-#define IDS_CREATESHORTCUT 102
-#define IDR_MAINFRAME 128
-#define IDD_CMAKE_HELP_DIALOG 133
-#define IDD_GEN_DIALOG 134
-#define IDC_WhereSource 1001
-#define IDC_BUTTON2 1002
-#define IDC_BROWSE_SOURCE 1002
-#define IDC_WhereBuild 1003
-#define IDC_BUTTON3 1004
-#define IDC_BROWSE_BUILD 1004
-#define IDC_BuildProjects 1006
-#define IDC_LIST2 1007
-#define IDC_LIST3 1010
-#define IDC_CMAKE_VERSION 1014
-#define IDC_FRAME 1015
-#define IDC_MouseHelpCaption 1016
-#define IDC_OK 1018
-#define IDC_Generator 1019
-#define IDC_GeneratorLabel 1020
-#define IDC_HELP_BUTTON 1021
-#define IDC_HELP_BUTTON2 1022
-#define IDC_DELETE_BUTTON 1022
-#define IDC_EDIT1 1025
-#define IDC_AdvancedValues 1027
-#define IDC_PROGRESS 1028
-#define IDC_BuildForLabel 1029
-#define IDC_CHECK1 1030
-#define IDC_SUPPRESS_DEV_WARNINGS 1030
-
-// Next default values for new objects
-//
-#ifdef APSTUDIO_INVOKED
-#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE 135
-#define _APS_NEXT_COMMAND_VALUE 32771
-#define _APS_NEXT_CONTROL_VALUE 1031
-#define _APS_NEXT_SYMED_VALUE 102
-#endif
-#endif
diff --git a/Source/cmDocumentVariables.cxx b/Source/cmDocumentVariables.cxx
index f6997cf..d6d6267 100644
--- a/Source/cmDocumentVariables.cxx
+++ b/Source/cmDocumentVariables.cxx
@@ -176,10 +176,10 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
cm->DefineProperty
("CMAKE_EDIT_COMMAND", cmProperty::VARIABLE,
- "Full path to CMakeSetup or ccmake.",
+ "Full path to cmake-gui or ccmake.",
"This is the full path to the CMake executable "
"that can graphically edit the cache. For example,"
- " CMakeSetup, ccmake, or cmake -i.",false,
+ " cmake-gui, ccmake, or cmake -i.",false,
"Variables that Provide Information");
cm->DefineProperty
@@ -289,7 +289,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
"Source directory for project.",
"This is the top level source directory for the project. "
"It corresponds to the source directory given to "
- "CMakeSetup or ccmake.",false,
+ "cmake-gui or ccmake.",false,
"Variables that Provide Information");
cm->DefineProperty
("CMAKE_STANDARD_LIBRARIES", cmProperty::VARIABLE,
@@ -631,7 +631,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
"to 1 for static the static MFC library, and 2 for "
"the shared MFC library. This is used in visual "
"studio 6 and 7 project files. The CMakeSetup "
- "dialog uses MFC and the CMakeLists.txt looks like this:\n"
+ "dialog used MFC and the CMakeLists.txt looks like this:\n"
"add_definitions(-D_AFXDLL)\n"
"set(CMAKE_MFC_FLAG 2)\n"
"add_executable(CMakeSetup WIN32 ${SRCS})\n",false,
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index f59b0b0..5c6a7c6 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -840,7 +840,7 @@ int cmake::AddCMakePaths()
if( !cmSystemTools::FileExists(editCacheCommand.c_str()))
{
editCacheCommand = cmSystemTools::GetFilenamePath(cMakeSelf) +
- "/CMakeSetup" + cmSystemTools::GetFilenameExtension(cMakeSelf);
+ "/cmake-gui" + cmSystemTools::GetFilenameExtension(cMakeSelf);
}
if(cmSystemTools::FileExists(editCacheCommand.c_str()))
{