class GTest
Constants
- LIBS_VARIABLE
Public Class Methods
new(args={})
click to toggle source
# File lib/ckick/plugin/gtest.rb, line 11 def initialize args={} @optional = args[:optional] || false @resource_file = "build-gtest.cmake" end
Public Instance Methods
call(project)
click to toggle source
# File lib/ckick/plugin/gtest.rb, line 27 def call(project) file = File.new(File.join(project.root, @resource_file), 'w') file << File.new(File.join(File.dirname(__FILE__), "resource", @resource_file), 'r').read file.close end
cmake()
click to toggle source
# File lib/ckick/plugin/gtest.rb, line 16 def cmake res = '' res << %Q(option(BUILD_TESTS OFF "whether to build tests or not")\n) \ << "if(BUILD_TESTS)\n\t" if @optional res << "include(#{@resource_file})" res << "\nendif()" if @optional res end
include(project)
click to toggle source
# File lib/ckick/plugin/gtest.rb, line 33 def include(project) res = [] [ File.join(project.build_dir, "gtest", "src", "libgtest", "googletest", "include"), File.join(project.build_dir, "gtest", "src", "libgtest", "googlemock", "include") ].each do |path| FileUtils.mkdir_p path res << CKick::IncludePath.new(path: path) end res end