-
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.
- Loading branch information
Showing
7 changed files
with
120 additions
and
1 deletion.
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 |
---|---|---|
|
@@ -30,3 +30,8 @@ | |
*.exe | ||
*.out | ||
*.app | ||
|
||
#MacOSX | ||
.DS_Store | ||
|
||
CMakeLists.txt.user |
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 @@ | ||
project (SCONE) | ||
|
||
cmake_minimum_required(VERSION 3.11) | ||
|
||
set(CMAKE_CXX_STANDARD 14) | ||
|
||
set(CMAKE_DISABLE_IN_SOURCE_BUILD ON) | ||
|
||
include_directories(PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) | ||
file(GLOB_RECURSE SRC ${CMAKE_SOURCE_DIR}/src/*.*) | ||
file(GLOB_RECURSE HDR ${CMAKE_SOURCE_DIR}/src/*.h) | ||
|
||
add_library(SCONE ${SRC}) | ||
set_target_properties(SCONE PROPERTIES PUBLIC_HEADER "${HDR}") | ||
|
||
if(NOT SCONE_BUILD_LIB_ONLY) | ||
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/test") | ||
endif() | ||
|
||
include(GNUInstallDirs) | ||
install(TARGETS SCONE | ||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} | ||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/SCONE") |
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 +1 @@ | ||
# SCONE | ||
# SCONE - Smart Containers |
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,11 @@ | ||
#include "TaggedPtr.h" | ||
|
||
namespace SCONE | ||
{ | ||
|
||
TaggedPtr::TaggedPtr() | ||
{ | ||
|
||
} | ||
|
||
} // namespace SCONE |
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,12 @@ | ||
#pragma once | ||
|
||
namespace SCONE | ||
{ | ||
|
||
class TaggedPtr | ||
{ | ||
public: | ||
TaggedPtr(); | ||
}; | ||
|
||
} // namespace SCONE |
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,58 @@ | ||
# We need thread support | ||
find_package(Threads REQUIRED) | ||
|
||
# Enable ExternalProject CMake module | ||
include(ExternalProject) | ||
|
||
set(GTEST_DIR "${CMAKE_CURRENT_BINARY_DIR}/gtest") | ||
set(GTEST_BINARY_DIR "${GTEST_DIR}/bin") | ||
|
||
set(GMOCK_LIB_PATH "${GTEST_BINARY_DIR}/lib/libgmock.a") | ||
set(GTEST_LIB_PATH "${GTEST_BINARY_DIR}/lib/libgtest.a") | ||
|
||
# Download and install GoogleTest | ||
ExternalProject_Add( | ||
gtest | ||
URL https://github.com/google/googletest/archive/master.zip | ||
PREFIX ${GTEST_DIR} | ||
BINARY_DIR ${GTEST_BINARY_DIR} | ||
BUILD_BYPRODUCTS ${GMOCK_LIB_PATH} ${GTEST_LIB_PATH} | ||
# Disable install step | ||
INSTALL_COMMAND "" | ||
) | ||
|
||
# Get GTest source and binary directories from CMake project | ||
ExternalProject_Get_Property(gtest source_dir) | ||
|
||
# Create a libgtest target to be used as a dependency by test programs | ||
add_library(libgtest STATIC IMPORTED) | ||
|
||
# Set libgtest properties | ||
set_target_properties(libgtest PROPERTIES | ||
"IMPORTED_LOCATION" "${GTEST_LIB_PATH}" | ||
"IMPORTED_LINK_INTERFACE_LIBRARIES" "${CMAKE_THREAD_LIBS_INIT}" | ||
) | ||
add_dependencies(libgtest gtest) | ||
|
||
# Create a libgmock target to be used as a dependency by test programs | ||
add_library(libgmock STATIC IMPORTED) | ||
|
||
# Set libgmock properties | ||
set_target_properties(libgmock PROPERTIES | ||
"IMPORTED_LOCATION" "${GMOCK_LIB_PATH}" | ||
"IMPORTED_LINK_INTERFACE_LIBRARIES" "${CMAKE_THREAD_LIBS_INIT}" | ||
) | ||
add_dependencies(libgmock gtest) | ||
|
||
include_directories("${source_dir}/googletest/include" | ||
"${source_dir}/googlemock/include") | ||
|
||
file(GLOB_RECURSE SRC ${CMAKE_CURRENT_SOURCE_DIR}/*.*) | ||
|
||
add_executable(tests ${SRC}) | ||
add_dependencies(tests gtest) | ||
target_link_libraries(tests LINK_PUBLIC | ||
SCONE | ||
libgtest | ||
libgmock | ||
) |
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,8 @@ | ||
#include "gtest/gtest.h" | ||
|
||
int main(int argc, char **argv) | ||
{ | ||
::testing::InitGoogleTest(&argc, argv); | ||
int ret = RUN_ALL_TESTS(); | ||
return ret; | ||
} |