-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(Build) First pass over CMake (#151)
* (Build) First pass over CMake 1. Requirement for CMake moves to version 3.10 (from 3.5) 1. Adds a `release` target that builds and installs all libs and programs 1. Factors CMake code into a `cmake` top-level folder 1. Adds packaging for `.deb` and `.tgz` 1. Creates `IonC::` scope for CMake targets 1. Expands source and header files, avoiding CMake GLOB which can cause issues with caching 1. Sets correct properties for libs and uses proper install destinations
- Loading branch information
Showing
11 changed files
with
171 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
set(CPACK_PACKAGE_NAME "${PROJECT_NAME}") | ||
set(CPACK_PACKAGE_VENDOR "The Ion Team") | ||
set(CPACK_PACKAGE_DESCRIPTION_FILE "${PROJECT_SOURCE_DIR}/README.md") | ||
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "message: Ion library and tools") | ||
set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE") | ||
|
||
set(CPACK_PACKAGING_INSTALL_PREFIX "/opt/${PROJECT_NAME}") | ||
|
||
set(CPACK_PACKAGE_VERSION_MAJOR "${PROJECT_VERSION_MAJOR}") | ||
set(CPACK_PACKAGE_VERSION_MINOR "${PROJECT_VERSION_MINOR}") | ||
set(CPACK_PACKAGE_VERSION_PATCH "${PROJECT_VERSION_PATCH}") | ||
|
||
set(CPACK_SOURCE_IGNORE_FILES | ||
"${PROJECT_BINARY_DIR};/.idea;./.github;/.git/;.gitignore;.travis.yml;.appveyor.yml") | ||
set(CPACK_SOURCE_GENERATOR "ZIP;TGZ") | ||
set(CPACK_GENERATOR "ZIP;TGZ") | ||
|
||
if(UNIX) | ||
if(CMAKE_SYSTEM_NAME MATCHES Linux) | ||
list(APPEND CPACK_GENERATOR "DEB") | ||
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "ion-team") | ||
set(CPACK_DEBIAN_PACKAGE_SECTION "devel") | ||
# set(CPACK_DEBIAN_PACKAGE_DEPENDS "uuid-dev") | ||
|
||
list(APPEND CPACK_GENERATOR "RPM") | ||
set(CPACK_RPM_PACKAGE_RELEASE "1") | ||
set(CPACK_RPM_PACKAGE_LICENSE "Apache") | ||
# set(CPACK_RPM_PACKAGE_REQUIRES "uuid-devel") | ||
endif() | ||
endif() | ||
|
||
message(STATUS "CPack generators: ${CPACK_GENERATOR}") | ||
|
||
include(CPack) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
@PACKAGE_INIT@ | ||
|
||
if(NOT TARGET IonC::ionc) | ||
include(${CMAKE_CURRENT_LIST_DIR}/IonCTargets.cmake) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,47 @@ | ||
cmake_minimum_required(VERSION 3.5 FATAL_ERROR) | ||
|
||
add_library(decNumber | ||
set(declibsrc | ||
decContext.c | ||
decimal128.c | ||
decimal64.c | ||
decimal32.c | ||
decNumber.c | ||
decPacked.c | ||
decQuad.c | ||
) | ||
decQuad.c) | ||
|
||
set(DEC_PUB_HEADERS | ||
include/decNumber/decContext.h | ||
include/decNumber/decDouble.h | ||
include/decNumber/decDPD.h | ||
include/decNumber/decimal128.h | ||
include/decNumber/decimal32.h | ||
include/decNumber/decimal64.h | ||
include/decNumber/decNumber.h | ||
include/decNumber/decNumberLocal.h | ||
include/decNumber/decPacked.h | ||
include/decNumber/decQuad.h | ||
include/decNumber/decSingle.h) | ||
|
||
add_library(decNumber ${declibsrc}) | ||
set_property(TARGET decNumber PROPERTY POSITION_INDEPENDENT_CODE 1) | ||
|
||
target_include_directories(decNumber | ||
PUBLIC | ||
$<INSTALL_INTERFACE:include> | ||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>) | ||
|
||
set_target_properties(decNumber | ||
PROPERTIES | ||
PUBLIC_HEADER "${DEC_PUB_HEADERS}") | ||
|
||
|
||
install(TARGETS decNumber | ||
DESTINATION lib) | ||
|
||
install(FILES include/decNumber/decContext.h | ||
include/decNumber/decDouble.h | ||
include/decNumber/decimal32.h | ||
include/decNumber/decimal64.h | ||
include/decNumber/decimal128.h | ||
include/decNumber/decNumber.h | ||
include/decNumber/decPacked.h | ||
include/decNumber/decQuad.h | ||
include/decNumber/decSingle.h | ||
DESTINATION include/decNumber) | ||
EXPORT IonCTargets | ||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} | ||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/decNumber) | ||
|
||
|
||
install(DIRECTORY include/decNumber | ||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} | ||
FILES_MATCHING PATTERN "*.h") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
cmake_minimum_required(VERSION 3.5 FATAL_ERROR) | ||
|
||
add_subdirectory(ionizer) | ||
add_subdirectory(ionsymbols) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
cmake_minimum_required(VERSION 3.5 FATAL_ERROR) | ||
|
||
add_subdirectory(docopt) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
cmake_minimum_required(VERSION 3.5 FATAL_ERROR) | ||
add_library(ion_events | ||
ion_event_util.cpp | ||
ion_event_stream.cpp | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
cmake_minimum_required(VERSION 3.5 FATAL_ERROR) | ||
|
||
add_executable(ionizer | ||
ionizer_args.c | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
cmake_minimum_required(VERSION 3.5 FATAL_ERROR) | ||
|
||
add_executable(ionsymbols | ||
ionsymbols_args.c | ||
|