Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'rules' to install from superbuild #466

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMake/ctkBlockCheckDependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ if(CTK_SUPERBUILD)
-DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER}
-DCMAKE_C_FLAGS:STRING=${ep_common_c_flags}
-DCMAKE_CXX_FLAGS:STRING=${ep_common_cxx_flags}
-DCMAKE_INSTALL_PREFIX:PATH=${ep_install_dir}
-DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX}
-DCMAKE_PREFIX_PATH:STRING=${CMAKE_PREFIX_PATH}
-DBUILD_TESTING:BOOL=OFF
)
Expand Down
18 changes: 18 additions & 0 deletions CMake/ctkMacroCheckExternalProjectDependency.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -682,3 +682,21 @@ macro(ExternalProject_Add_Empty project_name)
DEPENDS ${_sb_DEPENDS}
)
endmacro()

#.rst:
# .. cmake:function:: ExternalProject_Install_CMake
#
# Install an external CMake-based project as part of the ``install`` target.
#
# .. code-block:: cmake
#
# ExternalProject_Install_CMake(<project_name>)
#
# This causes building the main project's ``install`` target to also execute
# the CMake install script for the specified external project.
#
function(ExternalProject_Install_CMake project_name)
ExternalProject_Get_Property(${project_name} binary_dir)

install(SCRIPT ${binary_dir}/cmake_install.cmake)
endfunction()
5 changes: 4 additions & 1 deletion CMakeExternals/DCMTK.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,14 @@ if(NOT DEFINED DCMTK_DIR AND NOT ${CMAKE_PROJECT_NAME}_USE_SYSTEM_${proj})
PREFIX ${proj}${ep_suffix}
${location_args}
UPDATE_COMMAND ""
BUILD_COMMAND ""
# INSTALL_COMMAND "" TODO
CMAKE_ARGS
-DDCMTK_INSTALL_BINDIR:STRING=bin/${CMAKE_CFG_INTDIR}
-DDCMTK_INSTALL_LIBDIR:STRING=lib/${CMAKE_CFG_INTDIR}
CMAKE_CACHE_ARGS
${ep_common_cache_args}
${ep_project_include_arg}
-DCMAKE_INSTALL_PREFIX:PATH=${ep_install_dir} # TODO use from build directory
-DBUILD_SHARED_LIBS:BOOL=ON
-DDCMTK_WITH_DOXYGEN:BOOL=OFF
-DDCMTK_WITH_ZLIB:BOOL=OFF # see github issue #25
Expand All @@ -75,6 +76,8 @@ if(NOT DEFINED DCMTK_DIR AND NOT ${CMAKE_PROJECT_NAME}_USE_SYSTEM_${proj})
)
set(DCMTK_DIR ${ep_install_dir})

# ExternalProject_Install_CMake(${proj}) TODO

else()
ExternalProject_Add_Empty(${proj} DEPENDS ${${proj}_DEPENDENCIES})
endif()
Expand Down
2 changes: 2 additions & 0 deletions CMakeExternals/ITK.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ if(NOT DEFINED ITK_DIR AND NOT ${CMAKE_PROJECT_NAME}_USE_SYSTEM_${proj})
)
set(ITK_DIR ${CMAKE_BINARY_DIR}/${proj}-build)

ExternalProject_Install_CMake(${proj})

else()
ExternalProject_Add_Empty(${proj} DEPENDS ${${proj}_DEPENDENCIES})
endif()
Expand Down
1 change: 1 addition & 0 deletions CMakeExternals/KWStyle.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ if(NOT DEFINED KWSTYLE_EXECUTABLE)
${location_args}
CMAKE_CACHE_ARGS
${ep_common_cache_args}
-DCMAKE_INSTALL_PREFIX:PATH=${ep_install_dir}
DEPENDS
${${proj}_DEPENDENCIES}
)
Expand Down
2 changes: 2 additions & 0 deletions CMakeExternals/Log4Qt.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ if(NOT DEFINED Log4Qt_DIR)
)
set(Log4Qt_DIR ${CMAKE_BINARY_DIR}/${proj}-build)

ExternalProject_Install_CMake(${proj})

else()
ExternalProject_Add_Empty(${proj} DEPENDS ${${proj}_DEPENDENCIES})
endif()
Expand Down
2 changes: 2 additions & 0 deletions CMakeExternals/OpenIGTLink.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ if(NOT DEFINED OpenIGTLink_DIR AND NOT ${CMAKE_PROJECT_NAME}_USE_SYSTEM_${proj})
)
set(OpenIGTLink_DIR ${CMAKE_BINARY_DIR}/${proj}-build)

ExternalProject_Install_CMake(${proj})

else()
ExternalProject_Add_Empty(${proj} DEPENDS ${${proj}_DEPENDENCIES})
endif()
Expand Down
12 changes: 9 additions & 3 deletions CMakeExternals/PythonQt.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -86,25 +86,31 @@ if(NOT DEFINED PYTHONQT_INSTALL_DIR)
PREFIX ${proj}${ep_suffix}
${location_args}
UPDATE_COMMAND ""
BUILD_COMMAND ""
# INSTALL_COMMAND "" TODO use from build directory
CMAKE_CACHE_ARGS
${ep_common_cache_args}
-DCMAKE_INSTALL_PREFIX:PATH=${ep_install_dir} # TODO use from build directory
-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}
-DPYTHON_INCLUDE_DIR:PATH=${PYTHON_INCLUDE_DIR}
-DPYTHON_LIBRARY:FILEPATH=${PYTHON_LIBRARY}
# -DPythonQt_INSTALL_RUNTIME_DIR:STRING=${CTK_INSTALL_BIN_DIR} TODO
# -DPythonQt_INSTALL_LIBRARY_DIR:STRING=${CTK_INSTALL_LIB_DIR} TODO
# -DPythonQt_INSTALL_ARCHIVE_DIR:STRING=${CTK_INSTALL_LIB_DIR} TODO
${ep_PythonQt_args}
DEPENDS
${${proj}_DEPENDENCIES}
)
set(PYTHONQT_INSTALL_DIR ${ep_install_dir})
set(PYTHONQT_INSTALL_DIR ${ep_install_dir}) # TODO remove when not installed during build

# ExternalProject_Install_CMake(${proj}) TODO

else()
ExternalProject_Add_Empty(${proj} DEPENDS ${${proj}_DEPENDENCIES})
endif()

mark_as_superbuild(
VARS
PYTHONQT_INSTALL_DIR:PATH
PYTHONQT_INSTALL_DIR:PATH # TODO remove when not installed during build
PYTHON_EXECUTABLE:FILEPATH # FindPythonInterp expects PYTHON_EXECUTABLE variable to be defined
PYTHON_INCLUDE_DIR:PATH # FindPythonQt expects PYTHON_INCLUDE_DIR variable to be defined
PYTHON_LIBRARY:FILEPATH # FindPythonQt expects PYTHON_LIBRARY variable to be defined
Expand Down
2 changes: 2 additions & 0 deletions CMakeExternals/QtSOAP.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ if(NOT DEFINED QtSOAP_DIR)
)
set(QtSOAP_DIR "${CMAKE_BINARY_DIR}/${proj}-build")

ExternalProject_Install_CMake(${proj})

else()
ExternalProject_Add_Empty(${proj} DEPENDS ${${proj}_DEPENDENCIES})
endif()
Expand Down
9 changes: 7 additions & 2 deletions CMakeExternals/QtTesting.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -57,23 +57,28 @@ if(NOT DEFINED QtTesting_DIR)
PREFIX ${proj}${ep_suffix}
${location_args}
UPDATE_COMMAND ""
# INSTALL_COMMAND "" TODO use from build directory
CMAKE_CACHE_ARGS
${ep_common_cache_args}
-DCMAKE_INSTALL_PREFIX:PATH=${ep_install_dir} # TODO use from build directory
-DBUILD_SHARED_LIBS:BOOL=ON
-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}
# -DQtTesting_INSTALL_LIB_DIR:STRING=${CTK_INSTALL_LIB_DIR} TODO
DEPENDS
${${proj}_DEPENDENCIES}
)
set(QtTesting_INSTALL_DIR ${ep_install_dir})
set(QtTesting_INSTALL_DIR ${ep_install_dir}) # TODO remove when not installed during build
set(QtTesting_DIR ${CMAKE_BINARY_DIR}/${proj}-build)

# ExternalProject_Install_CMake(${proj}) TODO

else()
ExternalProject_Add_Empty(${proj} DEPENDS ${${proj}_DEPENDENCIES})
endif()

mark_as_superbuild(
VARS
QtTesting_INSTALL_DIR:PATH
QtTesting_INSTALL_DIR:PATH # TODO remove when not installed during build
QtTesting_DIR:PATH
LABELS "FIND_PACKAGE"
)
2 changes: 2 additions & 0 deletions CMakeExternals/VTK.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ if(NOT DEFINED VTK_DIR AND NOT ${CMAKE_PROJECT_NAME}_USE_SYSTEM_${proj})
)
set(VTK_DIR ${CMAKE_BINARY_DIR}/${proj}-build)

ExternalProject_Install_CMake(${proj})

else()
ExternalProject_Add_Empty(${proj} DEPENDS ${${proj}_DEPENDENCIES})
endif()
Expand Down
2 changes: 2 additions & 0 deletions CMakeExternals/XIP.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ if(NOT DEFINED XIP_DIR)
)
set(XIP_DIR ${CMAKE_BINARY_DIR}/${proj}-build)

ExternalProject_Install_CMake(${proj})

else()
ExternalProject_Add_Empty(${proj} DEPENDS ${${proj}_DEPENDENCIES})
endif()
Expand Down
2 changes: 2 additions & 0 deletions CMakeExternals/ZMQ.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ if(NOT DEFINED ZMQ_DIR)
)
set(ZMQ_DIR ${CMAKE_BINARY_DIR}/${proj}-build)

ExternalProject_Install_CMake(${proj})

else()
ExternalProject_Add_Empty(${proj} DEPENDS ${${proj}_DEPENDENCIES})
endif()
Expand Down
2 changes: 2 additions & 0 deletions CMakeExternals/qRestAPI.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ if(NOT DEFINED ${proj}_DIR)
)
set(qRestAPI_DIR ${CMAKE_CURRENT_BINARY_DIR}/${proj}-build)

ExternalProject_Install_CMake(${proj})

else()
ExternalProject_Add_Empty(${proj} DEPENDS ${${proj}_DEPENDENCIES})
endif()
Expand Down
2 changes: 2 additions & 0 deletions CMakeExternals/qxmlrpc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ if(NOT DEFINED qxmlrpc_DIR)
)
set(qxmlrpc_DIR "${CMAKE_BINARY_DIR}/${proj}-build")

ExternalProject_Install_CMake(${proj})

else()
ExternalProject_Add_Empty(${proj} DEPENDS ${${proj}_DEPENDENCIES})
endif()
Expand Down
2 changes: 2 additions & 0 deletions SuperBuild.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,5 @@ ExternalProject_Add_Step(${proj} forcebuild
DEPENDEES build
ALWAYS 1
)

ExternalProject_Install_CMake(${proj})