Skip to content

Commit

Permalink
Header install location fix; components for win32
Browse files Browse the repository at this point in the history
The 1.0.0 release binary packages were installing headers in the wrong
place (include/common.hpp, etc. instead of include/fracdist/common.hpp),
and were missing the fracdist/data.hpp header.

Added component configurations for Windows installers so that Windows
users can elect to not install the headers and/or docs when using the
.exe installer.
  • Loading branch information
jagerman committed Mar 10, 2014
1 parent 4c972e3 commit e440bf1
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 10 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Major version changes (for change details, see https://github.com/jagerman/fracdist)

## 1.0.1

- Initial release binary packages were installing headers in the wrong place
(include/common.hpp, etc. instead of include/fracdist/common.hpp), and were
missing the fracdist/data.hpp header.
- Added component configurations for Windows installers so that Windows users
can elect to not install the headers and/or docs.

## 1.0.0

- Initial release.
26 changes: 19 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ project(fracdist CXX)

set(fracdist_VMAJ 1)
set(fracdist_VMIN 0)
set(fracdist_VPAT 0)
set(fracdist_VPAT 1)
set(fracdist_description "fractional unit roots/cointegration pvalue and critical value finder")
set(fracdist_author "Jason Rhinelander <[email protected]>")
set(fracdist_homepage "https://github.com/jagerman/fracdist")
Expand Down Expand Up @@ -64,6 +64,7 @@ add_custom_command(OUTPUT ${fracdist_datafiles}
foreach(hpp fracdist/common.hpp fracdist/pvalue.hpp fracdist/critical.hpp)
list(APPEND fracdist_headers "${CMAKE_CURRENT_SOURCE_DIR}/${hpp}")
endforeach()
list(APPEND fracdist_headers "${CMAKE_CURRENT_BINARY_DIR}/fracdist/data.hpp")
foreach(cpp fracdist/pvalue.cpp fracdist/critical.cpp fracdist/common.cpp)
list(APPEND fracdist_source "${CMAKE_CURRENT_SOURCE_DIR}/${cpp}")
endforeach()
Expand Down Expand Up @@ -134,20 +135,23 @@ set(CPACK_PACKAGE_VERSION_PATCH ${fracdist_VPAT})
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE")


install(FILES ${fracdist_headers} DESTINATION include/fracdist COMPONENT headers)

install(FILES README.md CHANGELOG.md DESTINATION "${fracdist_docdir}" COMPONENT docs)

if (CMAKE_SYSTEM_NAME STREQUAL Windows)
# Windows users are scared of version numbers:
set(CPACK_PACKAGE_INSTALL_DIRECTORY "fracdist")

install(TARGETS fracdist ${fracdist_programs} DESTINATION .)
install(
FILES ${fracdist_headers} ${fracdist_header_data}
DESTINATION include/fracdist)
# Windows binaries and lib go in the top-level dir:
install(TARGETS ${fracdist_programs} COMPONENT binaries DESTINATION .)
install(TARGETS fracdist COMPONENT library DESTINATION .)

set(CPACK_GENERATOR ZIP NSIS)
set(CPACK_PACKAGE_FILE_NAME "fracdist-${fracdist_VMAJ}.${fracdist_VMIN}.${fracdist_VPAT}-windows")
else()
install(TARGETS fracdist ${fracdist_programs} LIBRARY DESTINATION lib RUNTIME DESTINATION bin)
install(FILES ${fracdist_headers} DESTINATION include)
install(TARGETS fracdist COMPONENT library DESTINATION lib)
install(TARGETS ${fracdist_programs} COMPONENT binaries DESTINATION bin)

set(CPACK_GENERATOR DEB RPM)

Expand All @@ -161,5 +165,13 @@ else()
set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "${fracdist_homepage}")
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "${fracdist_description}")
endif()

set(CPACK_COMPONENTS_GROUPING ALL_COMPONENTS_IN_ONE)

include(CPack)

cpack_add_component(library REQUIRED DISPLAY_NAME "libfracdist" DESCRIPTION "The main fracdist library code.")
cpack_add_component(binaries DISPLAY_NAME "Binaries" DESCRIPTION "'fdpval' and 'fdcrit' provide a simple command-line interface to libfracdist functionality.")
cpack_add_component(headers DISABLED DISPLAY_NAME "C++ headers" DESCRIPTION "C++ headers needed to compile code linking to libfracdist.")
cpack_add_component(docs DISABLED DISPLAY_NAME "Documentation" DESCRIPTION "API documentation for libfracdist programming.")

4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ this program. If not, see <http://www.gnu.org/licenses/>.

See [BUILDING.md](BUILDING.md).

## Changes

See [CHANGELOG.md](CHANGELOG.md).

## Author

[Jason Rhinelander](Jason Rhinelander) <[email protected]>
Expand Down
3 changes: 1 addition & 2 deletions doc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,4 @@ add_dependencies(api_doc ${fracdist_data_generated})

install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/api"
DESTINATION "${fracdist_docdir}"
COMPONENT doc)

COMPONENT docs)
2 changes: 1 addition & 1 deletion doc/Doxyfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ DOXYFILE_ENCODING = UTF-8
PROJECT_NAME = @PROJECT_NAME@
PROJECT_NUMBER = v@fracdist_VMAJ@.@fracdist_VMIN@.@fracdist_VPAT@
PROJECT_BRIEF = "@fracdist_description@"
INPUT = README.md BUILDING.md fracdist
INPUT = README.md BUILDING.md CHANGELOG.md fracdist
EXCLUDE_PATTERNS = *build build*
INPUT_ENCODING = UTF-8
FILE_PATTERNS = *.hpp
Expand Down

0 comments on commit e440bf1

Please sign in to comment.