Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tic
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wenyuanbo
tic
Commits
90554d08
Commit
90554d08
authored
Oct 07, 2017
by
健美猫
Committed by
Tianqi Chen
May 29, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Install nnvm lib and haders. Offer choice to build static or shared lib. (#146)
parent
f5bb0e02
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
2 deletions
+23
-2
nnvm/CMakeLists.txt
+23
-2
No files found.
nnvm/CMakeLists.txt
View file @
90554d08
...
@@ -17,6 +17,10 @@ set(nnvm_LINKER_LIBS "")
...
@@ -17,6 +17,10 @@ set(nnvm_LINKER_LIBS "")
add_definitions
(
-DNNVM_EXPORTS
)
add_definitions
(
-DNNVM_EXPORTS
)
# Build a shared lib (libnnvm.so) by default
option
(
BUILD_SHARED_NNVM
"Build a shared nnvm lib"
ON
)
option
(
BUILD_STATIC_NNVM
"Build a static nnvm lib"
OFF
)
# compile
# compile
if
(
MSVC
)
if
(
MSVC
)
add_definitions
(
-DDMLC_USE_CXX11
)
add_definitions
(
-DDMLC_USE_CXX11
)
...
@@ -64,8 +68,15 @@ elseif(DMLC_CORE_PATH)
...
@@ -64,8 +68,15 @@ elseif(DMLC_CORE_PATH)
include_directories
(
${
DMLC_CORE_PATH
}
/include
)
include_directories
(
${
DMLC_CORE_PATH
}
/include
)
endif
()
endif
()
add_library
(
nnvm SHARED
${
SOURCE
}
)
if
(
BUILD_SHARED_NNVM
)
target_link_libraries
(
nnvm
${
nnvm_LINKER_LIBS
}
)
add_library
(
nnvm SHARED
${
SOURCE
}
)
target_link_libraries
(
nnvm
${
nnvm_LINKER_LIBS
}
)
endif
()
if
(
BUILD_STATIC_NNVM
)
add_library
(
nnvm_static STATIC
${
SOURCE
}
)
target_link_libraries
(
nnvm_static
${
nnvm_LINKER_LIBS
}
)
set_target_properties
(
nnvm_static PROPERTIES OUTPUT_NAME
"nnvm"
)
endif
()
if
(
INSTALL_INCLUDE_DIR
)
if
(
INSTALL_INCLUDE_DIR
)
add_custom_command
(
TARGET nnvm POST_BUILD
add_custom_command
(
TARGET nnvm POST_BUILD
...
@@ -74,6 +85,16 @@ if(INSTALL_INCLUDE_DIR)
...
@@ -74,6 +85,16 @@ if(INSTALL_INCLUDE_DIR)
)
)
endif
()
endif
()
# ---[ Install lib, header and docs
if
(
BUILD_SHARED_NNVM
)
install
(
TARGETS nnvm LIBRARY DESTINATION lib
)
endif
()
if
(
BUILD_STATIC_NNVM
)
install
(
TARGETS nnvm_static ARCHIVE DESTINATION lib
)
endif
()
install
(
DIRECTORY include DESTINATION .
)
install
(
DIRECTORY docs DESTINATION .
)
# ---[ Linter target
# ---[ Linter target
if
(
MSVC
)
if
(
MSVC
)
find_package
(
PythonInterp 2
)
find_package
(
PythonInterp 2
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment