This repository has been archived by the owner on Nov 4, 2023. It is now read-only.
-
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
Patrick Cox
committed
Mar 19, 2019
1 parent
b33155b
commit e71fcbf
Showing
1 changed file
with
47 additions
and
0 deletions.
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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
cmake_minimum_required(VERSION 3.13 FATAL_ERROR) | ||
project(Whoops VERSION 1.1 LANGUAGES CXX) | ||
|
||
# Options | ||
OPTION(BUILD_SHARED_LIBS "Build ${PROJECT_NAME}.a rather than ${PROJECT_NAME}.so" OFF) | ||
|
||
# ----------------------------------------------------------------------------- | ||
# Build settings | ||
# ----------------------------------------------------------------------------- | ||
|
||
# C++ requirements | ||
# ---------------- | ||
set(CMAKE_CXX_STANDARD 17) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
set(CMAKE_CXX_EXTENSIONS OFF) | ||
set(CMAKE_COLOR_MAKEFILE ON) | ||
|
||
# Build settings | ||
# -------------- | ||
include_directories("${CMAKE_SOURCE_DIR}") | ||
set(CMAKE_BINARY_DIR ${CMAKE_SOURCE_DIR}/build) | ||
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin) | ||
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib) | ||
|
||
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") | ||
message("-- Configuring clang options") | ||
set(CMAKE_CXX_FLAGS "-arch x86_64 -std=c++17 -stdlib=libc++ -DBOOST_LOG_DYN_LINK -Wno-deprecated-declarations") | ||
elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU") | ||
message("-- Configuring gcc options") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++17 -DBOOST_LOG_DYN_LINK") | ||
endif() | ||
|
||
# ----------------------------------------------------------------------------- | ||
# Create target and set properties | ||
# ----------------------------------------------------------------------------- | ||
|
||
# Set the library sources | ||
# ----------------------- | ||
set(SOURCES | ||
src/peg.cpp | ||
src/board.cpp | ||
src/main.cpp | ||
) | ||
|
||
# Create the executable | ||
# --------------------- | ||
add_executable(${PROJECT_NAME} ${SOURCES}) |