Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PacketLib
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Andrea Bulgarelli
PacketLib
Commits
a47fa194
Commit
a47fa194
authored
10 years ago
by
Andrea Zoli
Browse files
Options
Downloads
Patches
Plain Diff
Add cmake build system.
parent
772589f9
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
CMakeLists.txt
+40
-0
40 additions, 0 deletions
CMakeLists.txt
CMakeModules/EnsureOutOfSourceBuild.cmake
+24
-0
24 additions, 0 deletions
CMakeModules/EnsureOutOfSourceBuild.cmake
src/CMakeLists.txt
+25
-0
25 additions, 0 deletions
src/CMakeLists.txt
with
89 additions
and
0 deletions
CMakeLists.txt
0 → 100644
+
40
−
0
View file @
a47fa194
cmake_minimum_required
(
VERSION 2.8 FATAL_ERROR
)
macro
(
MACRO_ENSURE_OUT_OF_SOURCE_BUILD _errorMessage
)
string
(
COMPARE EQUAL
"
${
CMAKE_SOURCE_DIR
}
"
"
${
CMAKE_BINARY_DIR
}
"
_insource
)
if
(
_insource
)
message
(
SEND_ERROR
"
${
_errorMessage
}
"
)
message
(
FATAL_ERROR
"In-source builds are not allowed.
This process created the file `CMakeCache.txt' and the directory `CMakeFiles and overwrite the Makefile.
Please fix them with:
rm -r CMakeCache.txt CMakeFiles
git checkout Makefile
CMake would overwrite the makefiles distributed with Compiler-RT.
Please create a directory outside the source directory and run cmake
from there, passing the path to this source directory as the last argument.
Example for the lazy people:
mkdir ../PacketLib_build
cd ../PacketLib_build
cmake ../PacketLib
"
)
endif
(
_insource
)
endmacro
(
MACRO_ENSURE_OUT_OF_SOURCE_BUILD
)
set
(
CMAKE_MODULE_PATH
${
PROJECT_SOURCE_DIR
}
/CMakeModules
)
MACRO_ENSURE_OUT_OF_SOURCE_BUILD
(
"In-source build error."
)
project
(
packet
)
set
(
packet_MAJOR_VERSION 4
)
set
(
packet_MINOR_VERSION 3
)
set
(
packet_PATCH_VERSION 0
)
set
(
packet_VERSION
${
packet_MAJOR_VERSION
}
.
${
packet_MINOR_VERSION
}
.
${
packet_PATCH_VERSION
}
)
set
(
PROJECT_VERSION
${
packet_VERSION
}
)
add_subdirectory
(
src
)
This diff is collapsed.
Click to expand it.
CMakeModules/EnsureOutOfSourceBuild.cmake
0 → 100644
+
24
−
0
View file @
a47fa194
macro
(
MACRO_ENSURE_OUT_OF_SOURCE_BUILD _errorMessage
)
string
(
COMPARE EQUAL
"
${
CMAKE_SOURCE_DIR
}
"
"
${
CMAKE_BINARY_DIR
}
"
_insource
)
if
(
_insource
)
message
(
SEND_ERROR
"
${
_errorMessage
}
"
)
message
(
FATAL_ERROR
"In-source builds are not allowed.
This process created the file `CMakeCache.txt' and the directory `CMakeFiles and overwrite the Makefile.
Please fix them with:
rm -r CMakeCache.txt CMakeFiles
git checkout Makefile
CMake would overwrite the makefiles distributed with Compiler-RT.
Please create a directory outside the source directory and run cmake
from there, passing the path to this source directory as the last argument.
Example for the lazy people:
mkdir ../PacketLib_build
cd ../PacketLib_build
cmake ../PacketLib
"
)
endif
(
_insource
)
endmacro
(
MACRO_ENSURE_OUT_OF_SOURCE_BUILD
)
This diff is collapsed.
Click to expand it.
src/CMakeLists.txt
0 → 100644
+
25
−
0
View file @
a47fa194
set
(
SOURCES ByteStream.cpp File.cpp InputPacketStream.cpp InputTextFile.cpp OutputPacketStream.cpp
PacketBufferV.cpp PacketHeader.cpp SDFBlock.cpp SocketServer.cpp ConfigurationFile.cpp
FileStream.cpp InputPacketStreamFile.cpp MSGQ.cpp OutputSerial.cpp PacketDataField.cpp
PacketIdentifier.cpp SHM.cpp SourceDataField.cpp DataFieldHeader.cpp FileStreamPointer.cpp
InputSerial.cpp MemoryBuffer.cpp OutputSocketClient.cpp PacketException.cpp
PacketNotRecognized.cpp Serial.cpp Utility.cpp Device.cpp Input.cpp InputSocketServer.cpp
Output.cpp Packet.cpp PacketExceptionFileFormat.cpp PacketStream.cpp Socket.cpp pugixml.cpp
Field.cpp InputFile.cpp InputText.cpp OutputFile.cpp PacketBufferQ.cpp PacketExceptionIO.cpp
PartOfPacket.cpp SocketClient.cpp
lz4.c lz4hc.c
)
# libpacket.a and libpacket.so
include_directories
(
${
CMAKE_SOURCE_DIR
}
/include
)
add_library
(
${
CMAKE_PROJECT_NAME
}
SHARED
${
SOURCES
}
)
add_library
(
${
CMAKE_PROJECT_NAME
}
static STATIC
${
SOURCES
}
)
set_target_properties
(
${
CMAKE_PROJECT_NAME
}
static PROPERTIES OUTPUT_NAME
${
CMAKE_PROJECT_NAME
}
)
set_target_properties
(
${
CMAKE_PROJECT_NAME
}
PROPERTIES SOVERSION
${
PROJECT_VERSION
}
)
target_link_libraries
(
${
CMAKE_PROJECT_NAME
}
${
LIBS
}
)
# make install
file
(
GLOB HEADERS
"
${
PROJECT_SOURCE_DIR
}
/include/*.h"
)
install
(
FILES
${
HEADERS
}
DESTINATION include/packet
)
install
(
TARGETS
${
CMAKE_PROJECT_NAME
}
DESTINATION lib
)
file
(
MAKE_DIRECTORY
${
CMAKE_CURRENT_BINARY_DIR
}
/../doc
)
install
(
DIRECTORY
${
CMAKE_CURRENT_BINARY_DIR
}
/../doc DESTINATION .
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment