Skip to content

Commit 6fe1a93

Browse files
author
Daniele Giunchi
committed
empty external project macro added
1 parent dac09f4 commit 6fe1a93

File tree

5 files changed

+54
-1
lines changed

5 files changed

+54
-1
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#
2+
# CMakeLists.txt
3+
# MAF
4+
#
5+
# Created by Daniele Giunchi - Paolo Quadrani on 10/09/10.
6+
# Copyright 2009 B3C. All rights reserved.
7+
#
8+
# See Licence at: http://tiny.cc/QXJ4D
9+
#
10+
#
11+
12+
###########################################################################
13+
#
14+
# Library: CTK
15+
#
16+
# Copyright (c) Kitware Inc.
17+
#
18+
# Licensed under the Apache License, Version 2.0 (the "License");
19+
# you may not use this file except in compliance with the License.
20+
# You may obtain a copy of the License at
21+
#
22+
# http://www.commontk.org/LICENSE
23+
#
24+
# Unless required by applicable law or agreed to in writing, software
25+
# distributed under the License is distributed on an "AS IS" BASIS,
26+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
27+
# See the License for the specific language governing permissions and
28+
# limitations under the License.
29+
#
30+
###########################################################################
31+
32+
#
33+
# Convenient macro allowing to define a "empty" project in case an external one is provided
34+
# using for example <proj>_DIR.
35+
# Doing so allows to keep the external project dependency system happy.
36+
#
37+
macro(mafMacroEmptyExternalProject proj dependencies)
38+
39+
ExternalProject_Add(${proj}
40+
SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj}
41+
BINARY_DIR ${proj}-build
42+
DOWNLOAD_COMMAND ""
43+
CONFIGURE_COMMAND ""
44+
BUILD_COMMAND ""
45+
INSTALL_COMMAND ""
46+
DEPENDS
47+
${dependencies}
48+
)
49+
endmacro()

CMakeExternals/External_QtSOAP.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ SET(QtSOAP_DEPENDS)
3333
# library output directory to CTK_EXTERNAL_LIBRARY_DIRS
3434

3535
ELSE()
36+
include(CMake/mafMacroEmptyExternalProject.cmake)
3637
mafMacroEmptyExternalProject(${proj} "${proj_DEPENDENCIES}")
3738
ENDIF()
3839

CMakeExternals/External_VTK.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ if(NOT DEFINED VTK_DIR OR NOT DEFINED VTK_SOURCE_DIR)
4141
#if (MAF_USE_PYTHONQT)
4242
# list(APPEND VTK_QT_ARGS -DVTK_USE_TK:BOOL=OFF)
4343
#endif()
44-
44+
4545
ExternalProject_Add(${proj}
4646
GIT_REPOSITORY "${git_protocol}://vtk.org/VTK.git"
4747
#GIT_TAG "origin"
@@ -82,6 +82,7 @@ CMAKE_ARGS
8282
else()
8383
# The project is provided using VTK_DIR and VTK_SOURCE_DIR, nevertheless since other
8484
# project may depend on VTK, let's add an 'empty' one
85+
include(CMake/mafMacroEmptyExternalProject.cmake)
8586
mafMacroEmptyExternalProject(${proj} "${VTK_DEPENDENCIES}")
8687
endif()
8788

CMakeExternals/External_VXL.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ SET(VXL_DEPENDS)
5454
# library output directory to CTK_EXTERNAL_LIBRARY_DIRS
5555

5656
ELSE()
57+
include(CMake/mafMacroEmptyExternalProject.cmake)
5758
mafMacroEmptyExternalProject(${proj} "${proj_DEPENDENCIES}")
5859
ENDIF()
5960

CMakeExternals/External_qxmlrpc.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ SET(qxmlrpc_DEPENDS)
3333
# library output directory to CTK_EXTERNAL_LIBRARY_DIRS
3434

3535
ELSE()
36+
include(CMake/mafMacroEmptyExternalProject.cmake)
3637
mafMacroEmptyExternalProject(${proj} "${proj_DEPENDENCIES}")
3738
ENDIF()
3839

0 commit comments

Comments
 (0)