Skip to content

Commit d08c24a

Browse files
committed
Add Visual Studio compilation support
1 parent 1163d85 commit d08c24a

5 files changed

+817
-9
lines changed

CMakeLists.txt

+23-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,28 @@
11
cmake_minimum_required(VERSION 3.7)
2+
23
project(HyperplaneFinder)
4+
enable_language(CXX)
5+
6+
include(common.cmake)
7+
8+
set(CMAKE_DEBUG_POSTFIX _d)
9+
10+
# By default build in Release mode
11+
if( NOT CMAKE_BUILD_TYPE )
12+
set(CMAKE_BUILD_TYPE "Release")
13+
endif()
314

4-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -pedantic -pedantic-errors -Wall -Wextra -Wcast-align -Wcast-qual -Wdisabled-optimization -Wformat=2 -Winit-self -Wlogical-op -Wmissing-declarations -Wmissing-include-dirs -Wstrict-overflow=5 -Wredundant-decls -Wshadow -Wsign-conversion -Wundef -Wfatal-errors -Wvector-operation-performance -Winvalid-pch -Wconversion -Wdouble-promotion -Wunreachable-code -Wfloat-equal -Wold-style-cast -Weffc++ -Woverloaded-virtual -Wstrict-null-sentinel -Wsign-promo -Wnoexcept -Wctor-dtor-privacy -Wdelete-non-virtual-dtor -Wnon-virtual-dtor -Wsuggest-final-types -Wzero-as-null-pointer-constant -Wuseless-cast")
15+
get_filename_component(root_dir ${CMAKE_SOURCE_DIR} REALPATH)
16+
get_filename_component(src_dir ${root_dir}/src REALPATH)
517

6-
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3")
7-
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -pg")
8-
include_directories(src)
18+
get_files(
19+
files "${src_dir}"
20+
OPTIONS recurse
21+
)
922

10-
set(SOURCE_FILES src/main.cpp)
11-
add_executable(HyperplaneFinder ${SOURCE_FILES})
23+
make_target(
24+
HyperplaneFinder "HyperplaneFinder" ${files}
25+
INCLUDES "${src_dir}"
26+
OPTIONS cxx executable
27+
)
28+
set_property(TARGET HyperplaneFinder PROPERTY CXX_STANDARD 17)

0 commit comments

Comments
 (0)