Skip to content

Commit

Permalink
Break source code into multiple files
Browse files Browse the repository at this point in the history
  • Loading branch information
eschnett committed May 18, 2018
1 parent b2ca9ab commit b0da828
Show file tree
Hide file tree
Showing 22 changed files with 2,058 additions and 1,961 deletions.
14 changes: 9 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,17 @@ string(REPLACE "-DNDEBUG" ""
CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")

configure_file(
"${PROJECT_SOURCE_DIR}/asdf-config.hpp.in"
"${PROJECT_BINARY_DIR}/asdf-config.hpp"
"${PROJECT_SOURCE_DIR}/asdf_config.hpp.in"
"${PROJECT_BINARY_DIR}/asdf_config.hpp"
)

include_directories("${PROJECT_SOURCE_DIR}" "${PROJECT_BINARY_DIR}")

add_library(asdf-cxx asdf.cpp asdf-config.cpp)
set(ASDF_SOURCES
asdf.cpp byteorder.cpp config.cpp datatype.cpp group.cpp io.cpp
ndarray.cpp table.cpp)

add_library(asdf-cxx ${ASDF_SOURCES})
set_property(TARGET asdf-cxx PROPERTY POSITION_INDEPENDENT_CODE TRUE)

add_executable(asdf-copy copy.cpp)
Expand Down Expand Up @@ -102,14 +106,14 @@ option(COVERALLS "Generate coveralls data" OFF)
if (COVERALLS)
include(Coveralls)
coveralls_turn_on_coverage()
set(COVERAGE_SRCS asdf.cpp asdf-config.cpp copy.cpp demo.cpp ls.cpp)
set(COVERAGE_SRCS ${ASDF_SOURCES} copy.cpp demo.cpp ls.cpp)
coveralls_setup("${COVERAGE_SRCS}" ON)
endif()

# Install

install(FILES asdf.hpp DESTINATION include)
install(FILES "${PROJECT_BINARY_DIR}/asdf-config.hpp" DESTINATION include)
install(FILES "${PROJECT_BINARY_DIR}/asdf_config.hpp" DESTINATION include)
install(TARGETS asdf-cxx DESTINATION lib)
install(TARGETS asdf-copy asdf-demo asdf-demo-large asdf-ls DESTINATION bin)

Expand Down

0 comments on commit b0da828

Please sign in to comment.