From: jean-pierre roux Date: Thu, 18 Mar 2010 17:21:05 +0000 (+0000) Subject: Some upgrades to creaNewProject X-Git-Tag: CREATOOLS.2-0-3~30 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=8b33ec17a57e0e04a97f1bbbf5e931b194be425e;p=crea.git Some upgrades to creaNewProject --- diff --git a/appli/creaNewProject/NewProject/CMakeLists.txt.in b/appli/creaNewProject/NewProject/CMakeLists.txt.in index e572480..3190820 100644 --- a/appli/creaNewProject/NewProject/CMakeLists.txt.in +++ b/appli/creaNewProject/NewProject/CMakeLists.txt.in @@ -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) #================================== diff --git a/appli/creaNewProject/NewProject/README.txt b/appli/creaNewProject/NewProject/README.txt index 9e67de7..9ab33d5 100644 --- a/appli/creaNewProject/NewProject/README.txt +++ b/appli/creaNewProject/NewProject/README.txt @@ -1,2 +1,3 @@ +USER! Put here your module name. -(c) CREATIS 2009 \ No newline at end of file +(c) CREATIS 2009 diff --git a/appli/creaNewProject/NewProject/appli/CMakeLists.txt b/appli/creaNewProject/NewProject/appli/CMakeLists.txt index 8a16d76..6dfac6b 100644 --- a/appli/creaNewProject/NewProject/appli/CMakeLists.txt +++ b/appli/creaNewProject/NewProject/appli/CMakeLists.txt @@ -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) diff --git a/appli/creaNewProject/NewProject/lib/CMakeLists.txt b/appli/creaNewProject/NewProject/lib/CMakeLists.txt index bfbe22f..eabdd32 100644 --- a/appli/creaNewProject/NewProject/lib/CMakeLists.txt +++ b/appli/creaNewProject/NewProject/lib/CMakeLists.txt @@ -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) + diff --git a/appli/creaNewProject/NewProject/lib/template_lib/CMakeLists.txt b/appli/creaNewProject/NewProject/lib/template_lib/CMakeLists.txt index 2b42170..277d895 100644 --- a/appli/creaNewProject/NewProject/lib/template_lib/CMakeLists.txt +++ b/appli/creaNewProject/NewProject/lib/template_lib/CMakeLists.txt @@ -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} ) - + # #----------------------------------------------------------------------------