Skip to content
Snippets Groups Projects
Commit da717e8d authored by Jeremy McCormick's avatar Jeremy McCormick Committed by GitHub
Browse files

Add option for dependency installation (#27)

* add option with flag for dependency installation (OFF by default)

* rename cmake flag
parent b0d35003
No related branches found
No related tags found
No related merge requests found
...@@ -19,11 +19,6 @@ SET( SLIC_VERSION_PATCH 0 ) ...@@ -19,11 +19,6 @@ SET( SLIC_VERSION_PATCH 0 )
INCLUDE( ExternalProject ) INCLUDE( ExternalProject )
#IF ( NOT CMAKE_INSTALL_PREFIX )
# SET( CMAKE_INSTALL_PREFIX "$ENV{HOME}/slic" )
# MESSAGE( STATUS "Global install dir set to: ${CMAKE_INSTALL_PREFIX}" )
#ENDIF()
MESSAGE( STATUS "SLIC install dir set to: ${CMAKE_INSTALL_PREFIX}" ) MESSAGE( STATUS "SLIC install dir set to: ${CMAKE_INSTALL_PREFIX}" )
# option for logg messages # option for logg messages
...@@ -36,6 +31,8 @@ MESSAGE( STATUS "Enable slic log system: ${ENABLE_SLIC_LOG}" ) ...@@ -36,6 +31,8 @@ MESSAGE( STATUS "Enable slic log system: ${ENABLE_SLIC_LOG}" )
# option to dump CMake variables after cmake is executed # option to dump CMake variables after cmake is executed
OPTION( PRINT_CMAKE_VARIABLES "Print CMake environment" OFF ) OPTION( PRINT_CMAKE_VARIABLES "Print CMake environment" OFF )
OPTION( INSTALL_DEPENDENCIES "Install external dependencies automatically" OFF )
# add path containing CMake macros for this project # add path containing CMake macros for this project
LIST( APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake ) LIST( APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake )
...@@ -55,9 +52,13 @@ FOREACH( dependency ${DEPENDENCIES} ) ...@@ -55,9 +52,13 @@ FOREACH( dependency ${DEPENDENCIES} )
ADD_CUSTOM_TARGET( ${dependency} ) ADD_CUSTOM_TARGET( ${dependency} )
ENDIF() ENDIF()
ELSE() ELSE()
MESSAGE( STATUS "${dependency} was not found and will be installed as an external project." ) IF ( NOT INSTALL_DEPENDENCIES )
INCLUDE( Install${dependency} ) MESSAGE( FATAL_ERROR "${dependency} was not found and dependency installation is disabled.\nUse the option '-DINSTALL_DEPENDENCIES=ON' to enable automatic dependency installation." )
SET( DEPENDENCIES_NOTFOUND "YES" FORCE ) ELSE()
MESSAGE( STATUS "${dependency} was not found and will be installed as an external project." )
INCLUDE( Install${dependency} )
SET( DEPENDENCIES_NOTFOUND "YES" FORCE )
ENDIF()
ENDIF() ENDIF()
ADD_DEPENDENCIES( extdeps ${dependency} ) ADD_DEPENDENCIES( extdeps ${dependency} )
#MESSAGE(" ${dependency}_DIR=${${dependency}_DIR}" ) #MESSAGE(" ${dependency}_DIR=${${dependency}_DIR}" )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment