Skip to content

Commit

Permalink
Merge pull request #28 from updega2/2017-12-11-apple_toplevel_vtk_change
Browse files Browse the repository at this point in the history
BUG: Should really be specified on top level, not internally
  • Loading branch information
updega2 authored Dec 14, 2017
2 parents 8cc09ba + a0fd562 commit 034b0f0
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 5 deletions.
13 changes: 13 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ endif()
if (POLICY CMP0054)
cmake_policy(SET CMP0054 OLD)
endif()
if (POLICY CMP0025) # Compiler ID when using clang set to clang not appleclang
cmake_policy(SET CMP0025 OLD)
endif()
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
Expand Down Expand Up @@ -83,6 +86,10 @@ include(SimVascularFunctionCheckCompilerFlags)
#-----------------------------------------------------------------------------
# Externals!
set(SV_EXTERNALS_ADDITIONAL_CMAKE_ARGS "" CACHE STRING "If more options want to be provided to the sv_externals build, they can be with this string")
set(SV_EXTERNALS_APPLE_CMAKE_ARGS)
if(APPLE AND NOT SV_PLATFORM_VERSION_DIR VERSION_EQUAL 10.11)
list(APPEND SV_EXTERNALS_APPLE_CMAKE_ARGS -DSV_EXTERNALS_VTK_VERSION:STRING=7.0.0)
endif()
ExternalProject_Add(Externals
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Externals
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/Externals-build
Expand All @@ -98,6 +105,7 @@ ExternalProject_Add(Externals
-DCMAKE_MACOSX_RPATH:BOOL=ON
-DBUILD_TESTING:BOOL=OFF
-DBUILD_EXAMPLES:BOOL=OFF
${SV_EXTERNALS_APPLE_CMAKE_ARGS}
${SV_EXTERNALS_ADDITIONAL_CMAKE_ARGS}
)
set(SV_EXTERNALS_TOPLEVEL_DIR "${CMAKE_BINARY_DIR}/Externals-build/sv_externals")
Expand All @@ -106,6 +114,10 @@ set(SV_EXTERNALS_TOPLEVEL_DIR "${CMAKE_BINARY_DIR}/Externals-build/sv_externals"
#-----------------------------------------------------------------------------
# svSolver!
set(SV_ADDITIONAL_CMAKE_ARGS "" CACHE STRING "If more options want to be provided to the sv_externals build, they can be with this string")
set(SV_APPLE_CMAKE_ARGS)
if(APPLE AND NOT SV_PLATFORM_VERSION_DIR VERSION_EQUAL 10.11)
list(APPEND SV_APPLE_CMAKE_ARGS -DVTK_VERSION:STRING=7.0.0)
endif()
ExternalProject_Add(svSolver
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Code
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/svSolver-build
Expand All @@ -125,6 +137,7 @@ ExternalProject_Add(svSolver
-DBUILD_SHARED_LIBS:BOOL=OFF
-DSV_EXTERNALS_USE_TOPLEVEL_DIR:BOOL=ON
-DSV_EXTERNALS_TOPLEVEL_DIR:PATH=${SV_EXTERNALS_TOPLEVEL_DIR}
${SV_APPLE_CMAKE_ARGS}
${SV_ADDITIONAL_CMAKE_ARGS}
)
#-----------------------------------------------------------------------------
5 changes: 5 additions & 0 deletions Code/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#-----------------------------------------------------------------------------
cmake_minimum_required(VERSION 3.3.0)

if (POLICY CMP0040)
Expand All @@ -38,6 +39,10 @@ endif()
if (POLICY CMP0054)
cmake_policy(SET CMP0054 OLD)
endif()
if (POLICY CMP0025) # Compiler ID when using clang set to clang not appleclang
cmake_policy(SET CMP0025 OLD)
endif()
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
Project(SV)
Expand Down
6 changes: 1 addition & 5 deletions Externals/CMakeExternals/SvExtOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,5 @@ mark_as_advanced(SV_EXTERNALS_GIT_URL)
# and optional install dirname. Order matters; put independent packages first
#-----------------------------------------------------------------------------
# VTK
if(APPLE)
sv_externals_add_new_external(VTK 7.0.0 ON OFF vtk vtk)
else()
sv_externals_add_new_external(VTK 6.2.0 ON OFF vtk vtk)
endif()
sv_externals_add_new_external(VTK 6.2.0 ON OFF vtk vtk)
#-----------------------------------------------------------------------------
3 changes: 3 additions & 0 deletions Externals/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ endif()
if (POLICY CMP0054)
cmake_policy(SET CMP0054 OLD)
endif()
if (POLICY CMP0025) # Compiler ID when using clang set to clang not appleclang
cmake_policy(SET CMP0025 OLD)
endif()
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
Expand Down

0 comments on commit 034b0f0

Please sign in to comment.