Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xs-test
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Patrick Chen
xs-test
Commits
19563ed6
Commit
19563ed6
authored
Aug 30, 2018
by
Patrick Chen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use CMake to build targets
parent
8d530c1b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
78 additions
and
51 deletions
+78
-51
CMakeLists.txt
CMakeLists.txt
+78
-0
Makefile
Makefile
+0
-51
No files found.
CMakeLists.txt
0 → 100644
View file @
19563ed6
cmake_minimum_required
(
VERSION 3.5
)
set
(
CMAKE_FIND_LIBRARY_PREFIXES
"lib"
)
set
(
CMAKE_FIND_LIBRARY_SUFFIXES
".so"
)
set
(
PROJECT_ROOT_DIR
"
${
CMAKE_CURRENT_SOURCE_DIR
}
"
)
set
(
PROJECT_INCLUDE_DIR
"
${
PROJECT_ROOT_DIR
}
/include"
)
set
(
PROJECT_SOURCE_DIR
"
${
PROJECT_ROOT_DIR
}
/src"
)
# setup language
enable_language
(
CXX
)
set
(
CMAKE_CXX_STANDARD 14
)
set
(
CMAKE_CXX_FLAGS
"-std=c++14 -pedantic"
)
# find packages/library files
find_package
(
Boost COMPONENTS filesystem system
)
if
(
NOT Boost_FOUND
)
message
(
SEND_ERROR
"cannot find at least one Boost components"
)
endif
()
# setup exchange-server libraries
set
(
ES_LIBS
-l:libexchange_server.a
-l:libomniDynamic4.a
-l:libCOSNotify4.a
-l:libCOS4.a
-l:libomniZIOP4.a
-l:libomniCodeSets4.a
-l:libomniORB4.a
-l:libomnithread.a
z
pthread
)
# setup xs-test project
set
(
XS_TEST_SRCS
${
PROJECT_SOURCE_DIR
}
/xs-test.cc
${
PROJECT_SOURCE_DIR
}
/test/Config.cc
${
PROJECT_SOURCE_DIR
}
/test/Expectation.cc
${
PROJECT_SOURCE_DIR
}
/test/Service.cc
${
PROJECT_SOURCE_DIR
}
/test/Tester.cc
)
set
(
XS_TEST_LIBS
${
Boost_LIBRARIES
}
${
ES_LIBS
}
)
project
(
xs-test
)
add_executable
(
xs-test
${
XS_TEST_SRCS
}
)
target_include_directories
(
xs-test PRIVATE
"/usr/local/include"
${
PROJECT_INCLUDE_DIR
}
)
target_link_libraries
(
xs-test
${
XS_TEST_LIBS
}
)
# setup greeting project
set
(
GREETING_SRCS
${
PROJECT_ROOT_DIR
}
/example/greeting.cc
)
set
(
GREETING_LIBS
${
ES_LIBS
}
)
project
(
greeting
)
add_executable
(
greeting
${
GREETING_SRCS
}
)
target_include_directories
(
greeting PRIVATE
"/usr/local/include"
)
target_link_libraries
(
greeting
${
GREETING_LIBS
}
)
Makefile
deleted
100644 → 0
View file @
8d530c1b
REPO_DIR
=
$(
shell
pwd
)
INCLUDE_DIR
=
$(REPO_DIR)
/include
SRC_DIR
=
$(REPO_DIR)
/src
BUILD_DIR
=
$(REPO_DIR)
/build
CXX
=
clang++
CXX_FLAGS
=
-g
-std
=
c++14
\
-I
/usr/local/include
\
-I
$(INCLUDE_DIR)
LD_FLAGS
=
-L
/usr/local/lib
\
-lboost_system
\
-lboost_filesystem
\
-l
:libexchange_server.a
\
-l
:libomniDynamic4.a
\
-l
:libCOSNotify4.a
\
-l
:libCOS4.a
\
-l
:libomniZIOP4.a
\
-l
:libomniCodeSets4.a
\
-l
:libomniORB4.a
\
-l
:libomnithread.a
\
-lz
\
-lpthread
XSTEST_HDRS
=
$(INCLUDE_DIR)
/test/Config.h
$(INCLUDE_DIR)
/test/Service.h
$(INCLUDE_DIR)
/test/Tester.h
$(INCLUDE_DIR)
/test/Expectation.h
XSTEST_SRCS
=
$(SRC_DIR)
/xs-test.cc
$(SRC_DIR)
/test/Config.cc
$(SRC_DIR)
/test/Service.cc
$(SRC_DIR)
/test/Tester.cc
$(SRC_DIR)
/test/Expectation.cc
XSTEST_OBJS
=
$
(
subst
$(REPO_DIR)
,
$(BUILD_DIR)
,
$
(
XSTEST_SRCS:.cc
=
.o
))
GREETING_SRCS
=
$(REPO_DIR)
/example/greeting.cc
GREETING_OBJS
=
$
(
subst
$(REPO_DIR)
,
$(BUILD_DIR)
,
$
(
GREETING_SRCS:.cc
=
.o
))
all
:
$(BUILD_DIR)/xs-test example
$(BUILD_DIR)/xs-test
:
$(XSTEST_OBJS)
$(CXX)
-o
$@
$(XSTEST_OBJS)
$(LD_FLAGS)
$(BUILD_DIR)/%.o
:
$(REPO_DIR)/%.cc $(XSTEST_HDRS)
mkdir
-p
$
(
dir
$@
)
$(CXX)
-o
$@
-c
$(CXX_FLAGS)
$<
example
:
$(BUILD_DIR)/greeting
$(BUILD_DIR)/greeting
:
$(GREETING_OBJS)
$(CXX)
-o
$@
$(GREETING_OBJS)
$(LD_FLAGS)
clean
:
rm
-rf
$(BUILD_DIR)
/xs-test
rm
-rf
$(BUILD_DIR)
/greeting
rm
-rf
$(XSTEST_OBJS)
rm
-rf
$(GREETING_OBJS)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment