cmake_minimum_required(VERSION 3.5.0)

project(prjxray)
option(PRJXRAY_BUILD_TESTING "" ON)

set(CMAKE_CXX_FLAGS "-std=c++11 -Wall -Werror ${CMAKE_CXX_FLAGS}" )

# Hack for missing option in cctz
option(BUILD_TESTING "" OFF)


if(PRJXRAY_BUILD_TESTING)
	enable_testing()
	add_compile_options(-O0 -g)
else()
	add_compile_options(-O3)
endif()

add_subdirectory(third_party/googletest EXCLUDE_FROM_ALL)
add_subdirectory(third_party/gflags EXCLUDE_FROM_ALL)
add_subdirectory(third_party/cctz EXCLUDE_FROM_ALL)
add_subdirectory(third_party/abseil-cpp EXCLUDE_FROM_ALL)

add_subdirectory(lib)
add_subdirectory(tools)

cmake_minimum_required(VERSION 3.5.0)

project(prjxray)
option(PRJXRAY_BUILD_TESTING "" ON)

set(CMAKE_CXX_STANDARD 14)
add_compile_options(-Wall -Werror)

# Hack for missing option in cctz
option(BUILD_TESTING "" OFF)


if(PRJXRAY_BUILD_TESTING)
	enable_testing()
	add_compile_options(-O0 -g)
else()
	add_compile_options(-O3)
endif()

add_subdirectory(third_party/googletest EXCLUDE_FROM_ALL)
add_subdirectory(third_party/gflags EXCLUDE_FROM_ALL)
add_subdirectory(third_party/cctz EXCLUDE_FROM_ALL)
add_subdirectory(third_party/abseil-cpp EXCLUDE_FROM_ALL)

add_subdirectory(lib)
add_subdirectory(tools)

Use proper CMake mechanisms to set compiler settings
Use proper CMake mechanisms to set compiler settings

By setting CMAKE_CXX_STANDARD, CMake will figure out the right flag to
pass to the compiler being used as well as error if the compiler doesn't
support that standard.  The standard can also be changed on a per-target
basis.

Using add_compiler_options() is just a bit cleaner syntactically and
will apply the flags to C and C++.

Signed-off-by: Rick Altherr <8d1509bf509ebdf080240b52ca7c44886e3b1782@kc8apf.net>
Signed-off-by: Tim 'mithro' Ansell <57310ee00039176189a7bd7b876cda4d0d2a19aa@mithis.com>

