summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2002-08-23 17:46:32 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2002-08-23 17:46:32 (GMT)
commit3f36d234213fd9e23a9402eabb2198e79c6ebe61 (patch)
tree59a7ab0bfb1f057894061347ae3891d03bdcc0c7 /Source
parent40cf734152304bd00a1c0895f4e37f0ff87ca43d (diff)
downloadCMake-3f36d234213fd9e23a9402eabb2198e79c6ebe61.zip
CMake-3f36d234213fd9e23a9402eabb2198e79c6ebe61.tar.gz
CMake-3f36d234213fd9e23a9402eabb2198e79c6ebe61.tar.bz2
BUG: add explicit clean up of the cachemanager at exit of programs, so dll destruction is not a problem.
Diffstat (limited to 'Source')
-rw-r--r--Source/CMakeLists.txt4
-rw-r--r--Source/CursesDialog/CMakeLists.txt4
-rw-r--r--Source/CursesDialog/form/CMakeLists.txt6
-rw-r--r--Source/MFCDialog/CMakeSetup.cpp2
-rw-r--r--Source/cmCacheManager.cxx15
-rw-r--r--Source/cmCacheManager.h1
-rw-r--r--Source/cmake.cxx5
-rw-r--r--Source/cmake.h2
-rw-r--r--Source/cmakemain.cxx3
-rw-r--r--Source/cmaketest.cxx3
10 files changed, 27 insertions, 18 deletions
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index a138680..7abec39 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -53,7 +53,8 @@ INCLUDE_DIRECTORIES(${CMake_SOURCE_DIR}/Source)
ADD_DEFINITIONS(-DCMAKE_BUILD_WITH_CMAKE)
IF (WIN32)
- SET(SRCS ${SRCS}
+ IF(NOT UNIX)
+ SET(SRCS ${SRCS}
cmDSWWriter.cxx
cmDSPWriter.cxx
cmMSProjectGenerator.cxx
@@ -67,7 +68,6 @@ IF (WIN32)
cmNMakeMakefileGenerator.h
cmMSDotNETGenerator.h
)
- IF(NOT UNIX)
IF( NOT BORLAND )
LINK_LIBRARIES( rpcrt4.lib )
SUBDIRS(MFCDialog)
diff --git a/Source/CursesDialog/CMakeLists.txt b/Source/CursesDialog/CMakeLists.txt
index 60e2909..bf86e1f 100644
--- a/Source/CursesDialog/CMakeLists.txt
+++ b/Source/CursesDialog/CMakeLists.txt
@@ -24,9 +24,5 @@ INCLUDE_DIRECTORIES(${CURSES_INCLUDE_PATH})
ADD_EXECUTABLE(ccmake ${CURSES_SRCS} )
TARGET_LINK_LIBRARIES(ccmake CMakeLib)
TARGET_LINK_LIBRARIES(ccmake cmForm)
-TARGET_LINK_LIBRARIES(ccmake ${CURSES_LIBRARY})
-IF(CURSES_EXTRA_LIBRARY)
- TARGET_LINK_LIBRARIES(ccmake ${CURSES_EXTRA_LIBRARY})
-ENDIF(CURSES_EXTRA_LIBRARY)
INSTALL_TARGETS(/bin ccmake) \ No newline at end of file
diff --git a/Source/CursesDialog/form/CMakeLists.txt b/Source/CursesDialog/form/CMakeLists.txt
index b197eb6..618aef2 100644
--- a/Source/CursesDialog/form/CMakeLists.txt
+++ b/Source/CursesDialog/form/CMakeLists.txt
@@ -45,4 +45,8 @@ SET( FORM_SRCS
)
INCLUDE_DIRECTORIES(${CMAKE_FORM_SOURCE_DIR})
-ADD_LIBRARY(cmForm ${FORM_SRCS} ) \ No newline at end of file
+ADD_LIBRARY(cmForm ${FORM_SRCS} )
+TARGET_LINK_LIBRARIES(cmForm ${CURSES_LIBRARY})
+IF(CURSES_EXTRA_LIBRARY)
+ TARGET_LINK_LIBRARIES(cmForm ${CURSES_EXTRA_LIBRARY})
+ENDIF(CURSES_EXTRA_LIBRARY)
diff --git a/Source/MFCDialog/CMakeSetup.cpp b/Source/MFCDialog/CMakeSetup.cpp
index 260dd57..707b9c6 100644
--- a/Source/MFCDialog/CMakeSetup.cpp
+++ b/Source/MFCDialog/CMakeSetup.cpp
@@ -7,6 +7,7 @@
#include "CMakeCommandLineInfo.h"
#include "../cmListFileCache.h"
#include "../cmMakefileGenerator.h"
+#include "../cmCacheManager.h"
#ifdef _DEBUG
#define new DEBUG_NEW
@@ -78,6 +79,7 @@ BOOL CMakeSetup::InitInstance()
// clean up globals
cmListFileCache::GetInstance()->ClearCache();
cmMakefileGenerator::UnRegisterGenerators();
+ cmCacheManager::DeleteInstance();
// 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/cmCacheManager.cxx b/Source/cmCacheManager.cxx
index 81b5337..f15b4db 100644
--- a/Source/cmCacheManager.cxx
+++ b/Source/cmCacheManager.cxx
@@ -50,17 +50,13 @@ cmCacheManager::CacheEntryType cmCacheManager::StringToType(const char* s)
return STRING;
}
-
-struct CleanUpCacheManager
+void cmCacheManager::DeleteInstance()
{
- ~CleanUpCacheManager()
- {
- delete cmCacheManager::GetInstance();
- }
- void Use() {}
-};
+ delete cmCacheManager::GetInstance();
+ cmCacheManager::s_Instance = 0;
+}
-CleanUpCacheManager cleanup;
+
cmCacheManager* cmCacheManager::s_Instance = 0;
@@ -68,7 +64,6 @@ cmCacheManager* cmCacheManager::GetInstance()
{
if(!cmCacheManager::s_Instance)
{
- cleanup.Use();
cmCacheManager::s_Instance = new cmCacheManager;
}
return cmCacheManager::s_Instance;
diff --git a/Source/cmCacheManager.h b/Source/cmCacheManager.h
index f855f2d..3510624 100644
--- a/Source/cmCacheManager.h
+++ b/Source/cmCacheManager.h
@@ -71,6 +71,7 @@ public:
static CacheEntryType StringToType(const char*);
///! Singleton pattern get instance of the cmCacheManager.
CM_EXPORT static cmCacheManager* GetInstance();
+ CM_EXPORT static void DeleteInstance();
///! Load a cache for given makefile. Loads from ouput home.
CM_EXPORT bool LoadCache(cmMakefile*);
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 68efa46..72d4465 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -41,6 +41,11 @@ cmake::cmake()
#endif
}
+cmake::~cmake()
+{
+}
+
+
void cmake::Usage(const char* program)
{
cmStringStream errorStream;
diff --git a/Source/cmake.h b/Source/cmake.h
index cc832df..3ccbea2 100644
--- a/Source/cmake.h
+++ b/Source/cmake.h
@@ -61,7 +61,7 @@ class CM_EXPORT cmake
* constructor
*/
cmake();
-
+ ~cmake();
private:
bool m_Verbose;
bool m_Local;
diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx
index e08e19f..696624c 100644
--- a/Source/cmakemain.cxx
+++ b/Source/cmakemain.cxx
@@ -17,6 +17,7 @@
#include "cmakewizard.h"
#include "cmake.h"
#include "cmMakefileGenerator.h"
+#include "cmCacheManager.h"
int main(int ac, char** av)
{
@@ -52,10 +53,12 @@ int main(int ac, char** av)
cmakewizard wizard;
wizard.RunWizard(args);
cmMakefileGenerator::UnRegisterGenerators();
+ cmCacheManager::DeleteInstance();
return 0;
}
cmake cm;
int ret = cm.Generate(args);
cmMakefileGenerator::UnRegisterGenerators();
+ cmCacheManager::DeleteInstance();
return ret;
}
diff --git a/Source/cmaketest.cxx b/Source/cmaketest.cxx
index 69eba74..3ba3fad 100644
--- a/Source/cmaketest.cxx
+++ b/Source/cmaketest.cxx
@@ -20,6 +20,7 @@
#include "cmake.h"
#include "cmListFileCache.h"
#include "cmMakefileGenerator.h"
+#include "cmCacheManager.h"
#if defined(_WIN32) && !defined(__CYGWIN__)
#include "windows.h"
#endif
@@ -31,6 +32,8 @@ struct CleanUp
~CleanUp()
{
cmMakefileGenerator::UnRegisterGenerators();
+ cmCacheManager::DeleteInstance();
+
}
void UseIt()
{