Skip to content

Commit

Permalink
slight improvement of read_config in class_list.cpp.py
Browse files Browse the repository at this point in the history
use SHOGUN_LIB_INSTALL instead of CMAKE_INSTALL_LIBDIR for defining
SHOGUN_CLING_LIBRARY_DIR
  • Loading branch information
vigsterkr committed Sep 24, 2018
1 parent f8b5198 commit 4154197
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
13 changes: 6 additions & 7 deletions src/shogun/CMakeLists.txt
Expand Up @@ -23,9 +23,14 @@ OPTION(LIBSHOGUN_BUILD_STATIC "Build libshogun static library")
OPTION(DISABLE_SSE "Disable SSE and SSE2 features.")
OPTION(BUILD_BENCHMARKS "Build benchmarks" OFF)

IF (LIB_INSTALL_DIR)
SET(SHOGUN_LIB_INSTALL ${LIB_INSTALL_DIR})
ELSE()
SET(SHOGUN_LIB_INSTALL lib)
ENDIF()
set(INCLUDE_INSTALL_DIR include)
set(THIRD_PARTY_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/third_party)
set(SHOGUN_CLING_LIBRARY_DIR "\"${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}\"")
set(SHOGUN_CLING_LIBRARY_DIR "\"${CMAKE_INSTALL_PREFIX}/${SHOGUN_LIB_INSTALL}\"")

if (MSVC OR BUILD_BENCHMARKS)
SET(LIBSHOGUN_BUILD_STATIC ON
Expand Down Expand Up @@ -627,12 +632,6 @@ INSTALL(
PATTERN "*Release*" EXCLUDE
PATTERN ".settings" EXCLUDE)

IF (LIB_INSTALL_DIR)
SET(SHOGUN_LIB_INSTALL ${LIB_INSTALL_DIR})
ELSE()
SET(SHOGUN_LIB_INSTALL lib)
ENDIF()

# set the desidered targets to be installed
set(INSTALL_TARGETS shogun)
if (LIBSHOGUN_BUILD_STATIC)
Expand Down
9 changes: 6 additions & 3 deletions src/shogun/base/class_list.cpp.py
Expand Up @@ -121,7 +121,7 @@ def get_includes(classes, headers_absolute_fnames):
while tail != shogun_dir and len(head)>0:
tails += [tail]
head, tail = os.path.split(head)

# construct include path from collected tails
tails.reverse()
include = os.path.join(*([shogun_dir] + tails))
Expand Down Expand Up @@ -302,10 +302,13 @@ def write_templated_file(fname, substitutes):
def read_config():
config = dict()
for line in open('lib/config.h').readlines():
if line == '\n':
if line == '\n' or \
line.lstrip().startswith("/*") or \
line.lstrip().startswith("//"):
continue
l = [l.strip() for l in line.split()]
config[l[1]] = 1
if len(l) > 1:
config[l[1]] = 1

return config

Expand Down

0 comments on commit 4154197

Please sign in to comment.