2016-10-23 01:45:20 +00:00
|
|
|
cmake_minimum_required(VERSION 3.6)
|
|
|
|
project(cpp11NHF1_refcountedString)
|
|
|
|
|
|
|
|
set(CMAKE_CXX_STANDARD 14)
|
2016-10-28 18:25:43 +00:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic -Wno-unused-comparison")
|
2016-10-23 01:45:20 +00:00
|
|
|
|
2016-10-28 18:25:43 +00:00
|
|
|
set(STRING_FILES String.cpp String.h StringValue.cpp StringValue.h Char.cpp Char.h)
|
|
|
|
set(UNIT_SOURCE_FILES ${STRING_FILES} test.cpp)
|
|
|
|
set(MANUAL_SOURCE_FILES ${STRING_FILES} manualtest.cpp)
|
2016-10-23 22:10:53 +00:00
|
|
|
|
2016-10-23 01:45:20 +00:00
|
|
|
include(FindGTest)
|
|
|
|
enable_testing()
|
2016-10-28 18:25:43 +00:00
|
|
|
find_package(GTest)
|
|
|
|
|
|
|
|
if(GTEST_FOUND)
|
|
|
|
find_package(Threads REQUIRED)
|
|
|
|
link_libraries(${CMAKE_THREAD_LIBS_INIT})
|
|
|
|
include_directories(${GTEST_INCLUDE_DIRS})
|
|
|
|
link_libraries(${GTEST_BOTH_LIBRARIES})
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-gnu-zero-variadic-macro-arguments")
|
|
|
|
add_executable(cpp11NHF1_refcountedString ${UNIT_SOURCE_FILES})
|
|
|
|
else(GTEST_FOUND)
|
|
|
|
add_executable(cpp11NHF1_refcountedString ${MANUAL_SOURCE_FILES})
|
|
|
|
endif(GTEST_FOUND)
|
2016-10-23 01:45:20 +00:00
|
|
|
|