forked from aksnzhy/xlearn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
79 lines (72 loc) · 2.57 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# Copyright (c) 2016 by contributors.
# Authour: Chao Ma ([email protected])
#
# This is the root CMakeLists.txt file of the xLearn project, which
# build all subdirectories (packages) in the order of
# inter-package dependence.
#
# you can build the xLearn using the following commands:
#
# $> cd xLearn
# $> mkdir build
# $> cd build
# $> cmake ..
# $> make
#
# Thus you check out the xLearn project and build it in a
# subdirectory ``build". If you want further to install the
# built project, you can type the command:
#
# $> make install
#
project ("xLearn")
cmake_minimum_required(VERSION 3.0)
#-------------------------------------------------------------------------------
# Take almost all warnings;
# Do not generate debug symbols;
# Optimization level 3;
# Using c++11;
# Optimization on architecture
#-------------------------------------------------------------------------------
add_definitions("-Wall -Wno-sign-compare -O3 -std=c++11
-march=native -Wno-strict-aliasing -Wno-comment")
#-------------------------------------------------------------------------------
# Declare where our project will be installed.
#-------------------------------------------------------------------------------
set(CMAKE_INSTALL_PREFIX "xLearn")
#-------------------------------------------------------------------------------
# Ensure executables are statically linked with libraries.
#-------------------------------------------------------------------------------
#if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
# set(CMAKE_EXE_LINKER_FLAGS "-static -static-libgcc")
#endif()
#-------------------------------------------------------------------------------
# Set include paths and library paths.
#-------------------------------------------------------------------------------
include_directories(
"${PROJECT_SOURCE_DIR}"
"${PROJECT_BINARY_DIR}"
"${PROJECT_SOURCE_DIR}/gtest/include"
)
link_directories(
"${PROJECT_BINARY_DIR}/src/base"
"${PROJECT_BINARY_DIR}/src/data"
"${PROJECT_BINARY_DIR}/src/reader"
"${PROJECT_BINARY_DIR}/src/score"
"${PROJECT_BINARY_DIR}/src/loss"
"${PROJECT_BINARY_DIR}/src/solver"
)
#-------------------------------------------------------------------------------
# Declare packages in xLearn project.
#-------------------------------------------------------------------------------
add_subdirectory(gtest)
add_subdirectory(demo)
add_subdirectory(src/base)
add_subdirectory(src/data)
add_subdirectory(src/reader)
add_subdirectory(src/score)
add_subdirectory(src/loss)
add_subdirectory(src/solver)
add_subdirectory(src/c_api)
add_subdirectory(python-package)
add_subdirectory(scripts)