X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=vv%2FCMakeLists.txt;h=81fbf6012dd618aaa48dd787538ea80276c0d0f2;hb=f6bb8a03a46a0fdb5bb77f2751963b29bb19a682;hp=4d5c36b1292e1c1ad4398697ccb3daae66aceebe;hpb=20b024a1acc712ffbd3aeb5628c4f9cb41b51fb4;p=clitk.git diff --git a/vv/CMakeLists.txt b/vv/CMakeLists.txt index 4d5c36b..81fbf60 100644 --- a/vv/CMakeLists.txt +++ b/vv/CMakeLists.txt @@ -128,17 +128,28 @@ QT4_WRAP_UI(vv_UI_CXX QT4_ADD_RESOURCES(vv_SRCS vvIcons.qrc) -#Add the autotools and the common files ui +# Add the autotools in the header vvToolsList.h for initialization of the dummy +# variables in vv.cxx for the tools contained in vvLib +file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/vvToolsList.h) +foreach(tool ${vv_TOOLS}) + FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/vvToolsList.h "#include \"${tool}.h\"\n") + FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/vvToolsList.h "extern const vvToolCreator<${tool}> *dummy${tool};\n") + FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/vvToolsList.h "const vvToolCreator<${tool}> *dummy${tool}2 = dummy${tool};\n\n") +endforeach(tool) + +# Add the autotools and the common files ui foreach(tool ${vv_TOOLS} ${vv_COMMON_WITH_UI}) SET(vv_SRCS ${vv_SRCS} ${tool}.cxx) QT4_WRAP_CPP(vv_SRCS ${tool}.h) QT4_WRAP_UI(vv_UI_CXX qt_ui/${tool}.ui) endforeach(tool) -#Add the common source files + +# Add the common source files foreach(tool ${vv_COMMON}) SET(vv_SRCS ${vv_SRCS} ${tool}.cxx) QT4_WRAP_CPP(vv_SRCS ${tool}.h) endforeach(tool) + # if Windows and Qt was built as a static lib then don't set QT_DLL flag SET(QT_STATIC 0) IF (WIN32) @@ -181,10 +192,6 @@ INCLUDE_DIRECTORIES( ../segmentation ) -IF(WIN32) - SET(EXE_ICON vvIcon.rc) -ENDIF(WIN32) - LINK_DIRECTORIES(${QT_LIBRARY_DIR}) #========================================================= #Add each tool's dependencies @@ -198,13 +205,20 @@ SET(foundationLibraries clitkCommon ${ITK_LIBRARIES} QVTK vtkHybrid) #========================================================= #Create binary and libs for tests -SET(vvExternalLibs clitkSegmentationGgoLib clitkDicomRTStruct ${toolLibs} ${foundationLibraries} CACHE INTERNAL DOCSTRING) -ADD_EXECUTABLE(vv ${vv_SRCS} vv.cxx ${vv_UI_CXX} ${EXE_ICON}) -ADD_DEPENDENCIES(vv clitkSegmentationGgoLib) -IF(BUILD_TESTING) - target_link_libraries(vv ${vvExternalLibs}) - add_library(vvLib ${vv_SRCS} vv.cxx ${vv_UI_CXX} ${EXE_ICON}) -ENDIF(BUILD_TESTING) +SET(vvExternalLibs clitkSegmentationGgoLib clitkDicomRTStruct ${toolLibs} ${foundationLibraries}) + +ADD_LIBRARY(vvLib ${vv_SRCS} ${vv_UI_CXX}) +TARGET_LINK_LIBRARIES(vvLib ${vvExternalLibs}) + +IF(WIN32) + ADD_EXECUTABLE(vv WIN32 vv.cxx vvIcon.rc) +ELSE(WIN32) + ADD_EXECUTABLE(vv vv.cxx) +ENDIF(WIN32) + +TARGET_LINK_LIBRARIES(vv vvLib) + + #========================================================= # Install options (also used by CPack) IF(UNIX AND NOT APPLE) @@ -238,7 +252,7 @@ SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/ReadMe.txt") SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/License.txt") SET(CPACK_PACKAGE_VERSION_MAJOR "1") SET(CPACK_PACKAGE_VERSION_MINOR "2") -SET(CPACK_PACKAGE_VERSION_PATCH "0") +SET(CPACK_PACKAGE_VERSION_PATCH "1") SET(CPACK_PACKAGE_INSTALL_DIRECTORY "vv") SET(CPACK_STRIP_FILES TRUE) @@ -262,5 +276,5 @@ ENDIF(WIN32) INCLUDE(CPack) #========================================================= #========================================================= -configure_file(vvCommon.h.in vvCommon.h) -#========================================================= \ No newline at end of file +configure_file(vvConfiguration.h.in vvConfiguration.h) +#=========================================================