-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
143 additions
and
145 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
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 |
---|---|---|
|
@@ -62,6 +62,7 @@ _screenshots/ | |
/bin/ | ||
/cmake-** | ||
/rake-** | ||
/build-** | ||
/.idea | ||
.gitconfig | ||
.cache |
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,41 @@ | ||
|
||
CMakeTarget = Struct.new( | ||
:name, | ||
:path, | ||
keyword_init: true # If the optional keyword_init keyword argument is set to true, .new takes keyword arguments instead of normal arguments. | ||
) | ||
|
||
def tasks_for_cmake_target( target ) | ||
build_dir = "#{BUILD_DIR}/#{target.name}" | ||
|
||
task :rebuild => [:clean, :build] | ||
|
||
task :clean do | ||
FileUtils.rm_f build_dir | ||
end | ||
|
||
task :build do | ||
if Dir.exist? build_dir | ||
FileUtils.rm_rf build_dir | ||
end | ||
if BUILD_TYPE == "release" | ||
config = "Release" | ||
else | ||
config = "Debug" | ||
end | ||
directory build_dir # ensure folder exists | ||
sh "cmake -S #{target.path} -B #{build_dir} -DCMAKE_OSX_DEPLOYMENT_TARGET=#{MACOSX_VERSION_MIN}" # configure | ||
# TODO: we should precise which target to install | ||
sh "cmake --build #{build_dir} --config #{config}" | ||
end | ||
|
||
task :install => :build do | ||
# TODO: we should precise which target to install | ||
cmd = "cmake --install #{build_dir}" | ||
if BUILD_OS_LINUX or BUILD_OS_MACOS | ||
sh "sudo #{cmd}" | ||
else | ||
sh cmd | ||
end | ||
end | ||
end |
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.