Skip to content

Commit

Permalink
Move GPL and SVMLight option
Browse files Browse the repository at this point in the history
  • Loading branch information
vigsterkr committed Mar 8, 2017
1 parent d649767 commit ec0b65a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 14 deletions.
14 changes: 0 additions & 14 deletions CMakeLists.txt
Expand Up @@ -338,20 +338,6 @@ EndForEach(Interface)
# Debugging Python-interface with CTest
OPTION(ENABLE_PYTHON_DEBUG "Enable Python-interface-debugging with CTest" OFF)

# Allow to hide non-bsd compatible codes
OPTION(LICENSE_GPL_SHOGUN "Include GPL codes of Shogun (non-BSD compatible) in build" ON)
IF (LICENSE_GPL_SHOGUN)
SET(USE_GPL_SHOGUN 1)
SET(SHOGUN_GPL_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/src/gpl)
ELSE()
SET(USE_GPL_SHOGUN 0)
ENDIF()

# SVMLight
OPTION(USE_SVMLIGHT "SVMLight" ON)
IF(USE_SVMLIGHT AND NOT USE_GPL_SHOGUN)
MESSAGE(FATAL_ERROR "Can only use SVMLight when GPL codes are included")
ENDIF()
SET(SVMLightWarning "\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!")
SET(SVMLightWarning "${SVMLightWarning}\nWARNING: SHOGUN is built using SVMlight which was written")
SET(SVMLightWarning "${SVMLightWarning}\nby Thorsten Joachims and uses a different non GPL compatible license.")
Expand Down
20 changes: 20 additions & 0 deletions src/shogun/CMakeLists.txt
Expand Up @@ -29,6 +29,26 @@ if (MSVC AND (BUILD_EXAMPLES OR BUILD_META_EXAMPLES))
CACHE BOOL "Build libshogun static library" FORCE)
endif()

# Allow to hide non-bsd compatible codes
OPTION(LICENSE_GPL_SHOGUN "Include GPL codes of Shogun (non-BSD compatible) in build" ON)
IF (LICENSE_GPL_SHOGUN)
SET(USE_GPL_SHOGUN 1)
SET(SHOGUN_GPL_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/src/gpl)

FILE(GLOB_RECURSE GPL_LIBSHOGUN_SRC *.${EXT_SRC_CPP} *.${EXT_SRC_C})
FILE(GLOB_RECURSE GPL_LIBSHOGUN_HEADERS *.${EXT_SRC_HEADER})
LIST(APPEND LIBSHOGUN_SRC ${GPL_LIBSHOGUN_SRC})
LIST(APPEND LIBSHOGUN_HEADERS ${GPL_LIBSHOGUN_HEADERS})
INCLUDE_DIRECTORIES(${SHOGUN_GPL_INCLUDE_DIR})
ELSE()
SET(USE_GPL_SHOGUN 0)
ENDIF()

OPTION(USE_SVMLIGHT "SVMLight" ON)
IF(USE_SVMLIGHT AND NOT USE_GPL_SHOGUN)
MESSAGE(FATAL_ERROR "Can only use SVMLight when GPL codes are included")
ENDIF()

# add target to compile the libshogun sources
add_library(libshogun OBJECT ${LIBSHOGUN_SRC} ${LIBSHOGUN_HEADERS} ${CMAKE_CURRENT_BINARY_DIR}/lib/config.h)
set_property(TARGET libshogun PROPERTY POSITION_INDEPENDENT_CODE TRUE)
Expand Down

0 comments on commit ec0b65a

Please sign in to comment.