[Ctk-developers] unknown log4qt in non-superbuild

Jean-Christophe Fillion-Robin jchris.fillionr at kitware.com
Thu Sep 29 18:29:35 UTC 2011


Hi Thomas,

Please consider the following use case and associated comments:

#--------------------
# Build Log4Qt standalone
git clone git://github.com/commontk/Log4Qt.git
mkdir Log4Qt-build
cd Log4Qt-build
cmake
-DQT_QMAKE_EXECUTABLE:FILEPATH=/home/jchris/Projects/qtsdk-2010.05/qt/bin/qmake
../Log4Qt && make -j4
#--------------------

#--------------------
# Checkout CTK source
git clone git://github.com/commontk/CTK.git CTK
#--------------------

#--------------------
# Use case1: Build CTK with CTK_SUPERBUILD OFF specifying Log4Qt_DIR
mkdir CTK-UseCase1-build
cmake
-DQT_QMAKE_EXECUTABLE:FILEPATH=/home/jchris/Projects/qtsdk-2010.05/qt/bin/qmake
-DCTK_SUPERBUILD:BOOL=OFF -DCTK_LIB_PluginFramework:BOOL=OFF
-DLog4Qt_DIR:PATH=/home/jchris/Projects/sandbox/Log4Qt-build/
-DBUILD_TESTING:BOOL=OFF ../CTK

=> CMake Error at Libs/Core/CMakeLists.txt:6 (INCLUDE):
  include called with wrong number of arguments.  Include only takes one
file.
#--------------------


#--------------------
# Use case2: Build CTK with CTK_SUPERBUILD ON specifying Log4Qt_DIR
mkdir CTK-UseCase2-build
cmake
-DQT_QMAKE_EXECUTABLE:FILEPATH=/home/jchris/Projects/qtsdk-2010.05/qt/bin/qmake
-DCTK_LIB_PluginFramework:BOOL=OFF
-DLog4Qt_DIR:PATH=/home/jchris/Projects/sandbox/Log4Qt-build/
-DBUILD_TESTING:BOOL=OFF ../CTK

=> It works
#--------------------

Obviously, UseCase1 couldn't be completed. It means, CTK can't be added as a
regular project with CTK_SUPERBUILD:OFF
I could look at the issue next week ... before doing so.
Seems we need to find way to generalize the code in Superbuild.cmake - line
135 to line 156
Sasha> Any suggestions ?

Waiting we find a solution, would it be possible for you to follow what's
done in UseCase2 to have your project compiling and linking.

You could do something like:
Within the /path/to/ThirdParty/CMakeLists.txt

SET(CTK_LIB_PluginFramework OFF)
SET(CTK_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
SET(CTK_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
SET(CTK_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY})
SET(LogQt_DIR "/path/to/Log4Qt-build")
add_subdirectory(CTK)
set(CTK_DIR ${CMAKE_CURRENT_BINARY_DIR}/CTK-build)
find_package(CTK)

Thanks
Jc

On Thu, Sep 29, 2011 at 12:25 PM, Thomas Wolf <thomas.wolf at vision.ee.ethz.ch
> wrote:

> Hello all,
>
> i have some problems with the non superbuild.
> I have a makefile similar along those lines:
>
> add_subdirectory(Log4Qt)
> add_subdirectory(GDCM)
>
> and finally
> add_subdirectory(CTK)
>
> Ibuild my externals directly in my makefile. External_project does not
> work here because another parent project cannot be allowed to be a
> external_project.
>
> Running through configuration step, i get the following:
>
> <---
> EXTERNAL_TARGETS:
> CMake Error at 3rdParty/CTK/CMake/ctkMacroValidateBuildOptions.cmake:202
> (MESSAGE):
>  CTKCore depends on unknown external targets: Log4Qt_LIBRARIES
> Call Stack (most recent call first):
>  3rdParty/CTK/CMakeLists.txt:512 (ctkMacroValidateBuildOptions)
> --->
>
> similar also for GDCM.
>
> if i remove in the CTK main makefiles (ll. 507) the block with
>
>
> #-----------------------------------------------------------------------------
> # Let's make sure the enabled/disabled libraries, plugins or
> applications are coherent
> #
> ctkFunctionGenerateDGraphInput(${CTK_BINARY_DIR} "${target_directories}")
> ctkFunctionGenerateDGraphInput(${CTK_BINARY_DIR} "${target_directories}"
> WITH_EXTERNALS)
> ctkMacroValidateBuildOptions("${CTK_BINARY_DIR}" "${DGraph_EXECUTABLE}"
> "${target_directories}")
>
> it works somehow, at leats throug makefile generation.
>
> is the DGraph executable expecting a 'hard' target, as export?
>
> isn't the Log4Qt target already visible? There's no problem configuring
> and building it in the same makefile, just by disabling CTK..
>
> Regards,
> Thomas
>
> _______________________________________________
> Ctk-developers mailing list
> Ctk-developers at commontk.org
> http://public.kitware.com/cgi-bin/mailman/listinfo/ctk-developers
>



-- 
+1 919 869 8849
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/ctk-developers/attachments/20110929/d8528dc2/attachment.htm>


More information about the Ctk-developers mailing list