-
Notifications
You must be signed in to change notification settings - Fork 1
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
1 parent
ae71e23
commit 2e466c7
Showing
9 changed files
with
96 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,76 @@ | ||
cmake_minimum_required(VERSION 3.12) | ||
set(CMAKE_CXX_STANDARD 17) | ||
project(aare | ||
VERSION 0.1 | ||
DESCRIPTION "Data processing library for PSI detectors" | ||
HOMEPAGE_URL "https://github.com/slsdetectorgroup/aare" | ||
LANGUAGES C CXX | ||
) | ||
# cmake_policy(SET CMP0135 NEW) | ||
|
||
# include(GNUInstallDirs) | ||
|
||
# include(cmake/helpers.cmake) | ||
# default_build_type("Debug")] | ||
|
||
set(CMAKE_BUILD_TYPE "Debug") | ||
|
||
if (CMAKE_BUILD_TYPE STREQUAL "Debug") | ||
set(OPTIMIZATION_FLAGS "-Og -ggdb3") | ||
else() | ||
set(OPTIMIZATION_FLAGS "-O3") | ||
|
||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) | ||
|
||
option(USE_SANITIZER "Sanitizers for debugging" ON) | ||
option(DISABLE_WARNINGS "Disbale compilation warnings" OFF) | ||
# option(USE_TESTS "Unit tests" OFF) | ||
# option(USE_PYTHON "Python bindings" OFF) | ||
# option(TUNE_LOCAL "Tune to exact CPU architecture" OFF) | ||
# option(BUILD_EXAMPLES "Build examples" OFF) | ||
# option(DISABLE_LTO "Disable Link Time Optimizations" OFF) | ||
|
||
|
||
# if(NOT APPLE) | ||
# set(CMAKE_INSTALL_RPATH $ORIGIN) | ||
# endif() | ||
|
||
set(OPTIONAL_FLAGS "") | ||
if(DISABLE_WARNINGS) | ||
set(OPTIONAL_FLAGS "${OPTIONAL_FLAGS} -Wall -Wextra -pedantic -Wno-unused-parameter -Wshadow -Wformat=2 -Wold-style-cast -Wnon-virtual-dtor -Wfloat-equal -Wconversion -Wlogical-op -Wshift-overflow=2 -Woverloaded-virtual -Winline") | ||
endif() | ||
|
||
if(USE_SANITIZER) | ||
set(OPTIONAL_FLAGS "${OPTIONAL_FLAGS} -fdiagnostics-parseable-fixits -fdiagnostics-generate-patch | ||
-fdiagnostics-show-template-tree -fsanitize=address,undefined -fno-sanitize-recover | ||
-D_FORTIFY_SOURCE=2 -fstack-protector") | ||
endif() | ||
|
||
# if(TUNE_LOCAL) | ||
# if(UNIX AND NOT APPLE) | ||
# message(STATUS "unix") | ||
# set(ARCH_FLAGS ) | ||
# target_compile_options(project_options INTERFACE -mtune=native -march=native ) | ||
# elseif(APPLE) | ||
# message(STATUS "compiling for apple") | ||
# target_compile_options(project_options INTERFACE -mtune=apple-m1 -mcpu=apple-m1 ) | ||
# endif() | ||
# # | ||
# endif() | ||
|
||
if | ||
set(CMAKE_CXX_FLAGS "") | ||
|
||
|
||
#Enable LTO if available | ||
include(CheckIPOSupported) | ||
check_ipo_supported(RESULT LTO_AVAILABLE) | ||
if((CMAKE_BUILD_TYPE STREQUAL "Release") AND LTO_AVAILABLE) | ||
message(STATUS "Building with link time optimization") | ||
else() | ||
message(STATUS "Building without link time optimization") | ||
endif() | ||
|
||
add_executable(aare) | ||
|
||
add_subdirectory(src) |
Empty file.
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,6 @@ | ||
function(default_build_type val) | ||
if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) | ||
message(STATUS "No build type selected, default to Release") | ||
set(CMAKE_BUILD_TYPE ${val} CACHE STRING "Build type (default ${val})" FORCE) | ||
endif() | ||
endfunction() |
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,6 @@ | ||
add_subdirectory(file_io) | ||
add_subdirectory(models) | ||
add_subdirectory(processing) | ||
|
||
target_include_directories(aare PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) | ||
target_sources(aare PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) |
Empty file.
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,8 @@ | ||
// Your First C++ Program | ||
|
||
#include <iostream> | ||
|
||
int main() { | ||
std::cout << "Hello World!"; | ||
return 0; | ||
} |
Empty file.
Empty file.
Empty file.