From 9ba13bfb4c06c4c8d8fa6fe266abcce307edb2b7 Mon Sep 17 00:00:00 2001 From: Daniel Gonzalez Date: Fri, 19 Oct 2012 10:11:11 +0000 Subject: [PATCH] Feature #1711 CreaDevManager application implementation: application creation in crea project --- .cvsignore | 2 + CMakeLists.txt | 1 + appli/CMakeLists.txt | 1 + appli/creaDevManager/CMakeLists.txt | 47 ++++++++++ appli/creaDevManager/creaDevManager.cpp | 25 ++++++ appli/creaDevManager/creaDevManager.h | 21 +++++ lib/CMakeLists.txt | 6 ++ lib/creaDevManagerLib/CMakeLists.txt | 86 +++++++++++++++++++ lib/creaDevManagerLib/creaSystem.h | 26 ++++++ lib/creaDevManagerLib/creaSystem.h.in | 26 ++++++ .../wxCreaDevManagerMainFrame.cxx | 32 +++++++ .../wxCreaDevManagerMainFrame.h | 28 ++++++ lib/template_lib/CMakeLists.txt | 86 +++++++++++++++++++ lib/template_lib/creaSystem.h | 26 ++++++ lib/template_lib/creaSystem.h.in | 26 ++++++ 15 files changed, 439 insertions(+) create mode 100644 .cvsignore create mode 100644 appli/creaDevManager/CMakeLists.txt create mode 100644 appli/creaDevManager/creaDevManager.cpp create mode 100644 appli/creaDevManager/creaDevManager.h create mode 100644 lib/CMakeLists.txt create mode 100644 lib/creaDevManagerLib/CMakeLists.txt create mode 100644 lib/creaDevManagerLib/creaSystem.h create mode 100644 lib/creaDevManagerLib/creaSystem.h.in create mode 100644 lib/creaDevManagerLib/wxCreaDevManagerMainFrame.cxx create mode 100644 lib/creaDevManagerLib/wxCreaDevManagerMainFrame.h create mode 100644 lib/template_lib/CMakeLists.txt create mode 100644 lib/template_lib/creaSystem.h create mode 100644 lib/template_lib/creaSystem.h.in diff --git a/.cvsignore b/.cvsignore new file mode 100644 index 0000000..86b18f5 --- /dev/null +++ b/.cvsignore @@ -0,0 +1,2 @@ +.cproject +.project diff --git a/CMakeLists.txt b/CMakeLists.txt index 18c71df..2593cf6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/appli/CMakeLists.txt b/appli/CMakeLists.txt index 8257392..bb80882 100644 --- a/appli/CMakeLists.txt +++ b/appli/CMakeLists.txt @@ -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 index 0000000..13ff79f --- /dev/null +++ b/appli/creaDevManager/CMakeLists.txt @@ -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/ +../../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 index 0000000..b5c1a65 --- /dev/null +++ b/appli/creaDevManager/creaDevManager.cpp @@ -0,0 +1,25 @@ +#include +#include +#include // 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 index 0000000..7e76ae8 --- /dev/null +++ b/appli/creaDevManager/creaDevManager.h @@ -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 index 0000000..2531113 --- /dev/null +++ b/lib/CMakeLists.txt @@ -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 index 0000000..55de26d --- /dev/null +++ b/lib/creaDevManagerLib/CMakeLists.txt @@ -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 index 0000000..d91ccee --- /dev/null +++ b/lib/creaDevManagerLib/creaSystem.h @@ -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 +#endif + +#endif diff --git a/lib/creaDevManagerLib/creaSystem.h.in b/lib/creaDevManagerLib/creaSystem.h.in new file mode 100644 index 0000000..d91ccee --- /dev/null +++ b/lib/creaDevManagerLib/creaSystem.h.in @@ -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 +#endif + +#endif diff --git a/lib/creaDevManagerLib/wxCreaDevManagerMainFrame.cxx b/lib/creaDevManagerLib/wxCreaDevManagerMainFrame.cxx new file mode 100644 index 0000000..a26bc70 --- /dev/null +++ b/lib/creaDevManagerLib/wxCreaDevManagerMainFrame.cxx @@ -0,0 +1,32 @@ +#include +#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 index 0000000..f818364 --- /dev/null +++ b/lib/creaDevManagerLib/wxCreaDevManagerMainFrame.h @@ -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 index 0000000..277d895 --- /dev/null +++ b/lib/template_lib/CMakeLists.txt @@ -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 index 0000000..d91ccee --- /dev/null +++ b/lib/template_lib/creaSystem.h @@ -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 +#endif + +#endif diff --git a/lib/template_lib/creaSystem.h.in b/lib/template_lib/creaSystem.h.in new file mode 100644 index 0000000..d91ccee --- /dev/null +++ b/lib/template_lib/creaSystem.h.in @@ -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 +#endif + +#endif -- 2.47.1