Commit 673b0eeb authored by Aaron Bray's avatar Aaron Bray

BUG: Pass all cmake generator params to exteral projects

Default install directory to the build directory
parent 96f118f5
Pipeline #144186 passed with stage
......@@ -63,6 +63,15 @@ macro(imstk_add_external_project extProj)
# If needs to download and build
#-----------------------------------------------------------------------------
if(NOT DEFINED ${extProj}_DIR AND NOT ${USE_SYSTEM_${extProj}})
#-----------------------------------------------------------------------------
# Ensure all generator info is passed to external library build
#-----------------------------------------------------------------------------
set (COMMON_CMAKE_EP_ARGS
CMAKE_GENERATOR ${CMAKE_GENERATOR}
CMAKE_GENERATOR_PLATFORM ${CMAKE_GENERATOR_PLATFORM}
CMAKE_GENERATOR_TOOLSET ${CMAKE_GENERATOR_TOOLSET}
)
#-----------------------------------------------------------------------------
# Set project directory
......@@ -86,6 +95,7 @@ macro(imstk_add_external_project extProj)
BINARY_DIR ${${extProj}_BINARY_DIR} # from above or parsed argument
TMP_DIR ${${extProj}_TMP_DIR} # from above
STAMP_DIR ${${extProj}_STAMP_DIR} # from above
${COMMON_CMAKE_EP_ARGS} # from above
${${extProj}_EP_ARGS} # from ExternalProject_Include_Dependencies
${${extProj}_UNPARSED_ARGUMENTS} # from unparsed arguments of this macro
DEPENDS ${${extProj}_DEPENDENCIES} # from parsed argument
......
cmake_minimum_required(VERSION 3.9)
set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install CACHE PATH "Install location")
project(iMSTK VERSION 0.0.1 LANGUAGES C CXX)
if(UNIX AND NOT APPLE)
......@@ -52,9 +53,9 @@ endif()
# Project install directories
#-----------------------------------------------------------------------------
if(APPLE)
set(${PROJECT_NAME}_INSTALL_ROOT "${${PROJECT_NAME}_MAIN_PROJECT_APPLICATION_NAME}.app/Contents") # Set to create Bundle
set(${PROJECT_NAME}_INSTALL_ROOT "${CMAKE_INSTALL_PREFIX}/${${PROJECT_NAME}_MAIN_PROJECT_APPLICATION_NAME}.app/Contents") # Set to create Bundle
else()
set(${PROJECT_NAME}_INSTALL_ROOT ".")
set(${PROJECT_NAME}_INSTALL_ROOT "${CMAKE_INSTALL_PREFIX}")
endif()
set(${PROJECT_NAME}_INSTALL_BIN_DIR "${${PROJECT_NAME}_INSTALL_ROOT}/${${PROJECT_NAME}_BIN_DIR}/${PROJECT_NAME}-${${PROJECT_NAME}_VERSION}")
set(${PROJECT_NAME}_INSTALL_LIB_DIR "${${PROJECT_NAME}_INSTALL_ROOT}/${${PROJECT_NAME}_LIB_DIR}/${PROJECT_NAME}-${${PROJECT_NAME}_VERSION}")
......
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