Skip to content

Commit 5e78cab

Browse files
author
Fytch
committed
change code style: ( x ) -> (x), ditto for other brackets except {}
1 parent 56ae89d commit 5e78cab

27 files changed

+1821
-1821
lines changed

CMakeLists.txt

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,69 @@
1-
cmake_minimum_required( VERSION 3.5 )
1+
cmake_minimum_required(VERSION 3.5)
22

3-
if( NOT DEFINED PROJECT_NAME )
4-
set( PROGRAMOPTIONS_NOT_SUBPROJECT ON )
3+
if(NOT DEFINED PROJECT_NAME)
4+
set(PROGRAMOPTIONS_NOT_SUBPROJECT ON)
55
endif()
66

7-
project( ProgramOptions LANGUAGES CXX VERSION 1.0.0 )
8-
set( CMAKE_CXX_STANDARD 11 )
9-
set( CMAKE_CXX_STANDARD_REQUIRED ON )
10-
set( CMAKE_CXX_EXTENSIONS OFF )
7+
project(ProgramOptions LANGUAGES CXX VERSION 1.0.0)
8+
set(CMAKE_CXX_STANDARD 11)
9+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
10+
set(CMAKE_CXX_EXTENSIONS OFF)
1111

12-
add_library( ProgramOptionsHxx INTERFACE )
13-
target_include_directories( ProgramOptionsHxx INTERFACE "${CMAKE_CURRENT_LIST_DIR}/include" )
12+
add_library(ProgramOptionsHxx INTERFACE)
13+
target_include_directories(ProgramOptionsHxx INTERFACE "${CMAKE_CURRENT_LIST_DIR}/include")
1414

15-
if( PROGRAMOPTIONS_NOT_SUBPROJECT )
16-
option( PROGRAMOPTIONS_NO_EXCEPTIONS "disable exceptions" OFF )
17-
option( PROGRAMOPTIONS_NO_COLORS "disable colored output" OFF )
18-
option( PROGRAMOPTIONS_BUILD_TEST "build test" ON )
19-
option( PROGRAMOPTIONS_BUILD_EXAMPLES "build examples" ON )
15+
if(PROGRAMOPTIONS_NOT_SUBPROJECT)
16+
option(PROGRAMOPTIONS_NO_EXCEPTIONS "disable exceptions" OFF)
17+
option(PROGRAMOPTIONS_NO_COLORS "disable colored output" OFF)
18+
option(PROGRAMOPTIONS_BUILD_TEST "build test" ON)
19+
option(PROGRAMOPTIONS_BUILD_EXAMPLES "build examples" ON)
2020

21-
if( CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR
21+
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR
2222
CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR
23-
CMAKE_CXX_COMPILER_ID MATCHES "Intel" )
24-
set( PROGRAMOPTIONS_GNU_OPTIONS TRUE )
25-
elseif( CMAKE_CXX_COMPILER_ID MATCHES "MSVC" )
26-
set( PROGRAMOPTIONS_MS_OPTIONS TRUE )
23+
CMAKE_CXX_COMPILER_ID MATCHES "Intel")
24+
set(PROGRAMOPTIONS_GNU_OPTIONS TRUE)
25+
elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
26+
set(PROGRAMOPTIONS_MS_OPTIONS TRUE)
2727
endif()
2828

29-
if( PROGRAMOPTIONS_GNU_OPTIONS )
30-
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic -Wno-deprecated -fno-rtti" )
31-
set( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -ggdb -fno-omit-frame-pointer" )
32-
set( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -march=native -DNDEBUG -s -flto" )
29+
if(PROGRAMOPTIONS_GNU_OPTIONS)
30+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic -Wno-deprecated -fno-rtti")
31+
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -ggdb -fno-omit-frame-pointer")
32+
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -march=native -DNDEBUG -s -flto")
3333
endif()
3434

35-
if( PROGRAMOPTIONS_NO_EXCEPTIONS )
36-
add_definitions( -DPROGRAMOPTIONS_NO_EXCEPTIONS )
37-
if( PROGRAMOPTIONS_GNU_OPTIONS )
38-
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions" )
39-
elseif( PROGRAMOPTIONS_MS_OPTIONS )
40-
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc" )
35+
if(PROGRAMOPTIONS_NO_EXCEPTIONS)
36+
add_definitions(-DPROGRAMOPTIONS_NO_EXCEPTIONS)
37+
if(PROGRAMOPTIONS_GNU_OPTIONS)
38+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions")
39+
elseif(PROGRAMOPTIONS_MS_OPTIONS)
40+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc")
4141
endif()
4242
endif()
4343

44-
if( PROGRAMOPTIONS_NO_COLORS )
45-
add_definitions( -DPROGRAMOPTIONS_NO_COLORS )
44+
if(PROGRAMOPTIONS_NO_COLORS)
45+
add_definitions(-DPROGRAMOPTIONS_NO_COLORS)
4646
endif()
4747

48-
if( PROGRAMOPTIONS_BUILD_TEST )
49-
add_subdirectory( "${CMAKE_CURRENT_LIST_DIR}/ext/Catch2" )
48+
if(PROGRAMOPTIONS_BUILD_TEST)
49+
add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/ext/Catch2")
5050

51-
file( GLOB_RECURSE test_src test/*.cxx )
52-
add_executable( Test ${test_src} )
53-
target_link_libraries( Test
51+
file(GLOB_RECURSE test_src test/*.cxx)
52+
add_executable(Test ${test_src})
53+
target_link_libraries(Test
5454
Catch2::Catch2
5555
ProgramOptionsHxx
5656
)
5757
endif()
5858

59-
if( PROGRAMOPTIONS_BUILD_EXAMPLES )
60-
file( GLOB_RECURSE examples_src examples/*.cxx )
61-
foreach( src_name ${examples_src} )
59+
if(PROGRAMOPTIONS_BUILD_EXAMPLES)
60+
file(GLOB_RECURSE examples_src examples/*.cxx)
61+
foreach(src_name ${examples_src})
6262
# CMake's regex engine doesn't support lazy evaluation (?), hence the hack below
63-
string( REGEX REPLACE "^.*[^a-zA-Z_]([a-zA-Z_]+)\\.cxx$" "\\1" exe_name ${src_name} )
64-
add_executable( ${exe_name} ${src_name} )
63+
string(REGEX REPLACE "^.*[^a-zA-Z_]([a-zA-Z_]+)\\.cxx$" "\\1" exe_name ${src_name})
64+
add_executable(${exe_name} ${src_name})
6565

66-
target_link_libraries( ${exe_name} ProgramOptionsHxx )
67-
endforeach( src_name ${examples_src} )
66+
target_link_libraries(${exe_name} ProgramOptionsHxx)
67+
endforeach(src_name ${examples_src})
6868
endif()
6969
endif()

0 commit comments

Comments
 (0)