Commit d0850f9d authored by saubatn's avatar saubatn
Browse files

UPDATED Camitk SDK configuration OK for Qt5 - VTK6

UPDATED CMake policy to CMake version 3.0
parent b1505255
......@@ -3,7 +3,7 @@
# CamiTK Open Source CEP Set
#
#--------------------------------------------
cmake_minimum_required(VERSION 2.6)
cmake_minimum_required(VERSION 3.0)
project(camitkopensource)
......@@ -48,7 +48,4 @@ if(CAMITK_BINDING_PYTHON)
add_subdirectory(python_sdk)
endif()
camitk_sub_project_validate(CEP_SET)
......@@ -4,13 +4,10 @@
# You should probably NOT modify this file...
# Please edit CEPDescription.cmake instead
#--------------------------------------------
cmake_minimum_required(VERSION 2.6)
include(SDKConfig.cmake)
# Please add your project name inside the project() brackets, e.g. project(myProject)
project(${CEP_NAME})
# project(${CEP_NAME})
# Mini find CamiTK inside SDK
set(CAMITK_DIR ${CMAKE_BINARY_DIR})
......
......@@ -24,11 +24,3 @@ file(GLOB CAMITK_CMAKE_FILES "modules/launcher-templates/*.in")
install(FILES ${CAMITK_CMAKE_FILES}
DESTINATION ${CAMITK_CMAKE_PATH}/launcher-templates
)
# Save the compiler settings so another project can import them.
include(${CMAKE_ROOT}/Modules/CMakeExportBuildSettings.cmake)
cmake_export_build_settings(${CMAKE_CURRENT_BINARY_DIR}/../CamiTKBuildSettings.cmake)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/../CamiTKBuildSettings.cmake"
DESTINATION ${CAMITK_CMAKE_PATH}
)
\ No newline at end of file
......@@ -16,14 +16,14 @@ set(CAMITK_SHORT_VERSION_STRING "camitk-${CAMITK_VERSION_MAJOR}.${CAMITK_VERSION
#-- Check dependencies: Qt and VTK
# Find Qt5
find_package(Qt5 COMPONENTS Core Gui Xml XmlPatterns Widgets Help UiTools OpenGL OpenGLExtensions REQUIRED)
set(CAMITK_QT_COMPONENTS Core Gui Xml XmlPatterns Widgets Help UiTools OpenGL OpenGLExtensions) #the different Qt5 modules we work with
find_package(Qt5 COMPONENTS ${CAMITK_QT_COMPONENTS} REQUIRED)
if (Qt5_FOUND)
message(STATUS "CamiTK SDK : found Qt ${Qt5_VERSION}.")
set(QT_INCLUDE_DIRS ${Qt5Widgets_INCLUDE_DIRS} ${Qt5Core_INCLUDE_DIRS} ${Qt5Gui_INCLUDE_DIRS} ${Qt5Xml_INCLUDE_DIRS} ${Qt5XmlPatterns_INCLUDE_DIRS} ${Qt5Declarative_INCLUDE_DIRS} ${Qt5Help_INCLUDE_DIRS} ${Qt5UiTools_INCLUDE_DIRS} ${Qt5OpenGL_INCLUDE_DIRS} ${Qt5OpenGLExtensions_INCLUDE_DIRS})
else()
message(SEND_ERROR "Failed to find Qt 5.x. This is needed by CamiTK.")
message(SEND_ERROR "CamiTK SDK : Failed to find Qt 5.x. This is needed by the CamiTK SDK.")
endif()
# set (QT_USE_QTXML ON)
# include(${QT_USE_FILE})
# Find VTK
find_package(VTK REQUIRED)
......@@ -122,7 +122,7 @@ set(CAMITK_INCLUDE_DIRECTORIES
${CAMITK_INCLUDE_DIR}/libraries/${CAMITK_CORE_LIB_NAME}
${CAMITK_USER_INCLUDE_DIR}
${CAMITK_BUILD_INCLUDE_DIR}
${QT_INCLUDE_DIR}
${QT_INCLUDE_DIRS}
${VTK_INCLUDE_DIRS}
${CAMITK_BUILD_INCLUDE_DIR}/libraries
)
......@@ -141,7 +141,6 @@ if(MSVC)
)
# list of all core dependencies
set(CAMITK_LIBRARIES
${QT_LIBRARIES}
debug ${VTK_DIR}/vtkCommon${CAMITK_DEBUG_POSTFIX}.lib
optimized vtkCommon
debug ${VTK_DIR}/vtkFiltering${CAMITK_DEBUG_POSTFIX}.lib
......@@ -186,7 +185,6 @@ else()
# if(CMAKE_GENERATOR MATCHES "MinGW Makefiles") # Win32 running with MinGW
# list of all core dependencies
set(CAMITK_LIBRARIES
${QT_LIBRARIES}
vtkCommon
vtkFiltering
vtkGenericFiltering
......@@ -202,27 +200,6 @@ else()
qtpropertybrowser
vtkCharts
)
# else() #Linux (or MacOS) platform.
# # list of all core dependencies
# set(CAMITK_LIBRARIES
# ${QT_LIBRARIES}
# vtkCommon
# vtkFiltering
# vtkGenericFiltering
# vtkGraphics
# vtkHybrid
# vtkImaging
# vtkIO
# vtkRendering
# vtkVolumeRendering
# vtkftgl
# vtkWidgets
# QVTK
# qtpropertybrowser
# )
# endif()
# else()
endif()
mark_as_advanced (CAMITK_CORE_LIB CAMITK_LINK_DIRECTORIES CAMITK_INCLUDE_DIRECTORIES CAMITK_LIBRARIES)
......
......@@ -24,7 +24,6 @@
#! \code
#! camitk_application(
#! [DISABLED]
#! [NEEDS_QT_MODULES]
#! [NEEDS_ITK]
#! [NEEDS_PYTHON]
#! [NEEDS_CEP_LIBRARIES CEPLib1 CEPLib12 ...]
......@@ -40,7 +39,6 @@
#! \endcode
#!
#! \param DISABLED means this is a default application is NOT to be compiled automatically
#! \param NEEDS_QT_MODULES add this if your library depends on Qt modules, such as QtCore, QtGui, QtMultimedia, QtNetwork, QtOpenGL, QtScript, QtScriptTools, QtSql, QtSvg, QtWebkit, QtXml, QtXmlPatterns, QtDeclarative, QtTest
#! \param NEEDS_ITK means this application requires ITK to be compiled / run.
#! \param NEEDS_CEP_LIBRARIES list of needed camitk CEP libraries
#! \param NEEDS_COMPONENT_EXTENSION list of needed component extensions
......@@ -152,6 +150,38 @@ macro(camitk_application)
gather_headers_and_sources(${APPLICATION_NAME})
#########################################################################
# #
# TARGET COMPILATION DEFINITION #
# #
# * Additional sources files to consider at compilation (.cpp) #
# * CMake project target definition #
# #
#########################################################################
# EXTERNAL SOURCES
set(${APPLICATION_NAME}_SOURCES ${${APPLICATION_NAME}_SOURCES} ${${APPLICATION_NAME_CMAKE}_ADDITIONAL_SOURCES})
# APPLE BUNDLE DEFINITIONS
if(APPLE)
set(MACOSX_BUNDLE_INFO_STRING "${APPLICATION_TARGET_NAME} ${CAMITK_SHORT_VERSION_STRING}")
set(MACOSX_BUNDLE_BUNDLE_VERSION "${APPLICATION_TARGET_NAME} ${CAMITK_SHORT_VERSION_STRING}")
set(MACOSX_BUNDLE_LONG_VERSION_STRING "${APPLICATION_TARGET_NAME} ${CAMITK_SHORT_VERSION_STRING}")
set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${CAMITK_SHORT_VERSION_STRING}")
set(MACOSX_BUNDLE_COPYRIGHT "2014 UJF")
set(MACOSX_BUNDLE_ICON_FILE "${CMAKE_CURRENT_SOURCE_DIR}/resources/camitk-${APPLICATION_NAME}.icns")
set(MACOSX_BUNDLE_BUNDLE_NAME "${APPLICATION_TARGET_NAME}")
set(MACOSX_BUNDLE_RESOURCES "${CMAKE_CURRENT_BINARY_DIR}/${APPLICATION_TARGET_NAME}.app/Contents/Resources")
set(MACOSX_BUNDLE_ICON "${MACOSX_BUNDLE_ICON_FILE}")
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${MACOSX_BUNDLE_RESOURCES})
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${MACOSX_BUNDLE_ICON} ${MACOSX_BUNDLE_RESOURCES})
endif()
# CMAKE TARGET DEFINITION
add_executable(${APPLICATION_TARGET_NAME} ${${APPLICATION_NAME}_SOURCES})
#########################################################################
# #
......@@ -653,20 +683,8 @@ macro(camitk_application)
endif()
endif()
# Nico : TODO remove if not necessary
# QT MODULES
# set(QT_MODULES_LIBRARIES)
# if(${APPLICATION_NAME_CMAKE}_NEEDS_QT_MODULES)
# find_package(Qt4 "4.7" COMPONENTS QtCore QtGui QtXml QtXmlPatterns QtWebkit QtOpenGL QtScript QtSQL QtNetwork QtTest REQUIRED)
# if(NOT QT4_FOUND)
# message(SEND_ERROR "${APPLICATION_NAME} : Failed to find Qt 4.7 or greater. This is needed by CamiTK.")
# endif()
# # CMake will add the Qt modules specific include directories
# include(${QT_USE_FILE})
# # Qt additional modules are required for linking
# set(QT_MODULES_LIBRARIES ${QT_LIBRARIES})
# endif()
# QT
qt5_use_modules(${APPLICATION_TARGET_NAME} ${CAMITK_QT_COMPONENTS})
# EXTERNAL LIBRARIES
set(EXTERNAL_LIBRARIES)
......@@ -708,39 +726,6 @@ macro(camitk_application)
#########################################################################
# #
# TARGET COMPILATION DEFINITION #
# #
# * Additional sources files to consider at compilation (.cpp) #
# * CMake project target definition #
# #
#########################################################################
# EXTERNAL SOURCES
set(${APPLICATION_NAME}_SOURCES ${${APPLICATION_NAME}_SOURCES} ${${APPLICATION_NAME_CMAKE}_ADDITIONAL_SOURCES})
# APPLE BUNDLE DEFINITIONS
if(APPLE)
set(MACOSX_BUNDLE_INFO_STRING "${APPLICATION_TARGET_NAME} ${CAMITK_SHORT_VERSION_STRING}")
set(MACOSX_BUNDLE_BUNDLE_VERSION "${APPLICATION_TARGET_NAME} ${CAMITK_SHORT_VERSION_STRING}")
set(MACOSX_BUNDLE_LONG_VERSION_STRING "${APPLICATION_TARGET_NAME} ${CAMITK_SHORT_VERSION_STRING}")
set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${CAMITK_SHORT_VERSION_STRING}")
set(MACOSX_BUNDLE_COPYRIGHT "2014 UJF")
set(MACOSX_BUNDLE_ICON_FILE "${CMAKE_CURRENT_SOURCE_DIR}/resources/camitk-${APPLICATION_NAME}.icns")
set(MACOSX_BUNDLE_BUNDLE_NAME "${APPLICATION_TARGET_NAME}")
set(MACOSX_BUNDLE_RESOURCES "${CMAKE_CURRENT_BINARY_DIR}/${APPLICATION_TARGET_NAME}.app/Contents/Resources")
set(MACOSX_BUNDLE_ICON "${MACOSX_BUNDLE_ICON_FILE}")
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${MACOSX_BUNDLE_RESOURCES})
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${MACOSX_BUNDLE_ICON} ${MACOSX_BUNDLE_RESOURCES})
endif()
# CMAKE TARGET DEFINITION
# add_executable(${APPLICATION_TARGET_NAME} MACOSX_BUNDLE ${${APPLICATION_NAME}_SOURCES})
add_executable(${APPLICATION_TARGET_NAME} ${${APPLICATION_NAME}_SOURCES})
#########################################################################
# #
# CAMITK ACTION / COMPONENT / LIBRARIES DEPENDENCIES #
......
......@@ -10,7 +10,6 @@
#! \code
#! camitk_extension( <type>
#! [DISABLED]
#! [NEEDS_QT_MODULES]
#! [NEEDS_ITK]
#! [NEEDS_LIBXML2]
#! [NEEDS_OPENCV]
......@@ -38,7 +37,6 @@
#! \param <type> = REQUIRED. The selected type of extension you wish to build.
# possible values : ACTION_EXTENSION or COMPONENT_EXTENSION.
#! \param DISABLED = means this is a not a default extension, it will not be compiled automatically
#! \param NEEDS_QT_MODULES = add this if your library depends on Qt modules, such as QtCore, QtGui, QtMultimedia, QtNetwork, QtOpenGL, QtScript, QtScriptTools, QtSql, QtSvg, QtWebkit, QtXml, QtXmlPatterns, QtDeclarative
#! \param NEEDS_ITK = add this if your component needs ITK.
#! Do not forget to add the needed list of ITK libraries in the LIBRARIES parameter
#! \param NEEDS_LIBXML2 = add this if your component needs libxml2
......@@ -190,6 +188,22 @@ macro(camitk_extension)
#########################################################################
# #
# TARGET COMPILATION DEFINITION #
# #
# * Additional sources files to consider at compilation (.cpp) #
# * CMake project target definition #
# #
#########################################################################
# EXTERNAL SOURCES
set(${EXTENSION_NAME_CMAKE}_SOURCES ${${EXTENSION_NAME_CMAKE}_SOURCES} ${${EXTENSION_NAME_CMAKE}_EXTERNAL_SOURCES})
# CMAKE TARGET DEFINITION
add_library(${${TYPE_EXTENSION_CMAKE}_TARGET_NAME} SHARED ${${EXTENSION_NAME_CMAKE}_SOURCES})
#########################################################################
# #
# ADDITIONAL KNOWN EXTERNAL LIBRARY DEPENDENCIES #
......@@ -907,22 +921,9 @@ macro(camitk_extension)
endif()
endif()
# Nico : On le garde ?
# ADDTIONAL QT MODULES
# set(QT_MODULES_LIBRARIES)
# if(${EXTENSION_NAME_CMAKE}_NEEDS_QT_MODULES)
# find_package(Qt4 "4.7" COMPONENTS QtCore QtGui QtXml QtXmlPatterns QtWebkit QtOpenGL QtScript QtSQL QtNetwork QtTest REQUIRED)
# if(NOT QT4_FOUND)
# message(SEND_ERROR "${EXTENSION_NAME} : Failed to find Qt 4.7 or greater. This is needed by CamiTK.")
# endif()
# # CMake will add the Qt modules specific include directories
# include(${QT_USE_FILE})
# # Qt additional modules are required for linking
# set(QT_MODULES_LIBRARIES ${QT_LIBRARIES})
# endif()
# QT
qt5_use_modules(${${TYPE_EXTENSION_CMAKE}_TARGET_NAME} ${CAMITK_QT_COMPONENTS})
# EXTERNAL LIBRARIES
set(EXTERNAL_LIBRARIES)
if(${EXTENSION_NAME_CMAKE}_EXTERNAL_LIBRARIES)
......@@ -962,22 +963,7 @@ macro(camitk_extension)
#########################################################################
# #
# TARGET COMPILATION DEFINITION #
# #
# * Additional sources files to consider at compilation (.cpp) #
# * CMake project target definition #
# #
#########################################################################
# EXTERNAL SOURCES
set(${EXTENSION_NAME_CMAKE}_SOURCES ${${EXTENSION_NAME_CMAKE}_SOURCES} ${${EXTENSION_NAME_CMAKE}_EXTERNAL_SOURCES})
# CMAKE TARGET DEFINITION
add_library(${${TYPE_EXTENSION_CMAKE}_TARGET_NAME} SHARED ${${EXTENSION_NAME_CMAKE}_SOURCES})
#########################################################################
# #
# CAMITK ACTION / COMPONENT / LIBRARIES DEPENDENCIES #
......
......@@ -695,6 +695,7 @@ macro(camitk_library)
set(QT_COMPONENTS Core Gui Xml XmlPatterns Widgets Help UiTools OpenGL OpenGLExtensions)
find_package(Qt5 COMPONENTS ${QT_COMPONENTS} REQUIRED)
if (Qt5_FOUND)
# cmake_policy(SET CMP0020 NEW) # policy for Qt core linking to qtmain.lib
message(STATUS "${LIBRARY_TARGET_NAME}: found Qt ${Qt5_VERSION}.")
set(QT_INCLUDE_DIRS ${Qt5Widgets_INCLUDE_DIRS} ${Qt5Core_INCLUDE_DIRS} ${Qt5Gui_INCLUDE_DIRS} ${Qt5Xml_INCLUDE_DIRS} ${Qt5XmlPatterns_INCLUDE_DIRS} ${Qt5Declarative_INCLUDE_DIRS} ${Qt5Help_INCLUDE_DIRS} ${Qt5UiTools_INCLUDE_DIRS} ${Qt5OpenGL_INCLUDE_DIRS} ${Qt5OpenGLExtensions_INCLUDE_DIRS})
include_directories(${QT_INCLUDE_DIRS})
......
project(cepcoreschema)
# XSD really needed
find_package(XSD REQUIRED)
......
project(cepgenerator)
#set (CEPGENERATOR_H
# CepGenerator.h
#)
#
#set (CEPGENERATOR_SRCS
# CepGenerator.cpp
#)
gather_headers_and_sources(CEPGENERATOR)
camitk_library( STATIC
SOURCES ${CEPGENERATOR_HEADERS} ${CEPGENERATOR_SOURCES}
......
project(QTPROPERTYBROWSER)
# For last version of this code see
# http://qt.gitorious.org/qt-solutions/qt-solutions/trees/master/qtpropertybrowser
cmake_minimum_required(VERSION 2.6)
# Is this tool is compiled inside or outside CAMITK (as a standalone)?
if (NOT CEP_NAME STREQUAL "SDK")
# if this tool is compiled independently from CamiTK
......
......@@ -3,7 +3,6 @@
# CamiTK Open Source CEP Set
#
#--------------------------------------------
cmake_minimum_required(VERSION 2.6)
camitk_application( ADDITIONAL_SOURCES CommandLineOptions.cxx CommandLineOptions.hxx CommandLineOptions.ixx
CEP_NAME SDK
DESCRIPTION "Test application to test actions"
......
......@@ -3,7 +3,6 @@
# CamiTK Open Source CEP Set
#
#--------------------------------------------
cmake_minimum_required(VERSION 2.6)
camitk_application( CEP_NAME SDK
ADDITIONAL_SOURCES CommandLineOptions.cxx CommandLineOptions.hxx CommandLineOptions.ixx
DESCRIPTION "Test application to load components and interact with them"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment