]> Creatis software - crea.git/commitdiff
Add sample lib + sample appli
authorjean-pierre roux <jean-pierre.roux@creatis.insa-lyon.fr>
Thu, 31 Mar 2011 23:11:01 +0000 (23:11 +0000)
committerjean-pierre roux <jean-pierre.roux@creatis.insa-lyon.fr>
Thu, 31 Mar 2011 23:11:01 +0000 (23:11 +0000)
appli/creaNewProject/NewProject/appli/CMakeLists.txt
appli/creaNewProject/NewProject/appli/myFierceAppli/CMakeLists.txt [new file with mode: 0644]
appli/creaNewProject/NewProject/appli/myFierceAppli/main.cxx [new file with mode: 0644]
appli/creaNewProject/NewProject/lib/CMakeLists.txt

index 7aa7b130961f9fb052354d638e6ceb3f779feb14..8e41883e58aeae41558674f99fd34bc262b7bdc6 100644 (file)
@@ -1,3 +1,4 @@
 # USER! : Add a ADD_SUBDIRECTORY command for each one of your applications
 # ADD_SUBDIRECTORY(MyApp1)
 # ADD_SUBDIRECTORY(MyApp2)
+ADD_SUBDIRECTORY(myFierceAppli)
diff --git a/appli/creaNewProject/NewProject/appli/myFierceAppli/CMakeLists.txt b/appli/creaNewProject/NewProject/appli/myFierceAppli/CMakeLists.txt
new file mode 100644 (file)
index 0000000..d7e96c4
--- /dev/null
@@ -0,0 +1,64 @@
+#----------------------------------------------------------------------------
+# USER! : SET THE NAME OF YOUR EXECUTABLE
+# Replace 'MyExe' by the name you want to give your executable.
+# (a good policy is to give the executable the same name that the directory)
+
+#########################
+SET ( EXE_NAME   myFierceAppli  )
+#########################
+
+#----------------------------------------------------------------------------
+
+#----------------------------------------------------------------------------
+# EXECUTABLE SOURCES (TO BE COMPILED)
+# EITHER LIST ALL .cxx, *.cpp, *.cc IN CURRENT DIR USING NEXT LINE:
+
+FILE(GLOB ${EXE_NAME}_SOURCES *.cxx *.cpp *.cc)
+
+# OR MANUALLY LIST YOUR FILES WITH NEXT COMMAND (WITHOUT EXTENSION)
+#  SET ( ${EXE_NAME}_SOURCES 
+#   
+#    )
+#----------------------------------------------------------------------------
+
+INCLUDE_DIRECTORIES (
+
+# USER! : Add here the directories holding the extra .h files you need
+# e.g.
+ ../../lib/mySampleLib
+
+)
+
+#----------------------------------------------------------------------------
+# 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 !...) 
+  
+  mySampleLib
+  
+  )
+#----------------------------------------------------------------------------
+
+#----------------------------------------------------------------------------
+# USER! : UNCOMMENT NEXT LINE IF YOU WANT A CONSOLE ON WINDOWS
+# NB : YOUR MAIN MUST BE ADAPTED ALSO
+#      SEE THE MACRO CREA_WXMAIN_WITH_CONSOLE IN creaWx.h
+#SET(${EXE_NAME}_CONSOLE TRUE)
+#----------------------------------------------------------------------------
+
+#----------------------------------------------------------------------------
+# CREATES AND INSTALLS THE EXE
+CREA_ADD_EXECUTABLE( ${EXE_NAME} )
+#----------------------------------------------------------------------------
+
+
diff --git a/appli/creaNewProject/NewProject/appli/myFierceAppli/main.cxx b/appli/creaNewProject/NewProject/appli/myFierceAppli/main.cxx
new file mode 100644 (file)
index 0000000..870943d
--- /dev/null
@@ -0,0 +1,32 @@
+#include <stdio.h>
+#include "myFierceClass.h"
+#include "myFierceClass2.h"
+#include <iostream> // for std::cout
+int main()
+{
+  printf("..Hi..!\n");
+  
+  double u=5.;
+  double v=10.;
+    
+  //
+  // dummy example
+  // 
+  myFierceClass A;
+  double p1=A.Calculate(u, v);
+  std::cout << "result from myFierceClass :" << p1 << std::endl;
+  
+  //
+  // dummy example
+  // with Setters and Getters
+  //
+    
+  myFierceClass2 B;
+  B.SetX(u);
+  B.SetY(v);  
+  B.Execute();
+  double p2=B.GetPercent();
+  std::cout << "result from myFierceClass2 :" << p2 << std::endl;  
+  
+  return 0;
+}
index dd38a155f57c694743922a766a1566a604827986..5d46bdb3cf7009bb8e3a856aa22089c05f870a81 100644 (file)
@@ -2,12 +2,13 @@
 
 # USER! : Set the library name (global one)
 
-  SET(LIBRARY_NAME ___Library_name___here___)
+  SET(LIBRARY_NAME mySampleLib)
+ #  SET(LIBRARY_NAME ___Library_name___here___)
   SET(LIBRARY_NAME_BASE ${LIBRARY_NAME} )
   SET(${LIBRARY_NAME}_INSTALL_FOLDER ${LIBRARY_NAME})
-  
+
 # USER! : Give the list of your Libraries 
+
 SET(${LIBRARY_NAME}_LIBRARIES 
    ___Your_library_one___here___
    ___Your_library_two___here___ 
@@ -18,9 +19,9 @@ SET(${LIBRARY_NAME}_LIBRARIES
 # USER! : Give the list of directories holding the '.h' and '.txx' to be installed
 
  SET(${LIBRARY_NAME}_BUILD_TREE_RELATIVE_INCLUDE_PATHS
-    lib/___Your_include_directory_one___here___
-    lib/___Your_include_directory_two___here___
-    lib/___Your_include_directory_tree___here___    
+    lib/mySampleLib
+  #  lib/___Your_include_directory_two___here___
+  #  lib/___Your_include_directory_tree___here___
  )
 
 # USER! : Hands off, here!
@@ -46,9 +47,9 @@ SET(${LIBRARY_NAME}_LIBRARIES
 
   # Invoke the advanced macro
   CREA_ADVANCED_INSTALL_LIBRARY_FOR_CMAKE(${LIBRARY_NAME})
+
 # USER! : Up to you again, now!
-       
+
 # USER! : Add a ADD_SUBDIRECTORY command for each one of your libraries
-# ADD_SUBDIRECTORY(MyLib1)
+ ADD_SUBDIRECTORY(mySampleLib)