]> Creatis software - crea.git/commitdiff
Some upgrades to creaNewProject
authorjean-pierre roux <jean-pierre.roux@creatis.insa-lyon.fr>
Thu, 18 Mar 2010 17:21:05 +0000 (17:21 +0000)
committerjean-pierre roux <jean-pierre.roux@creatis.insa-lyon.fr>
Thu, 18 Mar 2010 17:21:05 +0000 (17:21 +0000)
appli/creaNewProject/NewProject/CMakeLists.txt.in
appli/creaNewProject/NewProject/README.txt
appli/creaNewProject/NewProject/appli/CMakeLists.txt
appli/creaNewProject/NewProject/lib/CMakeLists.txt
appli/creaNewProject/NewProject/lib/template_lib/CMakeLists.txt

index e57248001773b871ab75f7c4b1e032d1744ee19f..3190820459c1b11d8db3f77129b13c718083ead9 100644 (file)
@@ -36,16 +36,21 @@ SET(PROJECT_VERSION_DATE "11/02/2010")
 #ADD_DEFINITIONS( -DPROJECT_VERSION_DATE=${PROJECT_VERSION_DATE} )
 
 #==================================
-
+SET(CREA_VERBOSE_CMAKE TRUE)
 #==================================
 # Find crea (mandatory, to use macros)
-SET(CREA_VERBOSE_CMAKE TRUE)
 FIND_PACKAGE(crea REQUIRED)
 IF (crea_FOUND)
   INCLUDE(${crea_USE_FILE})
 ENDIF(crea_FOUND)
 #==================================
 
+# USER! Add here as many 'FIND_PACKAGE' blocks as *your* aplication requires
+#FIND_PACKAGE(xxx REQUIRED)
+#IF (xxx_FOUND)
+#  INCLUDE(${xxx_USE_FILE})
+#ENDIF(xxx_FOUND)
+
 #==================================
 # Do not allow to build inside the source tree
 CREA_PREVENT_IN_SOURCE_BUILD()
@@ -95,15 +100,15 @@ MARK_AS_ADVANCED(
 #==================================
 
   SET(LIBNAME $(PROJECT_NAME))
+  
   INCLUDE_DIRECTORIES(
     ${PROJECT_BINARY_DIR}
+  )
+  
+ # USER!   Add here the directories holding the .h you need   
+ # INCLUDE_DIRECTORIES(appli/_YOUR_OWN_APPLI_SOURCE_DIRECTORY_)  
+ # INCLUDE_DIRECTORIES(lib/_YOUR_OWN_LIBRARY_SOURCE_DIRECTORY_)  
 
- # // if the previous one is not enough :  (JPRx)
- #   Add here the directories holding the .h you need
-    
- #   ${PROJECT_SOURCE_DIR}/lib/_YOUR_OWN_LIBRARY_SOURCE_DIRECTORY_
-   )
 #==================================
 
 
@@ -123,5 +128,6 @@ SET(BBTK_DOC_BUILD_PATH
 SUBDIRS(lib)
 SUBDIRS(appli)
 SUBDIRS(doc)
+SUBDIRS(data)
 SUBDIRS(install)
 #==================================
index 9e67de7ca27979cde02420653b0cfecdf7506502..9ab33d57ee4e5d2557f5e21807bf1ae5f2566376 100644 (file)
@@ -1,2 +1,3 @@
+USER! Put here your module name.
 <your Module>
-(c) CREATIS 2009
\ No newline at end of file
+(c) CREATIS 2009
index 8a16d76e60d227717ba135637733e188314e846f..6dfac6b5b9d4dc1da34a1db9d23538f37d72123b 100644 (file)
@@ -1,3 +1,3 @@
-# Add a SUBDIRS command for each one of your applications
+# USER! : Add a SUBDIRS command for each one of your applications
 # SUBDIRS(MyApp1)
 # SUBDIRS(MyApp2)
index bfbe22f4fd835765bdd1f92485e079d21cd96569..eabdd321954f4339c905588058e8d34b52904d0d 100644 (file)
@@ -1,2 +1,54 @@
-# Add a SUBDIRS command for each one of your libraries
+# Settings for macro CREA_ADVANCED_INSTALL_LIBRARY_FOR_CMAKE :
+
+# USER! : Set the library name (global one)
+
+  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___ 
+   ___Your_library_tree___here___     
+
+   )
+
+# 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___    
+ )
+
+# USER! : Hands off, here!
+
+  IF ( ${PROJECT_BINARY_DIR} STREQUAL ${EXECUTABLE_OUTPUT_PATH} )
+    SET(CILFC_EXECUTABLE_OUTPUT_REL_PATH ".")
+  ELSE ( ${PROJECT_BINARY_DIR} STREQUAL ${EXECUTABLE_OUTPUT_PATH} )
+    FILE(RELATIVE_PATH 
+      CILFC_EXECUTABLE_OUTPUT_REL_PATH
+      ${PROJECT_BINARY_DIR} ${EXECUTABLE_OUTPUT_PATH})
+  ENDIF ( ${PROJECT_BINARY_DIR} STREQUAL ${EXECUTABLE_OUTPUT_PATH} )
+
+  IF(UNIX)
+    SET(${LIBRARY_NAME}_BUILD_TREE_RELATIVE_LIBRARY_PATHS 
+      ${CILFC_EXECUTABLE_OUTPUT_REL_PATH})
+    SET(${LIBRARY_NAME}_INSTALL_TREE_RELATIVE_LIBRARY_PATHS lib)
+  ELSE(UNIX)
+    SET(${LIBRARY_NAME}_BUILD_TREE_RELATIVE_LIBRARY_PATHS 
+      ${CILFC_EXECUTABLE_OUTPUT_REL_PATH})
+    SET(${LIBRARY_NAME}_INSTALL_TREE_RELATIVE_LIBRARY_PATHS bin)
+  ENDIF(UNIX)
+  SET(${LIBRARY_NAME}_INSTALL_TREE_RELATIVE_INCLUDE_PATHS include/${LIBRARY_NAME})
+
+  # Invoke the advanced macro
+  CREA_ADVANCED_INSTALL_LIBRARY_FOR_CMAKE(${LIBRARY_NAME})
+# USER! : Up to you again, now!
+       
+# USER! : Add a SUBDIRS command for each one of your libraries
 # SUBDIRS(MyLib1)
+
index 2b4217020c017ccd8d885fef0b83c2fca2b3ba29..277d89575474565b8bdb568f46b656b4db956b14 100644 (file)
@@ -1,5 +1,5 @@
 #----------------------------------------------------------------------------
-# SET THE NAME OF YOUR LIBRARY
+# USER! : SET THE NAME OF YOUR LIBRARY
 # (Replace 'MyLib' by your own library name)
 
 #############################
@@ -24,7 +24,7 @@ IF ( BUILD_${LIBRARY_NAME} )
   #----------------------------------------------------------------------------
   # 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
@@ -36,9 +36,9 @@ IF ( BUILD_${LIBRARY_NAME} )
   #----------------------------------------------------------------------------
   # 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 
   #   
@@ -48,7 +48,7 @@ IF ( BUILD_${LIBRARY_NAME} )
   #----------------------------------------------------------------------------
   # LIBRARY DEPENDENCIES (LIBRARIES TO LINK WITH)
   #
-  # Uncomment the Libraries you need
+  # USER! : Uncomment the Libraries you need
   #
   SET ( ${LIBRARY_NAME}_LINK_LIBRARIES
   #    ${crea_LIBRARIES}
@@ -58,27 +58,27 @@ IF ( BUILD_${LIBRARY_NAME} )
   #    ${ITK_LIBRARIES}
   #    ${GDCM_LIBRARIES}
   #    ${BOOST_LIBRARIES}
-  
+
   # If this library must link against other libraries 
-  # Add here any extra Library you need
-  
+  # USER! : Add here any extra Library you need
+
       )
   #----------------------------------------------------------------------------
 
   #----------------------------------------------------------------------------
   # MACRO WHICH DOES ALL THE JOB : BUILD AND INSTALL
-  
-  # The default is to create a Dynamic Library.
+
+  # 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} )
-  
+
   #
   #----------------------------------------------------------------------------