-
Notifications
You must be signed in to change notification settings - Fork 629
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
As mentioned in issue #1816, this is a CMake file parser using the optlib multitable regex feature.
- Loading branch information
Showing
23 changed files
with
609 additions
and
2 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,3 @@ | ||
another_good_target input.cmake /^add_library(another_good_target# <-- target$/;" t | ||
good_target input.cmake /^ good_target# this is legal comment placement set(NO_TAG foo)$/;" t | ||
tag_this input.cmake /^]]set(tag_this)$/;" v |
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,17 @@ | ||
# this is a test of comments set(DO_NOT_TAG "foo") | ||
|
||
#[[ | ||
multi-linecomments | ||
option(DO_NOT_TAG "foo" OFF) | ||
] not the end | ||
]]set(tag_this) | ||
|
||
add_custom_target(# comment set(NO_TAG "foo") | ||
# anothe rline comment | ||
good_target# this is legal comment placement set(NO_TAG foo) | ||
ALL) | ||
|
||
add_library(another_good_target# <-- target | ||
SHARED # set(NO_TAG bar) | ||
gmock-all.cc | ||
) |
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,5 @@ | ||
Bfunctiontag_this_2 input.cmake /^ function( Bfunctiontag_this_2 ${BAR})$/;" f | ||
cxx_shared_library input.cmake /^function(cxx_shared_library name cxx_flags)$/;" f | ||
d_ALSO_Tag_this input.cmake /^ d_ALSO_Tag_this$/;" f | ||
eLastlyTagThis_ input.cmake /^eLastlyTagThis_ "hello")$/;" f | ||
tag_this1 input.cmake /^function(tag_this1)$/;" f |
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,19 @@ | ||
function(tag_this1) | ||
endfunction(tag_this1) | ||
function( Bfunctiontag_this_2 ${BAR}) | ||
|
||
function(cxx_shared_library name cxx_flags) | ||
cxx_library_with_type(${name} SHARED "${cxx_flags}" ${ARGN}) | ||
endfunction() | ||
|
||
FUNCTION ( | ||
d_ALSO_Tag_this | ||
true) | ||
|
||
Function( | ||
eLastlyTagThis_ "hello") | ||
|
||
function(${not_this} foo) | ||
function(not-this foo) | ||
function(not.this foo) | ||
function(1notthis foo) |
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,5 @@ | ||
Bmacrotag_this_2 input.cmake /^ macro( Bmacrotag_this_2 ${BAR})$/;" m | ||
cxx_shared_library input.cmake /^macro(cxx_shared_library name cxx_flags)$/;" m | ||
d_ALSO_Tag_this input.cmake /^ d_ALSO_Tag_this$/;" m | ||
eLastlyTagThis_ input.cmake /^eLastlyTagThis_ "hello")$/;" m | ||
tag_this1 input.cmake /^macro(tag_this1)$/;" m |
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,19 @@ | ||
macro(tag_this1) | ||
endmacro(tag_this1) | ||
macro( Bmacrotag_this_2 ${BAR}) | ||
|
||
macro(cxx_shared_library name cxx_flags) | ||
cxx_library_with_type(${name} SHARED "${cxx_flags}" ${ARGN}) | ||
endmacro() | ||
|
||
MACRO ( | ||
d_ALSO_Tag_this | ||
true) | ||
|
||
Macro( | ||
eLastlyTagThis_ "hello") | ||
|
||
macro(${not_this} foo) | ||
macro(not-this foo) | ||
macro(not.this foo) | ||
macro(1not_this foo) |
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,5 @@ | ||
1_tag_this input.cmake /^option(1_tag_this foo)$/;" D | ||
B-option-tag_this_2 input.cmake /^option(B-option-tag_this_2 ${BAR})$/;" D | ||
c_TAG_THIS input.cmake /^ option ( c_TAG_THIS but_not_this)$/;" D | ||
d-ALSO-Tag.this input.cmake /^ d-ALSO-Tag.this$/;" D | ||
e.LastlyTagThis input.cmake /^e.LastlyTagThis "hello")$/;" D |
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,15 @@ | ||
option(1_tag_this foo) | ||
option(B-option-tag_this_2 ${BAR}) | ||
|
||
option ( c_TAG_THIS but_not_this) | ||
|
||
OPTION ( | ||
d-ALSO-Tag.this | ||
true) | ||
|
||
Option( | ||
e.LastlyTagThis "hello") | ||
|
||
option(${not_this} foo) | ||
option(${ not_this } foo) | ||
option(not~this foo) |
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,5 @@ | ||
1_tag_this input.cmake /^project(1_tag_this)$/;" p | ||
B-project-tag_this_2 input.cmake /^project(B-project-tag_this_2 ${BAR})$/;" p | ||
c_TAG_THIS input.cmake /^ project ( c_TAG_THIS but_not_this)$/;" p | ||
d-ALSO-Tag.this input.cmake /^ d-ALSO-Tag.this$/;" p | ||
e.LastlyTagThis input.cmake /^e.LastlyTagThis "hello")$/;" p |
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,15 @@ | ||
project(1_tag_this) | ||
project(B-project-tag_this_2 ${BAR}) | ||
|
||
project ( c_TAG_THIS but_not_this) | ||
|
||
PROJECT ( | ||
d-ALSO-Tag.this | ||
) | ||
|
||
Project( | ||
e.LastlyTagThis "hello") | ||
|
||
project(${not_this}) | ||
project(${ not_this }) | ||
project(not/this) |
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 @@ | ||
BUILD_GMOCK input.cmake /^option(BUILD_GMOCK "Builds the googlemock subproject" ON)$/;" D | ||
BUILD_GTEST input.cmake /^option(BUILD_GTEST "Builds the googletest subproject" OFF)$/;" D | ||
CMAKE_INSTALL_BINDIR input.cmake /^ set(CMAKE_INSTALL_BINDIR "bin" CACHE STRING "User executables (bin)")$/;" v | ||
CMAKE_INSTALL_INCLUDEDIR input.cmake /^ set(CMAKE_INSTALL_INCLUDEDIR "include" CACHE STRING "C header files (include)")$/;" v | ||
CMAKE_INSTALL_LIBDIR input.cmake /^ set(CMAKE_INSTALL_LIBDIR "lib${LIB_SUFFIX}" CACHE STRING "Object code libraries (lib)")$/;" v | ||
googletest-distribution input.cmake /^project( googletest-distribution )$/;" p |
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,34 @@ | ||
# taken from https://github.com/google/googletest/blob/master/CMakeLists.txt | ||
cmake_minimum_required(VERSION 2.6.4) | ||
|
||
if (POLICY CMP0048) | ||
cmake_policy(SET CMP0048 NEW) | ||
endif (POLICY CMP0048) | ||
|
||
project( googletest-distribution ) | ||
|
||
enable_testing() | ||
|
||
include(CMakeDependentOption) | ||
if (CMAKE_VERSION VERSION_LESS 2.8.5) | ||
set(CMAKE_INSTALL_BINDIR "bin" CACHE STRING "User executables (bin)") | ||
set(CMAKE_INSTALL_LIBDIR "lib${LIB_SUFFIX}" CACHE STRING "Object code libraries (lib)") | ||
set(CMAKE_INSTALL_INCLUDEDIR "include" CACHE STRING "C header files (include)") | ||
mark_as_advanced(CMAKE_INSTALL_BINDIR CMAKE_INSTALL_LIBDIR CMAKE_INSTALL_INCLUDEDIR) | ||
else() | ||
include(GNUInstallDirs) | ||
endif() | ||
|
||
option(BUILD_GTEST "Builds the googletest subproject" OFF) | ||
|
||
#Note that googlemock target already builds googletest | ||
option(BUILD_GMOCK "Builds the googlemock subproject" ON) | ||
|
||
cmake_dependent_option(INSTALL_GTEST "Enable installation of googletest. (Projects embedding googletest may want to turn this OFF.)" ON "BUILD_GTEST OR BUILD_GMOCK" OFF) | ||
cmake_dependent_option(INSTALL_GMOCK "Enable installation of googlemock. (Projects embedding googlemock may want to turn this OFF.)" ON "BUILD_GMOCK" OFF) | ||
|
||
if(BUILD_GMOCK) | ||
add_subdirectory( googlemock ) | ||
elseif(BUILD_GTEST) | ||
add_subdirectory( googletest ) | ||
endif() |
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,15 @@ | ||
1_tag_this input.cmake /^add_custom_target(1_tag_this)$/;" t | ||
1_tag_this input.cmake /^add_executable(1_tag_this)$/;" t | ||
1_tag_this input.cmake /^add_library(1_tag_this)$/;" t | ||
B-add_custom_target-tag_this_2 input.cmake /^add_custom_target(B-add_custom_target-tag_this_2 ${BAR})$/;" t | ||
B-add_executable-tag_this_2 input.cmake /^add_executable(B-add_executable-tag_this_2 ${BAR})$/;" t | ||
B-add_library-tag_this_2 input.cmake /^add_library(B-add_library-tag_this_2 ${BAR})$/;" t | ||
c_TAG_THIS input.cmake /^ add_custom_target ( c_TAG_THIS but_not_this)$/;" t | ||
c_TAG_THIS input.cmake /^ add_executable ( c_TAG_THIS but_not_this)$/;" t | ||
c_TAG_THIS input.cmake /^ add_library ( c_TAG_THIS but_not_this)$/;" t | ||
d-ALSO-Tag.this input.cmake /^ d-ALSO-Tag.this$/;" t | ||
d-ALSO-Tag.this input.cmake /^ d-ALSO-Tag.this $/;" t | ||
d-ALSO-Tag.this input.cmake /^ d-ALSO-Tag.this$/;" t | ||
e.LastlyTagThis input.cmake /^e.LastlyTagThis "CustomTarget")$/;" t | ||
e.LastlyTagThis input.cmake /^e.LastlyTagThis "Executable")$/;" t | ||
e.LastlyTagThis input.cmake /^e.LastlyTagThis "Library")$/;" t |
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,49 @@ | ||
add_custom_target(1_tag_this) | ||
add_custom_target(B-add_custom_target-tag_this_2 ${BAR}) | ||
|
||
add_custom_target ( c_TAG_THIS but_not_this) | ||
|
||
ADD_CUSTOM_TARGET ( | ||
d-ALSO-Tag.this | ||
) | ||
|
||
Add_Custom_target( | ||
e.LastlyTagThis "CustomTarget") | ||
|
||
add_custom_target(${not_this}) | ||
add_custom_target(${ not_this }) | ||
add_custom_target(not/this) | ||
|
||
|
||
add_executable(1_tag_this) | ||
add_executable(B-add_executable-tag_this_2 ${BAR}) | ||
|
||
add_executable ( c_TAG_THIS but_not_this) | ||
|
||
ADD_EXECUTABLE ( | ||
d-ALSO-Tag.this | ||
) | ||
|
||
Add_Executable( | ||
e.LastlyTagThis "Executable") | ||
|
||
add_executable(${not_this}) | ||
add_executable(${ not_this }) | ||
add_executable(not/this) | ||
|
||
|
||
add_library(1_tag_this) | ||
add_library(B-add_library-tag_this_2 ${BAR}) | ||
|
||
add_library ( c_TAG_THIS but_not_this) | ||
|
||
ADD_LIBRARY ( | ||
d-ALSO-Tag.this | ||
) | ||
|
||
Add_Library( | ||
e.LastlyTagThis "Library") | ||
|
||
add_library(${not_this}) | ||
add_library(${ not_this }) | ||
add_library(not/this) |
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,5 @@ | ||
1_tag_this input.cmake /^set(1_tag_this foo)$/;" v | ||
B-set-tag_this_2 input.cmake /^set(B-set-tag_this_2 ${BAR})$/;" v | ||
c_TAG_THIS input.cmake /^ set ( c_TAG_THIS but_not_this)$/;" v | ||
d-ALSO-Tag.this input.cmake /^ d-ALSO-Tag.this$/;" v | ||
e.LastlyTagThis input.cmake /^e.LastlyTagThis "hello")$/;" v |
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,13 @@ | ||
set(1_tag_this foo) | ||
set(B-set-tag_this_2 ${BAR}) | ||
|
||
set ( c_TAG_THIS but_not_this) | ||
|
||
SET ( | ||
d-ALSO-Tag.this | ||
true) | ||
|
||
Set( | ||
e.LastlyTagThis "hello") | ||
|
||
set(${not_this} foo) |
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
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
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
Oops, something went wrong.