Commit 367c2360 authored by saubatn's avatar saubatn

FIXED CEP architecture, step #1.5: Debug ExtensionManager to load the correct...

FIXED CEP architecture, step #1.5: Debug ExtensionManager to load the correct DLL on Debug / Release using MSVC.
                                   Add link directory for building camitk-core in Debug.

git-svn-id: svn+ssh://scm.forge.imag.fr/var/lib/gforge/chroot/scmrepos/svn/camitk/trunk/camitk@747 ec899d31-69d1-42ba-9299-647d76f65fb3
parent 15ed333b
......@@ -26,13 +26,16 @@ set(CAMITKCORE_LIBRARY_PROPERTIES ${CAMITKCORE_LIBRARY_PROPERTIES}
SOVERSION "${CAMITK_VERSION_MAJOR}"
)
# link directories
link_directories(${CAMITK_BUILD_BIN_DIR})
# camitkcore only depends on qtpropertybrowser, which is a public library
# add the library path as an additionnal to look for.
link_directories(${CAMITK_BUILD_PUBLIC_LIB_DIR})
message("Core is looking for qtpropertybrowser in ${CAMITK_BUILD_PUBLIC_LIB_DIR}")
# CAMITK_CORE_LIB needs to be SHARED and loaded only ONCE otherwise the extensions
# can have their own copy of CAMITK_CORE_LIB, which will generates loads of problems
# because of the Singleton design pattern and various factory bits in CAMITK_CORE_LIB.
add_library(${CAMITK_CORE_LIB} SHARED ${${CAMITK_CORE_LIB}_SOURCES})
# Update XML Project description adding this target as a subproject of the main CamiTK project with
# its dependencies (in the CMake target point of view)
camitk_sub_project_add(CORELIB ${CAMITK_CORE_LIB})
......@@ -50,17 +53,17 @@ target_link_libraries(${CAMITK_CORE_LIB} ${CAMITK_LIBRARIES})
# output directory
if (WIN32 AND MSVC)
set_target_properties(${CAMITK_CORE_LIB} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CAMITK_BUILD_BIN_DIR}
LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CAMITK_BUILD_BIN_DIR}
LIBRARY_OUTPUT_DIRECTORY_RELEASE ${CAMITK_BUILD_BIN_DIR}
set_target_properties(${CAMITK_CORE_LIB} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CAMITK_BUILD_PUBLIC_LIB_DIR}
LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CAMITK_BUILD_PUBLIC_LIB_DIR}
LIBRARY_OUTPUT_DIRECTORY_RELEASE ${CAMITK_BUILD_PUBLIC_LIB_DIR}
)
set_target_properties(${CAMITK_CORE_LIB} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CAMITK_BUILD_BIN_DIR}
RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CAMITK_BUILD_BIN_DIR}
RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CAMITK_BUILD_BIN_DIR}
set_target_properties(${CAMITK_CORE_LIB} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CAMITK_BUILD_PUBLIC_LIB_DIR}
RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CAMITK_BUILD_PUBLIC_LIB_DIR}
RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CAMITK_BUILD_PUBLIC_LIB_DIR}
)
set_target_properties(${CAMITK_CORE_LIB} PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${CAMITK_BUILD_BIN_DIR}
ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CAMITK_BUILD_BIN_DIR}
ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CAMITK_BUILD_BIN_DIR}
set_target_properties(${CAMITK_CORE_LIB} PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${CAMITK_BUILD_PUBLIC_LIB_DIR}
ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CAMITK_BUILD_PUBLIC_LIB_DIR}
ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CAMITK_BUILD_PUBLIC_LIB_DIR}
)
else()
set_target_properties(${CAMITK_CORE_LIB} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CAMITK_BUILD_PUBLIC_LIB_DIR})
......
......@@ -95,10 +95,10 @@ void ExtensionManager::loadComponentExtension(QDir extensionsDir) {
// loop to load component plugin, taking into account internal dependencies (i.e. dependency between
// one component and another one.
QStringList pluginFileNames = extensionsDir.entryList(getExtensionFilter(), QDir::Files);
if (Core::isDebugBuild()) {
if (!Core::isDebugBuild()) {
pluginFileNames.replaceInStrings(QString(Core::debugPostfix),"").removeDuplicates();
}
// if there is more than 5 dependency levels, then you have two choices:
// - consider simplifying your component
// - increase maxNumberOfTries
......@@ -320,7 +320,7 @@ void ExtensionManager::loadActionExtension(QDir actionsDir) {
// one action and another one.
int i = 0;
QStringList extensionFileNames = actionsDir.entryList(getExtensionFilter(), QDir::Files);
if (Core::isDebugBuild()) {
if (!Core::isDebugBuild()) {
extensionFileNames.replaceInStrings(QString(Core::debugPostfix),"").removeDuplicates();
}
......
Markdown is supported
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