Skip to content

Commit

Permalink
update cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
aksnzhy committed Nov 19, 2017
1 parent b184a72 commit 770cde0
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,4 @@ add_subdirectory(src/reader)
add_subdirectory(src/score)
add_subdirectory(src/loss)
add_subdirectory(src/solver)
add_subdirectory(src/c_api)
add_subdirectory(src/c_api)
4 changes: 4 additions & 0 deletions src/base/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Set output library.
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/test)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib/base)

# Build static library
add_library(base STATIC logging.cc stringprintf.cc split_string.cc
levenshtein_distance.cc timer.cc)
Expand Down
6 changes: 5 additions & 1 deletion src/c_api/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Set output library.
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/test)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib/)

# Build static library
set(STA_DEPS solver reader loss score data base)
add_library(xlearn STATIC c_api.cc c_api_error.cc)
Expand All @@ -22,7 +26,7 @@ target_link_libraries(c_api_test gtest_main ${LIBS})

# Copy Python file
FILE(COPY "${CMAKE_CURRENT_SOURCE_DIR}/c_api_test.py"
DESTINATION "${CMAKE_BINARY_DIR}/src/c_api/")
DESTINATION ${PROJECT_BINARY_DIR}/test)

# Install library and header files
install(TARGETS xlearn DESTINATION lib/c_api)
Expand Down
4 changes: 4 additions & 0 deletions src/data/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Set output library.
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/test)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib/data)

# Build static library
set(STA_DEPS base)
add_library(data STATIC model_parameters.cc)
Expand Down
4 changes: 4 additions & 0 deletions src/loss/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Set output library.
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/test)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib/loss)

# Build static library
set(STA_DEPS score data base)
add_library(loss STATIC loss.cc squared_loss.cc
Expand Down
4 changes: 4 additions & 0 deletions src/reader/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Set output library.
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/test)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib/reader)

# Build static library
set(STA_DEPS data base)
add_library(reader STATIC parser.cc file_splitor.cc reader.cc)
Expand Down
4 changes: 4 additions & 0 deletions src/score/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Set output library.
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/test)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib/score)

# Build static library
set(STA_DEPS data base)
add_library(score STATIC score_function.cc
Expand Down
4 changes: 4 additions & 0 deletions src/solver/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Set output library.
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib/base)

# Build static library
set(STA_DEPS reader loss score data base)
add_library(solver STATIC checker.cc trainer.cc inference.cc solver.cc)
Expand Down

0 comments on commit 770cde0

Please sign in to comment.