-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Set CMake and Travis CI. * Fix an issue and naming and line break conventions.
- Loading branch information
1 parent
f46441f
commit 061c777
Showing
9 changed files
with
121 additions
and
33 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
language: cpp | ||
compiler: | ||
- gcc-5 | ||
os: | ||
- linux | ||
|
||
addons: | ||
apt: | ||
sources: | ||
- ubuntu-toolchain-r-test | ||
packages: | ||
- gcc-5 | ||
- g++-5 | ||
|
||
script: | ||
- mkdir Projects/CMake/Build -p | ||
- cd Projects/CMake/Build | ||
- export CC=gcc-5 | ||
- export CXX=g++-5 | ||
- cmake --version | ||
- cmake .. -DCMAKE_INSTALL_PREFIX:PATH=./Artifact | ||
- make | ||
- make install | ||
- ./Artifact/bin/Test | ||
after_success: |
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,17 @@ | ||
cmake_minimum_required (VERSION 3.5) | ||
|
||
set(REPO_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../..) | ||
set(CMAKE_PROJECT_ROOT ${REPO_ROOT}/Projects/CMake) | ||
set(LOCAL_BUILD_DIR ${CMAKE_PROJECT_ROOT}/Build) | ||
if(WIN32) | ||
set(LOCAL_INCLUDE_DIR ${LOCAL_BUILD_DIR}/Include) | ||
else() | ||
set(LOCAL_INCLUDE_DIR ${LOCAL_BUILD_DIR}/include) | ||
endif() | ||
set(CMAKE_CXX_STANDARD 11) | ||
|
||
add_subdirectory(Utility) | ||
add_subdirectory(googletest) | ||
add_subdirectory(MDP) | ||
add_subdirectory(Test) | ||
|
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,16 @@ | ||
project(MDP) | ||
|
||
add_custom_target(${PROJECT_NAME}_HEADERS ALL | ||
${CMAKE_COMMAND} -E make_directory ${LOCAL_INCLUDE_DIR}/${PROJECT_NAME} | ||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${REPO_ROOT}/Messenger/Include/ ${LOCAL_INCLUDE_DIR}/${PROJECT_NAME}) | ||
|
||
add_library(${PROJECT_NAME} INTERFACE) | ||
target_include_directories(${PROJECT_NAME} INTERFACE ${LOCAL_INCLUDE_DIR}) | ||
add_dependencies(${PROJECT_NAME} ${PROJECT_NAME}_HEADERS) | ||
|
||
if(WIN32) | ||
install(DIRECTORY ${REPO_ROOT}/Messenger/Include/ DESTINATION Include/${PROJECT_NAME}) | ||
else() | ||
install(DIRECTORY ${REPO_ROOT}/Messenger/Include/ DESTINATION include/${PROJECT_NAME}) | ||
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
project(Test CXX) | ||
|
||
include_directories(${gtest_SOURCE_DIR}/include ${gtest_SOURCE_DIR}) | ||
include_directories(${LOCAL_INCLUDE_DIR}) | ||
|
||
file(GLOB CPP_FILES ${REPO_ROOT}/${PROJECT_NAME}/Source/*.cpp) | ||
add_executable(${PROJECT_NAME} ${CPP_FILES}) | ||
target_link_libraries(${PROJECT_NAME} gtest gtest_main MDP Utility) | ||
|
||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT") | ||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd") | ||
|
||
if(WIN32) | ||
install(TARGETS ${PROJECT_NAME} | ||
LIBRARY DESTINATION Lib | ||
RUNTIME DESTINATION Bin | ||
ARCHIVE DESTINATION Lib) | ||
else() | ||
install(TARGETS ${PROJECT_NAME} | ||
LIBRARY DESTINATION lib | ||
RUNTIME DESTINATION bin | ||
ARCHIVE DESTINATION lib) | ||
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
set(REPO_ROOT ${REPO_ROOT}/Dependencies/Utility/) | ||
add_subdirectory(${REPO_ROOT}/Projects/CMake/Utility Utility) |
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 @@ | ||
add_subdirectory(${REPO_ROOT}/Dependencies/googletest/googletest/ gtest) |
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