]> Creatis software - crea.git/commitdiff
Feature #1711
authorDaniel Gonzalez <Daniel.Gonzalez@creatis.insa-lyon.fr>
Fri, 19 Oct 2012 10:11:11 +0000 (10:11 +0000)
committerDaniel Gonzalez <Daniel.Gonzalez@creatis.insa-lyon.fr>
Fri, 19 Oct 2012 10:11:11 +0000 (10:11 +0000)
CreaDevManager application implementation:

application creation in crea project

15 files changed:
.cvsignore [new file with mode: 0644]
CMakeLists.txt
appli/CMakeLists.txt
appli/creaDevManager/CMakeLists.txt [new file with mode: 0644]
appli/creaDevManager/creaDevManager.cpp [new file with mode: 0644]
appli/creaDevManager/creaDevManager.h [new file with mode: 0644]
lib/CMakeLists.txt [new file with mode: 0644]
lib/creaDevManagerLib/CMakeLists.txt [new file with mode: 0644]
lib/creaDevManagerLib/creaSystem.h [new file with mode: 0644]
lib/creaDevManagerLib/creaSystem.h.in [new file with mode: 0644]
lib/creaDevManagerLib/wxCreaDevManagerMainFrame.cxx [new file with mode: 0644]
lib/creaDevManagerLib/wxCreaDevManagerMainFrame.h [new file with mode: 0644]
lib/template_lib/CMakeLists.txt [new file with mode: 0644]
lib/template_lib/creaSystem.h [new file with mode: 0644]
lib/template_lib/creaSystem.h.in [new file with mode: 0644]

diff --git a/.cvsignore b/.cvsignore
new file mode 100644 (file)
index 0000000..86b18f5
--- /dev/null
@@ -0,0 +1,2 @@
+.cproject
+.project
index 18c71df33c5bee09d44771edee422fcb22377117..2593cf6faca20010081d9865f083c8677a21ce64 100644 (file)
@@ -76,6 +76,7 @@ INCLUDE_DIRECTORIES(/usr/lib/x86_64-linux-gnu/glib-2.0/include/)
 ADD_SUBDIRECTORY(cmake)
 ADD_SUBDIRECTORY(src)
 ADD_SUBDIRECTORY(appli)
+ADD_SUBDIRECTORY(lib)
 #-----------------------------------------------------------------------------
 OPTION( BUILD_SAMPLES "Build samples ?" OFF)
 IF(BUILD_SAMPLES)
index 8257392659c9fab6eb706e589f13da1f8089f0b9..bb808823ec8bcac3194d1a2169a1ab0c84b06753 100644 (file)
@@ -2,6 +2,7 @@
 
 IF(CREA_BUILD_WX)
   ADD_SUBDIRECTORY(creaNewProject)
+  ADD_SUBDIRECTORY(creaDevManager)
 ENDIF(CREA_BUILD_WX)
 
 IF(WIN32)
diff --git a/appli/creaDevManager/CMakeLists.txt b/appli/creaDevManager/CMakeLists.txt
new file mode 100644 (file)
index 0000000..13ff79f
--- /dev/null
@@ -0,0 +1,47 @@
+#============================================================================
+# Builds and install the executable creaDevManager
+
+#============================================================================
+# Appli name
+SET(EXE_NAME creaDevManager)
+
+#============================================================================
+# Sources
+SET(${EXE_NAME}_SOURCES creaDevManager.cpp)
+
+#============================================================================
+# Settings
+SET(${EXE_NAME}_HAS_GUI TRUE)
+SET(${EXE_NAME}_CONSOLE FALSE)
+
+#-Libraries------------------------------------------------------------------
+
+INCLUDE_DIRECTORIES (
+
+# USER! : Add here the directories holding th extra .h files you need
+# e.g.
+# ../../lib/<my_library_I_just_created>
+../../lib/creaDevManagerLib
+)
+
+#-Dependencies---------------------------------------------------------------
+
+# DEPENDENCIES (LIBRARIES TO LINK WITH)
+SET ( ${EXE_NAME}_LINK_LIBRARIES
+    ${crea_LIBRARIES}
+    ${WXWIDGETS_LIBRARIES}
+  #    ${KWWidgets_LIBRARIES}
+  #    ${VTK_LIBRARIES}
+  #    ${ITK_LIBRARIES}
+  #    ${GDCM_LIBRARIES}
+  #    ${BOOST_LIBRARIES}
+  
+  # USER! : Add here those agmonst the various (?) PROJECT LIBRARIES
+  # you need for the current executable
+  # (If you created only one Library, don't forget it !...) 
+  creaDevManagerLib
+)
+
+#-Creates and installs the exe-----------------------------------------------
+CREA_ADD_EXECUTABLE( ${EXE_NAME} )
+#============================================================================
diff --git a/appli/creaDevManager/creaDevManager.cpp b/appli/creaDevManager/creaDevManager.cpp
new file mode 100644 (file)
index 0000000..b5c1a65
--- /dev/null
@@ -0,0 +1,25 @@
+#include <creaWx.h>
+#include <stdlib.h>
+#include <iostream> // for std::cout
+#include "creaDevManager.h"
+#include "wxCreaDevManagerMainFrame.h"
+using namespace std;
+
+IMPLEMENT_APP(wxCreaDevManagerApp)
+
+wxCreaDevManagerApp::wxCreaDevManagerApp():wxApp()
+{
+}
+
+bool wxCreaDevManagerApp::OnInit()
+{
+  wxApp::OnInit();
+  
+  wxCreaDevManagerMainFrame* mainWindow = new wxCreaDevManagerMainFrame(NULL);
+  mainWindow->SetSize(800, 600);
+  mainWindow->Show(true);
+  
+  cout << "listo";
+  
+  return true;
+}
diff --git a/appli/creaDevManager/creaDevManager.h b/appli/creaDevManager/creaDevManager.h
new file mode 100644 (file)
index 0000000..7e76ae8
--- /dev/null
@@ -0,0 +1,21 @@
+/*
+ * creaDevManager.h
+ *
+ *  Created on: 19/10/2012
+ *      Author: daniel
+ */
+
+#ifndef CREADEVMANAGER_H_
+#define CREADEVMANAGER_H_
+
+class wxCreaDevManagerApp:public wxApp
+{
+    public:
+        wxCreaDevManagerApp();
+
+        virtual bool OnInit();
+
+};
+DECLARE_APP(wxCreaDevManagerApp)
+
+#endif /* CREADEVMANAGER_H_ */
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
new file mode 100644 (file)
index 0000000..2531113
--- /dev/null
@@ -0,0 +1,6 @@
+
+# USER! : Add a ADD_SUBDIRECTORY command for each one of your libraries
+# -----
+
+ADD_SUBDIRECTORY(creaDevManagerLib)
+
diff --git a/lib/creaDevManagerLib/CMakeLists.txt b/lib/creaDevManagerLib/CMakeLists.txt
new file mode 100644 (file)
index 0000000..55de26d
--- /dev/null
@@ -0,0 +1,86 @@
+#----------------------------------------------------------------------------
+# USER! : SET THE NAME OF YOUR LIBRARY
+# (Replace 'MyLib' by your own library name)
+
+#############################
+SET ( LIBRARY_NAME   creaDevManagerLib  )
+#############################
+
+#----------------------------------------------------------------------------
+
+#----------------------------------------------------------------------------
+# CREATES A USER OPTION IN CMAKE
+OPTION ( BUILD_${LIBRARY_NAME}  "Build ${LIBRARY_NAME} library ?" ON)
+#----------------------------------------------------------------------------
+
+#----------------------------------------------------------------------------
+IF ( BUILD_${LIBRARY_NAME} )
+#----------------------------------------------------------------------------
+
+  #----------------------------------------------------------------------------
+  # BUILD LIBRARY
+  #----------------------------------------------------------------------------
+
+  #----------------------------------------------------------------------------
+  # LIBRARY HEADERS (TO BE INSTALLED)
+  # EITHER LIST ALL .h, *.txx IN CURRENT DIR USING NEXT LINE:
+
+  FILE(GLOB ${LIBRARY_NAME}_HEADERS "*.h" "*.txx")
+  
+  # OR MANUALLY LIST YOUR HEADERS WITH NEXT COMMAND
+  #  SET ( ${LIBRARY_NAME}_HEADERS
+  #
+  #      )
+  #----------------------------------------------------------------------------
+
+  #----------------------------------------------------------------------------
+  # LIBRARY SOURCES (TO BE COMPILED)
+  # EITHER LIST ALL .cxx, *.cpp, *.cc IN CURRENT DIR USING NEXT LINE:
+
+  FILE(GLOB ${LIBRARY_NAME}_SOURCES *.cxx *.cpp *.cc)
+
+  # OR MANUALLY LIST YOUR FILES WITH NEXT COMMAND (WITHOUT EXTENSION)
+  #  SET ( ${LIBRARY_NAME}_SOURCES 
+  #   
+  #      )
+  #----------------------------------------------------------------------------
+
+  #----------------------------------------------------------------------------
+  # LIBRARY DEPENDENCIES (LIBRARIES TO LINK WITH)
+  #
+  # USER! : Uncomment the Libraries you need
+  #
+  SET ( ${LIBRARY_NAME}_LINK_LIBRARIES
+    ${crea_LIBRARIES}
+    ${WXWIDGETS_LIBRARIES}
+  #    ${KWWidgets_LIBRARIES}
+  #    ${VTK_LIBRARIES}
+  #    ${ITK_LIBRARIES}
+  #    ${GDCM_LIBRARIES}
+  #    ${BOOST_LIBRARIES}
+
+  # If this library must link against other libraries 
+  # USER! : Add here any extra Library you need
+
+  )
+  #----------------------------------------------------------------------------
+
+  #----------------------------------------------------------------------------
+  # MACRO WHICH DOES ALL THE JOB : BUILD AND INSTALL
+
+  # USER! : The default is to create a Dynamic Library.
+  # if you need to create a static library
+  # comment out the following line :
+
+  CREA_ADD_LIBRARY( ${LIBRARY_NAME} )
+
+  # and uncomment the 2 lines hereafter:
+
+  # ADD_LIBRARY(${LIBRARY_NAME} STATIC  ${${LIBRARY_NAME}_SOURCES})
+  # TARGET_LINK_LIBRARIES(${LIBRARY_NAME} ${${LIBRARY_NAME}_LINK_LIBRARIES} )
+
+  #
+  #----------------------------------------------------------------------------
+
+  #---------------------------------------------------------------------------
+ENDIF ( BUILD_${LIBRARY_NAME} )
diff --git a/lib/creaDevManagerLib/creaSystem.h b/lib/creaDevManagerLib/creaSystem.h
new file mode 100644 (file)
index 0000000..d91ccee
--- /dev/null
@@ -0,0 +1,26 @@
+
+#ifndef _$PROJECT_NAME$SYSTEM_H_
+#define _$PROJECT_NAME$SYSTEM_H_
+
+
+// Windoze related troubles (as usual)
+
+//-----------------------------------------------------------------------------
+
+#if defined(_WIN32)
+  #ifdef $PROJECT_NAME$_EXPORT_SYMBOLS
+    #define $PROJECT_NAME$_EXPORT __declspec( dllexport )
+#else
+    #define $PROJECT_NAME$_EXPORT __declspec( dllimport )
+  #endif
+  #define $PROJECT_NAME$_CDECL __cdecl
+#else
+  #define $PROJECT_NAME$_EXPORT
+  #define $PROJECT_NAME$_CDECL
+#endif // defined(_WIN32)
+
+#ifdef __BORLANDC__
+  #include <mem.h>
+#endif
+
+#endif
diff --git a/lib/creaDevManagerLib/creaSystem.h.in b/lib/creaDevManagerLib/creaSystem.h.in
new file mode 100644 (file)
index 0000000..d91ccee
--- /dev/null
@@ -0,0 +1,26 @@
+
+#ifndef _$PROJECT_NAME$SYSTEM_H_
+#define _$PROJECT_NAME$SYSTEM_H_
+
+
+// Windoze related troubles (as usual)
+
+//-----------------------------------------------------------------------------
+
+#if defined(_WIN32)
+  #ifdef $PROJECT_NAME$_EXPORT_SYMBOLS
+    #define $PROJECT_NAME$_EXPORT __declspec( dllexport )
+#else
+    #define $PROJECT_NAME$_EXPORT __declspec( dllimport )
+  #endif
+  #define $PROJECT_NAME$_CDECL __cdecl
+#else
+  #define $PROJECT_NAME$_EXPORT
+  #define $PROJECT_NAME$_CDECL
+#endif // defined(_WIN32)
+
+#ifdef __BORLANDC__
+  #include <mem.h>
+#endif
+
+#endif
diff --git a/lib/creaDevManagerLib/wxCreaDevManagerMainFrame.cxx b/lib/creaDevManagerLib/wxCreaDevManagerMainFrame.cxx
new file mode 100644 (file)
index 0000000..a26bc70
--- /dev/null
@@ -0,0 +1,32 @@
+#include <creaWx.h>
+#include "wxCreaDevManagerMainFrame.h"
+
+wxCreaDevManagerMainFrame::wxCreaDevManagerMainFrame(
+  wxWindow* parent,
+  wxWindowID id,
+  const wxString& caption,
+  const wxPoint& pos,
+  const wxSize& size,
+  long style
+)
+{
+  Create(parent, id, caption, pos, size, style);
+}
+
+wxCreaDevManagerMainFrame::~wxCreaDevManagerMainFrame()
+{
+}
+
+bool wxCreaDevManagerMainFrame::Create(
+    wxWindow* parent,
+    wxWindowID id,
+    const wxString& caption,
+    const wxPoint& pos,
+    const wxSize& size,
+    long style
+)
+{
+    wxFrame::Create(parent, id, caption, pos, size, style);
+    return true;
+}
+
diff --git a/lib/creaDevManagerLib/wxCreaDevManagerMainFrame.h b/lib/creaDevManagerLib/wxCreaDevManagerMainFrame.h
new file mode 100644 (file)
index 0000000..f818364
--- /dev/null
@@ -0,0 +1,28 @@
+#ifndef WXCREADEVMANAGERMAINFRAME_H_INCLUDED
+#define WXCREADEVMANAGERMAINFRAME_H_INCLUDED
+
+class wxCreaDevManagerMainFrame:public wxFrame
+{
+  public:
+    wxCreaDevManagerMainFrame(
+      wxWindow* parent,
+      wxWindowID id = -1,
+      const wxString& caption = _("CREATIS CreaDevManager"),
+      const wxPoint& pos = wxDefaultPosition,
+      const wxSize& size = wxDefaultSize,
+      long style = wxDEFAULT_FRAME_STYLE
+    );
+    
+    ~wxCreaDevManagerMainFrame();
+    
+    bool Create(
+      wxWindow* parent,
+      wxWindowID id = -1,
+      const wxString& caption = _("CREATIS CreaDevManager"),
+      const wxPoint& pos = wxDefaultPosition,
+      const wxSize& size = wxDefaultSize,
+      long style = wxDEFAULT_FRAME_STYLE
+    );
+};
+
+#endif
diff --git a/lib/template_lib/CMakeLists.txt b/lib/template_lib/CMakeLists.txt
new file mode 100644 (file)
index 0000000..277d895
--- /dev/null
@@ -0,0 +1,86 @@
+#----------------------------------------------------------------------------
+# USER! : SET THE NAME OF YOUR LIBRARY
+# (Replace 'MyLib' by your own library name)
+
+#############################
+SET ( LIBRARY_NAME   MyLib  )
+#############################
+
+#----------------------------------------------------------------------------
+
+#----------------------------------------------------------------------------
+# CREATES A USER OPTION IN CMAKE
+OPTION ( BUILD_${LIBRARY_NAME}  "Build ${LIBRARY_NAME} library ?" ON)
+#----------------------------------------------------------------------------
+
+#----------------------------------------------------------------------------
+IF ( BUILD_${LIBRARY_NAME} )
+#----------------------------------------------------------------------------
+
+  #----------------------------------------------------------------------------
+  # BUILD LIBRARY
+  #----------------------------------------------------------------------------
+
+  #----------------------------------------------------------------------------
+  # LIBRARY HEADERS (TO BE INSTALLED)
+  # EITHER LIST ALL .h, *.txx IN CURRENT DIR USING NEXT LINE:
+
+  FILE(GLOB ${LIBRARY_NAME}_HEADERS "*.h" "*.txx")
+  
+  # OR MANUALLY LIST YOUR HEADERS WITH NEXT COMMAND
+  #  SET ( ${LIBRARY_NAME}_HEADERS
+  #
+  #      )
+  #----------------------------------------------------------------------------
+
+  #----------------------------------------------------------------------------
+  # LIBRARY SOURCES (TO BE COMPILED)
+  # EITHER LIST ALL .cxx, *.cpp, *.cc IN CURRENT DIR USING NEXT LINE:
+
+  FILE(GLOB ${LIBRARY_NAME}_SOURCES *.cxx *.cpp *.cc)
+
+  # OR MANUALLY LIST YOUR FILES WITH NEXT COMMAND (WITHOUT EXTENSION)
+  #  SET ( ${LIBRARY_NAME}_SOURCES 
+  #   
+  #      )
+  #----------------------------------------------------------------------------
+
+  #----------------------------------------------------------------------------
+  # LIBRARY DEPENDENCIES (LIBRARIES TO LINK WITH)
+  #
+  # USER! : Uncomment the Libraries you need
+  #
+  SET ( ${LIBRARY_NAME}_LINK_LIBRARIES
+  #    ${crea_LIBRARIES}
+  #    ${WXWIDGETS_LIBRARIES}
+  #    ${KWWidgets_LIBRARIES}
+  #    ${VTK_LIBRARIES}
+  #    ${ITK_LIBRARIES}
+  #    ${GDCM_LIBRARIES}
+  #    ${BOOST_LIBRARIES}
+
+  # If this library must link against other libraries 
+  # USER! : Add here any extra Library you need
+
+      )
+  #----------------------------------------------------------------------------
+
+  #----------------------------------------------------------------------------
+  # MACRO WHICH DOES ALL THE JOB : BUILD AND INSTALL
+
+  # USER! : The default is to create a Dynamic Library.
+  # if you need to create a static library
+  # comment out the following line :
+
+  CREA_ADD_LIBRARY( ${LIBRARY_NAME} )
+
+  # and uncomment the 2 lines hereafter:
+
+  # ADD_LIBRARY(${LIBRARY_NAME} STATIC  ${${LIBRARY_NAME}_SOURCES})
+  # TARGET_LINK_LIBRARIES(${LIBRARY_NAME} ${${LIBRARY_NAME}_LINK_LIBRARIES} )
+
+  #
+  #----------------------------------------------------------------------------
+
+  #---------------------------------------------------------------------------
+ENDIF ( BUILD_${LIBRARY_NAME} )
diff --git a/lib/template_lib/creaSystem.h b/lib/template_lib/creaSystem.h
new file mode 100644 (file)
index 0000000..d91ccee
--- /dev/null
@@ -0,0 +1,26 @@
+
+#ifndef _$PROJECT_NAME$SYSTEM_H_
+#define _$PROJECT_NAME$SYSTEM_H_
+
+
+// Windoze related troubles (as usual)
+
+//-----------------------------------------------------------------------------
+
+#if defined(_WIN32)
+  #ifdef $PROJECT_NAME$_EXPORT_SYMBOLS
+    #define $PROJECT_NAME$_EXPORT __declspec( dllexport )
+#else
+    #define $PROJECT_NAME$_EXPORT __declspec( dllimport )
+  #endif
+  #define $PROJECT_NAME$_CDECL __cdecl
+#else
+  #define $PROJECT_NAME$_EXPORT
+  #define $PROJECT_NAME$_CDECL
+#endif // defined(_WIN32)
+
+#ifdef __BORLANDC__
+  #include <mem.h>
+#endif
+
+#endif
diff --git a/lib/template_lib/creaSystem.h.in b/lib/template_lib/creaSystem.h.in
new file mode 100644 (file)
index 0000000..d91ccee
--- /dev/null
@@ -0,0 +1,26 @@
+
+#ifndef _$PROJECT_NAME$SYSTEM_H_
+#define _$PROJECT_NAME$SYSTEM_H_
+
+
+// Windoze related troubles (as usual)
+
+//-----------------------------------------------------------------------------
+
+#if defined(_WIN32)
+  #ifdef $PROJECT_NAME$_EXPORT_SYMBOLS
+    #define $PROJECT_NAME$_EXPORT __declspec( dllexport )
+#else
+    #define $PROJECT_NAME$_EXPORT __declspec( dllimport )
+  #endif
+  #define $PROJECT_NAME$_CDECL __cdecl
+#else
+  #define $PROJECT_NAME$_EXPORT
+  #define $PROJECT_NAME$_CDECL
+#endif // defined(_WIN32)
+
+#ifdef __BORLANDC__
+  #include <mem.h>
+#endif
+
+#endif