Vous avez reçu un message "Your GitLab account has been locked ..." ? Pas d'inquiétude : lisez cet article https://docs.gricad-pages.univ-grenoble-alpes.fr/help/unlock/

Commit c8517e35 authored by promayon's avatar promayon
Browse files

FIXED remove *.cmake in applications/actionstatemachine (not needed)

FIXED wizard generator code for non-QtCore type initialization
FIXED wizard generator (open bracket not seen in ImageComponent derived + namespace problems in .in files)



git-svn-id: svn+ssh://scm.forge.imag.fr/var/lib/gforge/chroot/scmrepos/svn/camitk/trunk/camitk@552 ec899d31-69d1-42ba-9299-647d76f65fb3
parent 4a7f099c
# - Create launchers to set working directory, env. vars, etc.
#
# include(CreateLaunchers) - to make these available
# guess_runtime_library_dirs(<outputvarname> [<extralibrary> ...])
# create_default_target_launcher(<targetname>
# [ARGS <args...>]
# [FORWARD_ARGS]
# [RUNTIME_LIBRARY_DIRS <dir...>]
# [WORKING_DIRECTORY <dir>]
# [ENVIRONMENT <VAR=value> [<VAR=value>...]]
# [EXTERNAL_COMMAND <path to exe>])
#
# create_target_launcher(<targetname>
# [ARGS <args...>]
# [FORWARD_ARGS]
# [RUNTIME_LIBRARY_DIRS <dir...>]
# [WORKING_DIRECTORY <dir>]
# [ENVIRONMENT <VAR=value> [<VAR=value>...]])
#
# create_generic_launcher(<launchername>
# [RUNTIME_LIBRARY_DIRS <dir...>]
# [WORKING_DIRECTORY <dir>]
# [ENVIRONMENT <VAR=value> [<VAR=value>...]])
# - sets GENERIC_LAUNCHER_COMMAND and GENERIC_LAUNCHER_FAIL_REGULAR_EXPRESSION
#
# Requires these CMake modules:
# ListFilter
# ProgramFilesGlob
# CleanDirectoryList
#
# Requires CMake 2.6 or newer (uses the 'function' command)
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
if(__create_launchers)
return()
endif()
set(__create_launchers YES)
include(CleanDirectoryList)
# We must run the following at "include" time, not at function call time,
# to find the path to this module rather than the path to a calling list file
get_filename_component(_launchermoddir
${CMAKE_CURRENT_LIST_FILE}
PATH)
set(_launchermoddir "${_launchermoddir}/launcher-templates")
macro(_launcher_system_settings)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(BITS 64)
else()
set(BITS 32)
endif()
if(WIN32)
# Find user and system name
set(SYSTEM_NAME $ENV{USERDOMAIN})
set(USER_NAME $ENV{USERNAME})
set(VCPROJ_TYPE vcproj)
set(USERFILE_EXTENSION ${SYSTEM_NAME}.${USER_NAME}.user)
set(LAUNCHER_LINESEP "&#x0A;")
if(MSVC10)
set(LAUNCHER_LINESEP "\n")
set(USERFILE_VC_VERSION 10.00)
set(USERFILE_EXTENSION user)
set(VCPROJ_TYPE vcxproj)
elseif(MSVC90)
set(USERFILE_VC_VERSION 9.00)
elseif(MSVC80)
set(USERFILE_VC_VERSION 8.00)
elseif(MSVC71)
set(USERFILE_VC_VERSION 7.10)
elseif(MSVC)
message(STATUS "MSVC but unrecognized version!")
endif()
if(BITS EQUAL 64)
set(USERFILE_PLATFORM x64)
else()
set(USERFILE_PLATFORM Win${BITS})
endif()
set(_pathdelim ";")
set(_suffix "cmd")
else()
set(_pathdelim ":")
set(USERFILE_PLATFORM ${CMAKE_SYSTEM_NAME}${BITS})
set(_suffix "sh")
find_package(GDB QUIET)
if(GDB_FOUND)
set(LAUNCHERS_GOT_GDB YES)
if(GDB_HAS_RETURN_CHILD_RESULT)
set(LAUNCHERS_GDB_ARG --return-child-result)
endif()
else()
set(LAUNCHERS_GOT_GDB)
endif()
endif()
if(WIN32 AND NOT USERFILE_REMOTE_MACHINE)
site_name(USERFILE_REMOTE_MACHINE)
mark_as_advanced(USERFILE_REMOTE_MACHINE)
endif()
endmacro()
macro(_launcher_process_args)
set(_nowhere)
set(_curdest _nowhere)
set(_val_args
ARGS
RUNTIME_LIBRARY_DIRS
WORKING_DIRECTORY
ENVIRONMENT
EXTERNAL_COMMAND)
set(_bool_args FORWARD_ARGS)
foreach(_arg ${_val_args} ${_bool_args})
set(${_arg})
endforeach()
foreach(_element ${ARGN})
list(FIND _val_args "${_element}" _val_arg_find)
list(FIND _bool_args "${_element}" _bool_arg_find)
if("${_val_arg_find}" GREATER "-1")
set(_curdest "${_element}")
elseif("${_bool_arg_find}" GREATER "-1")
set("${_element}" ON)
set(_curdest _nowhere)
else()
list(APPEND ${_curdest} "${_element}")
endif()
endforeach()
if(_nowhere)
message(FATAL_ERROR
"Syntax error in use of a function in CreateLaunchers!")
endif()
# Turn into a list of native paths
set(_runtime_lib_dirs)
foreach(_dlldir ${RUNTIME_LIBRARY_DIRS})
file(TO_NATIVE_PATH "${_dlldir}" _path)
set(_runtime_lib_dirs "${_runtime_lib_dirs}${_path}${_pathdelim}")
endforeach()
if(NOT WORKING_DIRECTORY)
set(WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")
endif()
if(FORWARD_ARGS)
if(WIN32)
set(FWD_ARGS %*)
else()
set(FWD_ARGS $*)
endif()
else()
set(FWD_ARGS)
endif()
set(USERFILE_WORKING_DIRECTORY "${WORKING_DIRECTORY}")
set(USERFILE_COMMAND_ARGUMENTS "${ARGS}")
set(LAUNCHERSCRIPT_COMMAND_ARGUMENTS "${ARGS} ${FWD_ARGS}")
set(USERFILE_EXTERNAL_COMMAND "${EXTERNAL_COMMAND}")
if(WIN32)
set(RUNTIME_LIBRARIES_ENVIRONMENT "PATH=${_runtime_lib_dirs}%PATH%")
file(READ
"${_launchermoddir}/launcher.env.cmd.in"
_cmdenv)
else()
if(APPLE)
set(RUNTIME_LIBRARIES_ENVIRONMENT
"DYLD_LIBRARY_PATH=${_runtime_lib_dirs}:$DYLD_LIBRARY_PATH")
else()
set(RUNTIME_LIBRARIES_ENVIRONMENT
"LD_LIBRARY_PATH=${_runtime_lib_dirs}:$LD_LIBRARY_PATH")
endif()
file(READ
"${_launchermoddir}/launcher.env.sh.in"
_cmdenv)
endif()
set(USERFILE_ENVIRONMENT "${RUNTIME_LIBRARIES_ENVIRONMENT}")
set(USERFILE_ENV_COMMANDS)
foreach(_arg "${RUNTIME_LIBRARIES_ENVIRONMENT}" ${ENVIRONMENT})
string(CONFIGURE
"@USERFILE_ENVIRONMENT@@LAUNCHER_LINESEP@@_arg@"
USERFILE_ENVIRONMENT
@ONLY)
string(CONFIGURE
"@USERFILE_ENV_COMMANDS@${_cmdenv}"
USERFILE_ENV_COMMANDS
@ONLY)
endforeach()
endmacro()
macro(_launcher_produce_vcproj_user)
if(MSVC)
file(READ
"${_launchermoddir}/perconfig.${VCPROJ_TYPE}.user.in"
_perconfig)
set(USERFILE_CONFIGSECTIONS)
foreach(USERFILE_CONFIGNAME ${CMAKE_CONFIGURATION_TYPES})
get_target_property(USERFILE_${USERFILE_CONFIGNAME}_COMMAND
${_targetname}
LOCATION_${USERFILE_CONFIGNAME})
file(TO_NATIVE_PATH
"${USERFILE_${USERFILE_CONFIGNAME}_COMMAND}"
USERFILE_${USERFILE_CONFIGNAME}_COMMAND)
string(CONFIGURE "${_perconfig}" _temp @ONLY ESCAPE_QUOTES)
string(CONFIGURE
"${USERFILE_CONFIGSECTIONS}${_temp}"
USERFILE_CONFIGSECTIONS
ESCAPE_QUOTES)
endforeach()
configure_file("${_launchermoddir}/${VCPROJ_TYPE}.user.in"
${VCPROJNAME}.${VCPROJ_TYPE}.${USERFILE_EXTENSION}
@ONLY)
endif()
endmacro()
macro(_launcher_produce_vcproj_user_special)
if(MSVC)
file(READ
"${_launchermoddir}/perconfig.${VCPROJ_TYPE}.user.in"
_perconfig)
set(USERFILE_CONFIGSECTIONS)
foreach(USERFILE_CONFIGNAME ${CMAKE_CONFIGURATION_TYPES})
get_target_property(USERFILE_${USERFILE_CONFIGNAME}_COMMAND
${_targetname}
LOCATION_${USERFILE_CONFIGNAME})
# Replacing the OutDir MSVC variable to either Debug or Release dir name
# (this is just in order for the NOT EXISTS test below to work)
if(${USERFILE_CONFIGNAME} STREQUAL "MinSizeRel" OR ${USERFILE_CONFIGNAME} STREQUAL "RelWithDebInfo")
set(TESTING_CONFIG_NAME "Release")
else()
set(TESTING_CONFIG_NAME ${USERFILE_CONFIGNAME})
endif()
# Check existance of the EXTERNAL_COMMAND binary
if(NOT EXISTS USERFILE_${USERFILE_CONFIGNAME}_COMMAND)
string(REPLACE "$(OutDir)" ${TESTING_CONFIG_NAME} USERFILE_EXTERNAL_COMMAND_CMAKE ${USERFILE_EXTERNAL_COMMAND})
if (NOT EXISTS ${USERFILE_EXTERNAL_COMMAND_CMAKE})
#Last try:
string(REPLACE "$(OutDir)" "" USERFILE_EXTERNAL_COMMAND_CMAKE ${USERFILE_EXTERNAL_COMMAND})
if (NOT EXISTS ${USERFILE_EXTERNAL_COMMAND_CMAKE})
message(WARNING "Can not find external command: \"${USERFILE_EXTERNAL_COMMAND}\"\ntested command: \"${USERFILE_EXTERNAL_COMMAND_CMAKE}\"")
else()
#if exist, just replace the MSVC path with user given EXTERNAL_COMMAND
set(USERFILE_${USERFILE_CONFIGNAME}_COMMAND ${USERFILE_EXTERNAL_COMMAND_CMAKE})
endif()
else()
#if exist, just replace the MSVC path with user given EXTERNAL_COMMAND
set(USERFILE_${USERFILE_CONFIGNAME}_COMMAND ${USERFILE_EXTERNAL_COMMAND})
endif()
endif()
file(TO_NATIVE_PATH
"${USERFILE_${USERFILE_CONFIGNAME}_COMMAND}"
USERFILE_${USERFILE_CONFIGNAME}_COMMAND)
string(CONFIGURE "${_perconfig}" _temp @ONLY ESCAPE_QUOTES)
string(CONFIGURE
"${USERFILE_CONFIGSECTIONS}${_temp}"
USERFILE_CONFIGSECTIONS
ESCAPE_QUOTES)
endforeach()
configure_file("${_launchermoddir}/${VCPROJ_TYPE}.user.in"
${VCPROJNAME}.${VCPROJ_TYPE}.${USERFILE_EXTENSION}
@ONLY)
endif()
endmacro()
macro(_launcher_create_target_launcher)
if(CMAKE_CONFIGURATION_TYPES)
# Multi-config generator - multiple launchers
foreach(_config ${CMAKE_CONFIGURATION_TYPES})
get_target_property(USERFILE_${_config}_COMMAND
${_targetname}
LOCATION_${_config})
file(TO_NATIVE_PATH
"${USERFILE_${_config}_COMMAND}"
USERFILE_COMMAND)
configure_file("${_launchermoddir}/targetlauncher.${_suffix}.in"
"${CMAKE_CURRENT_BINARY_DIR}/launch-${_targetname}-${_config}.${_suffix}"
@ONLY)
endforeach()
else()
# Single-config generator - single launcher
get_target_property(USERFILE_COMMAND
${_targetname}
LOCATION)
file(TO_NATIVE_PATH
"${USERFILE_COMMAND}"
USERFILE_COMMAND)
configure_file("${_launchermoddir}/targetlauncher.${_suffix}.in"
"${CMAKE_CURRENT_BINARY_DIR}/launch-${_targetname}.${_suffix}"
@ONLY)
endif()
endmacro()
function(create_default_target_launcher _targetname)
_launcher_system_settings()
_launcher_process_args(${ARGN})
set(VCPROJNAME "${CMAKE_BINARY_DIR}/ALL_BUILD")
_launcher_produce_vcproj_user()
_launcher_create_target_launcher()
endfunction()
function(create_default_target_launcher_special _targetname)
_launcher_system_settings()
_launcher_process_args(${ARGN})
set(VCPROJNAME "${CMAKE_BINARY_DIR}/ALL_BUILD")
_launcher_produce_vcproj_user_special()
_launcher_create_target_launcher()
endfunction()
function(create_target_launcher _targetname)
_launcher_system_settings()
_launcher_process_args(${ARGN})
set(VCPROJNAME "${CMAKE_CURRENT_BINARY_DIR}/${_targetname}")
_launcher_produce_vcproj_user()
_launcher_create_target_launcher()
endfunction()
function(create_generic_launcher _launchername)
_launcher_system_settings()
_launcher_process_args(${ARGN})
if(NOT IS_ABSOLUTE _launchername)
set(_launchername
"${CMAKE_CURRENT_BINARY_DIR}/${_launchername}.${_suffix}")
else()
set(_launchername "${_launchername}.${_suffix}")
endif()
if(WIN32)
set(GENERIC_LAUNCHER_COMMAND "${_launchername}" PARENT_SCOPE)
set(GENERIC_LAUNCHER_FAIL_REGULAR_EXPRESSION)
else()
set(GENERIC_LAUNCHER_COMMAND sh "${_launchername}" PARENT_SCOPE)
set(GENERIC_LAUNCHER_FAIL_REGULAR_EXPRESSION
"Program terminated with signal")
endif()
configure_file("${_launchermoddir}/genericlauncher.${_suffix}.in"
"${_launchername}"
@ONLY)
endfunction()
function(guess_runtime_library_dirs _var)
# Start off with the link directories of the calling listfile's directory
get_directory_property(_libdirs LINK_DIRECTORIES)
# Add additional libraries passed to the function
foreach(_lib ${ARGN})
get_filename_component(_libdir "${_lib}" PATH)
list(APPEND _libdirs "${_libdir}")
endforeach()
# Now, build a list of potential dll directories
set(_dlldirs)
foreach(_libdir ${_libdirs})
# Add the libdir itself
list(APPEND _dlldirs "${_libdir}")
# Look also in libdir/../bin since the dll might not be with the lib
get_filename_component(_libdir "${_libdir}/../bin" ABSOLUTE)
list(APPEND _dlldirs "${_libdir}")
endforeach()
# Only keep the valid, unique directories
clean_directory_list(_dlldirs)
# Return _dlldirs
set(${_var} "${_dlldirs}" PARENT_SCOPE)
endfunction()
# Found this first, but Visual erase the correctly changed .vcproj file...
# Try to fix the QVTK.dll Debug and Realease versions uncompatibility on Windows.
# From here: http://stackoverflow.com/questions/1005901/how-to-set-path-environment-variable-using-cmake-and-visual-studio-to-run-test
# and here: http://www.cmake.org/Wiki/VTK/FAQ#Shared_builds_of_VTK_and_debugging_QVTKWidget_using_Visual_Studio_launcher_system_settings()
# if ( WIN32 )
## Find user and system name
# set(SYSTEM_NAME $ENV{USERDOMAIN} CACHE STRING SystemName)
# message("system name: ${SYSTEM_NAME}")
# set(USER_NAME $ENV{USERNAME} CACHE STRING UserName)
# message("user name: ${USER_NAME}")
## Configure the template file
# set(USER_FILE ${APPLICATION_TARGET_NAME}.vcproj.${SYSTEM_NAME}.${USER_NAME}.user)
# message("user file: ${USER_FILE}")
# find_path(USER_TEMPLATE_PATH UserTemplate.user ${CMAKE_MODULE_PATH})
# message("user template file path: ${USER_TEMPLATE_PATH}")
# configure_file(${USER_TEMPLATE_PATH}/UserTemplate.user ${USER_FILE} @ONLY)
# endif ( WIN32 )
# - Try to find CamiTK
# This module can be used to find CamiTK.
# CamiTK can be either installed (CAMITK_IS_INSTALLED will be set to true) or
# not installed. In the latter this module will use the build directory
#
# Prior to calling find(CamiTK), you can set which version you like to use
# set(CAMITK_VER_MAJ "2")
# set(CAMITK_VER_MIN "1")
#
# Once this module has run, the following variables will be properly defined
# CAMITK_FOUND - system has CamiTK
# CAMITK_INSTALL_ROOT - root installation for CamiTK
# CAMITK_INCLUDE_DIRECTORIES - the CamiTK include directories
# CAMITK_LIBRARIES - link these to use CamiTK
# ...
# and all the other goodies
#
# Once found it is then easy to just use the CamiTK macros
# to build your extensions
# we need at least version 3.0
if(NOT CAMITK_VER_MAJ)
set(CAMITK_VER_MAJ "3")
set(CAMITK_VER_MIN "0")
endif()
# CamiTK short version name we are looking for
set(CAMITK_SHORT_VERSION_STRING "camitk-${CAMITK_VER_MAJ}.${CAMITK_VER_MIN}")
# first check if we can use the build version directly
find_path(CAMITK_ROOT_DIR_GUESS
NAMES CamiTKAPI.h
PATHS ${CMAKE_CURRENT_SOURCE_DIR}/../camitk/core
)
if (CAMITK_ROOT_DIR_GUESS)
set(CAMITK_IS_INSTALLED FALSE)
set(CAMITK_INSTALL_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/..) # default install dir
# camitk is not installed yet, use build dir for include and libs
set(CAMITK_BUILD_ROOT ${CMAKE_CURRENT_BINARY_DIR}/..)
else()
set(CAMITK_IS_INSTALLED TRUE)
endif()
if (NOT CAMITK_INSTALL_ROOT)
# name of the camitk core lib (as defined in CamiTKVariables)
set(CAMITK_CORE_LIB_TEMP "camitkcore")
# directory structure from install dir to look for CamiTKAPI.h
set(CAMITK_INCLUDE_DIR_SUFFIX_TEMP "include/${CAMITK_SHORT_VERSION_STRING}/${CAMITK_CORE_LIB_TEMP}")
# find the caracteristic header using a (reasonably) long good list for the guess
find_path(CAMITK_ROOT_DIR_GUESS_INSTALLED
NAMES CamiTKAPI.h
PATHS "/usr"
"/usr/local"
"C:/Programs"
"C:/Programs/camitk"
"C:/Dev"
"C:/Dev/camitk"
$ENV{CAMITK_DIR}
"${CMAKE_CURRENT_SOURCE_DIR}/.."
"${CMAKE_CURRENT_SOURCE_DIR}/../camitk"
"${CMAKE_CURRENT_SOURCE_DIR}/../camitktimc"
"${CMAKE_CURRENT_SOURCE_DIR}/../camitk-timc"
PATH_SUFFIXES "${CAMITK_INCLUDE_DIR_SUFFIX_TEMP}"
)
mark_as_advanced(CAMITK_ROOT_DIR_GUESS_INSTALLED)
set(CAMITK_VERSION "${CAMITK_VER_MAJ}.${CAMITK_VER_MIN}" CACHE STRING "The CamiTK version to find")
# if guess is alright
if (CAMITK_ROOT_DIR_GUESS_INSTALLED)
string(REGEX REPLACE "${CAMITK_INCLUDE_DIR_SUFFIX_TEMP}" "" CAMITK_INSTALL_ROOT_TEMP ${CAMITK_ROOT_DIR_GUESS_INSTALLED})
set(CAMITK_INSTALL_ROOT ${CAMITK_INSTALL_ROOT_TEMP} CACHE PATH "${CAMITK_SHORT_VERSION_STRING} install root" FORCE)
else()
set(CAMITK_INSTALL_ROOT "" CACHE PATH "${CAMITK_SHORT_VERSION_STRING} install root")
endif()
endif()
if(NOT ${CAMITK_INSTALL_ROOT} EQUAL "")
# advertise the success
message(STATUS "Found ${CAMITK_SHORT_VERSION_STRING}: ${CAMITK_INSTALL_ROOT}")
set(CAMITK_FOUND TRUE)
# Check dependencies
find_package(Qt4 REQUIRED)
include(${QT_USE_FILE})
set (QT_USE_QT3SUPPORT OFF)
set(QT_USE_XML ON)
set(QT_USE_QTXMLPATTERNS ON)
# Find VTK
find_package(VTK REQUIRED)
include(${VTK_USE_FILE})
# set CamiTK build variables
if (CAMITK_IS_INSTALLED)
set (CAMITK_BIN_DIR ${CAMITK_INSTALL_ROOT}/bin CACHE PATH "CamiTK bin dir." FORCE)
set (CAMITK_LIB_DIR ${CAMITK_INSTALL_ROOT}/lib/${CAMITK_SHORT_VERSION_STRING} CACHE PATH "CamiTK lib dir." FORCE)
set (CAMITK_INCLUDE_DIR ${CAMITK_INSTALL_ROOT}/include/${CAMITK_SHORT_VERSION_STRING} CACHE PATH "CamiTK include dir." FORCE)
set (CAMITK_TESTDATA_DIR ${CAMITK_INSTALL_ROOT}/share/${CAMITK_SHORT_VERSION_STRING}/testdata CACHE PATH "CamiTK share dir. for test data" FORCE)
else()
# use build directory to get includes and lib
set (CAMITK_BIN_DIR ${CAMITK_BUILD_ROOT}/bin CACHE PATH "CamiTK bin dir." FORCE)
set (CAMITK_LIB_DIR ${CAMITK_BUILD_ROOT}/lib CACHE PATH "CamiTK lib dir." FORCE)
set (CAMITK_INCLUDE_DIR ${CAMITK_BUILD_ROOT}/include CACHE PATH "CamiTK include dir." FORCE)
set (CAMITK_TESTDATA_DIR ${CAMITK_BUILD_ROOT}/share/testdata CACHE PATH "CamiTK share dir. for test data" FORCE)
endif()
mark_as_advanced(CAMITK_BIN_DIR CAMITK_LIB_DIR CAMITK_INCLUDE_DIR CAMITK_TESTDATA_DIR)
# Needed due to installation reason
link_directories(${CAMITK_INSTALL_ROOT}/lib)
# update module path
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CAMITK_LIB_DIR}/cmake ${CAMITK_INSTALL_ROOT}/camitk/cmake/modules)
# include useful modules
include(CamiTKVariables)
include(CamiTKMacros)
# set install path
set (CMAKE_INSTALL_PREFIX ${CAMITK_INSTALL_ROOT} CACHE PATH "Path to install dir (deduced from CAMITK_INSTALL_ROOT)" FORCE)
# check the following to define the proper output variables for an external extension
# during compilation, set where everything (lib, exe, shared) goes
set (EXTENSION_BUILD_DIR ${CMAKE_BINARY_DIR})
set (EXTENSION_BIN_DIR ${EXTENSION_BUILD_DIR}/bin CACHE PATH "CamiTK extension bin dir." FORCE)
set (EXTENSION_LIB_DIR ${EXTENSION_BUILD_DIR}/lib CACHE PATH "CamiTK extension lib dir." FORCE)
set (EXTENSION_INCLUDE_DIR ${EXTENSION_BUILD_DIR}/include CACHE PATH "CamiTK extension include dir." FORCE)
set (EXTENSION_TESTDATA_DIR ${EXTENSION_BUILD_DIR}/share/testdata CACHE PATH "CamiTK share dir. for test data" FORCE)
# the "normal" user does not need to see this
mark_as_advanced(EXTENSION_BUILD_DIR EXTENSION_BIN_DIR EXTENSION_LIB_DIR EXTENSION_INCLUDE_DIR EXTENSION_TESTDATA_DIR)
# Setup CMake Variable
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${EXTENSION_BIN_DIR} CACHE PATH "Single directory for all runtimes." FORCE)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${EXTENSION_BIN_DIR} CACHE PATH "Single directory for all dynamic/shared libs." FORCE)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${EXTENSION_LIB_DIR} CACHE PATH "Single directory for all archives." FORCE)
# no need to see this
mark_as_advanced ( CMAKE_RUNTIME_OUTPUT_DIRECTORY CMAKE_LIBRARY_OUTPUT_DIRECTORY CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
else()
message(FATAL_ERROR "Cannot find CamiTK core, please set the CAMITK_INSTALL_ROOT variable")
endif()
......@@ -539,6 +539,18 @@ void ActionGenerator::writeCFile() throw (QString) {
textTmp.replace(QRegExp("@PROPERTY_NAME@"), name);
textTmp.replace(QRegExp("@PROPERTY_CPP_NAME@"), cppName);
textTmp.replace(QRegExp("@PROPERTY_NAME_STRING@"), toString);
// QVector3D and QColor are not in QtCore
// but in QtGui, QVariant class could not provide
// a conversion functions or copy constructor
// => the operator QVariant() of these classes is needed
if (type=="QVector3D" || type=="QColor") {
textTmp.replace(QRegExp("@PROPERTY_QVARIANT@"), type);
}
else {
textTmp.replace(QRegExp("@PROPERTY_QVARIANT@"), "QVariant");
}
textTmp.replace(QRegExp("@PROPERTY_VALUE@"), val);
textTmp.replace(QRegExp("@PROPERTY_TOTYPE@"), toType);
addOneProp[indexProp].append(textTmp).append("\n");
......
......@@ -433,6 +433,18 @@ void ComponentGenerator::writeCFile() throw (QString) {
textTmp.replace(QRegExp("@PROPERTY_TYPE@"), type);
textTmp.replace(QRegExp("@PROPERTY_NAME@"), name);
textTmp.replace(QRegExp("@PROPERTY_NAME_STRING@"), toString);
// QVector3D and QColor are not in QtCore
// but in QtGui, QVariant class could not provide
// a conversion functions or copy constructor
// => the operator QVariant() of these classes is needed
if (type=="QVector3D" || type=="QColor") {
textTmp.replace(QRegExp("@PROPERTY_QVARIANT@"), type);
}
else {
textTmp.replace(QRegExp("@PROPERTY_QVARIANT@"), "QVariant");
}
textTmp.replace(QRegExp("@PROPERTY_VALUE@"), val);
textTmp.replace(QRegExp("@PROPERTY_TOTYPE@"), toType);
addOneProp[indexProp].append(textTmp).append("\n");
......