Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 11 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
cmake_minimum_required (VERSION 3.11)
cmake_minimum_required (VERSION 3.16)
project (cppbor)

set(CMAKE_CXX_COMPILER /Library/Developer/CommandLineTools/usr/bin/clang++)
set(CMAKE_CXX_STANDARD 17)
include_directories(SYSTEM /Library/Developer/CommandLineTools/usr/include/c++/v1)
include_directories(/usr/local/include)
link_directories(/usr/local/lib)
link_directories(/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib)
if(NOT DEFINED CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
endif()

file(GLOB test_sources cppbor/test_sources/*)
file(COPY ${test_sources} DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
add_executable(cppbor cppbor/main cppbor/cppbor)
target_link_libraries(cppbor c++ cppunit)
add_executable(bench bench.cpp cppbor/cppbor)
target_link_libraries(bench c++)
set(CMAKE_BUILD_TYPE Release)
add_library(cppbor src/cppbor.cpp)
target_include_directories(cppbor PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include/)

include(CTest)
if(BUILD_TESTING)
add_subdirectory(test)
endif()
2 changes: 0 additions & 2 deletions cppbor.config

This file was deleted.

1 change: 0 additions & 1 deletion cppbor.creator

This file was deleted.

8 changes: 0 additions & 8 deletions cppbor.files

This file was deleted.

2 changes: 0 additions & 2 deletions cppbor.includes

This file was deleted.

File renamed without changes.
File renamed without changes.
12 changes: 12 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
find_library(CPPUNIT_LIBRARY cppunit)
find_path(CPPUNIT_INCLUDE_DIR cppunit/extensions/HelperMacros.h)
if(NOT CPPUNIT_LIBRARY OR NOT CPPUNIT_INCLUDE_DIR)
message(SEND_ERROR "Could not find cppunit for tests")
endif()

add_executable(test_main main.cpp)
target_include_directories(test_main PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(test_main ${CPPUNIT_LIBRARY} cppbor)
add_test(NAME main_test COMMAND test_main
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/test_sources
)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.