cpp-exercises/CMakeLists.txt

44 lines
1.6 KiB
Text
Raw Permalink Normal View History

cmake_minimum_required(VERSION 2.8)
2014-04-13 08:37:49 +02:00
# Build options
2014-04-13 14:13:47 +02:00
set(CMAKE_CXX_COMPILER "g++") # (g++ seems to actually do something with -Weffc++)
2014-04-13 08:37:49 +02:00
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic -Wextra -Weffc++")
2014-04-13 08:59:28 +02:00
add_executable(typetest typetest.cpp)
2014-04-13 08:37:49 +02:00
add_executable(auto_ptr auto_ptr.cpp)
add_executable(unique_ptr unique_ptr.cpp)
2014-04-13 09:10:08 +02:00
add_executable(list-initializers list-initializers.cpp)
2014-04-13 09:48:04 +02:00
add_executable(array-bounds array-bounds.cpp)
2014-04-13 10:03:09 +02:00
add_executable(accumulate accumulate.cpp)
2014-04-13 10:12:03 +02:00
add_executable(object-lifetime object-lifetime.cpp)
2014-04-13 11:21:28 +02:00
add_executable(shared_ptr shared_ptr.cpp)
2014-04-13 14:13:47 +02:00
add_executable(casts casts.cpp)
2014-04-13 14:39:15 +02:00
add_executable(classes classes.cpp)
2014-04-15 20:36:21 +02:00
add_executable(lvalues lvalues.cpp)
2014-04-18 12:26:11 +02:00
add_executable(bad_alloc bad_alloc.cpp)
2014-04-26 16:31:07 +02:00
add_executable(rtti rtti.cpp)
2014-08-18 22:03:57 +02:00
add_executable(poly poly.cpp)
2014-08-18 19:50:41 +02:00
add_executable(division division.cpp)
2014-08-24 14:59:54 +02:00
add_executable(malloc-new malloc-new.cpp)
add_executable(ohai-const-strings ohai-const-strings.cpp)
2014-05-10 18:55:16 +02:00
add_executable(future future.cpp)
set_target_properties(future PROPERTIES LINK_FLAGS "-pthread")
# those are c++14:
add_executable(return-type-deduction return-type-deduction.cpp)
#XXX a bit ugly, as the -std=c++1y gets appended to the other flags, which say -std=c++11
set_source_files_properties(return-type-deduction.cpp PROPERTIES COMPILE_FLAGS "-std=c++1y")
2014-08-18 22:02:12 +02:00
# checks
add_custom_command(OUTPUT check-cpplint
COMMAND find . -path ./ext -prune -or -path ./*CMakeFiles -prune -or \( -name *.cc -or -name *.cpp \) -print0 | xargs -0 cpplint
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT "Running cpplint" VERBATIM
)
add_custom_target(check
DEPENDS check-cpplint
)