Skip to content

Commit f67c8f1

Browse files
committed
Updated CMake for Visual Studio
Detailed in CMakeLists.txt
1 parent 136cc67 commit f67c8f1

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

CMakeLists.txt

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,16 @@
2222
# cd build_directory
2323
# cmakerelease ..
2424

25+
# To build with Visual Studio (use cmake or cmake.exe or path/cmake.exe depending of your configuration)
26+
# mkdir build_directory
27+
# cd build_directory
28+
# cmake .. -G "Visual Studio 10 Win64"
29+
# cmake.exe .. -G "Visual Studio 11 2012"
30+
# cmake.exe .. -G "Visual Studio 12 2013"
31+
# cmake.exe .. -G "Visual Studio 13 2014"
32+
# cmake.exe .. -G "Visual Studio 14 2015"
33+
34+
2535
# Recent version of CMake required
2636
cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
2737

@@ -60,10 +70,15 @@ set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
6070
# MinSizeRel
6171
set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL}")
6272

63-
# Basic options for all builds
64-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic -Wextra -Wshadow")
65-
# Might need to be fixed for retrocompatibility or temporary
66-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-c++0x-compat -Wno-unused")
73+
# Set default compile flags for GCC
74+
if(CMAKE_COMPILER_IS_GNUCXX)
75+
message(STATUS "GCC detected, adding compile flags")
76+
# Basic options for all builds
77+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic -Wextra -Wshadow")
78+
# Might need to be fixed for retrocompatibility or temporary
79+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-c++0x-compat -Wno-unused")
80+
endif(CMAKE_COMPILER_IS_GNUCXX)
81+
6782

6883

6984
# Include directories

0 commit comments

Comments
 (0)