mirror of
https://github.com/status-im/dotherside.git
synced 2025-02-07 10:14:41 +00:00
Moved the NimQml to a separate directory and added .nimble file
This commit is contained in:
parent
d6d99c75df
commit
fcbc2662f0
@ -2,5 +2,4 @@ cmake_minimum_required(VERSION 3.0)
|
||||
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Nim)
|
||||
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Nim/UseNim.cmake)
|
||||
find_package(Nim)
|
||||
add_nim_executable(TARGET Main SOURCES main.nim)
|
||||
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/main.qml DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
|
||||
add_subdirectory(Examples)
|
1
Nim/Examples/CMakeLists.txt
Normal file
1
Nim/Examples/CMakeLists.txt
Normal file
@ -0,0 +1 @@
|
||||
add_subdirectory(Simple)
|
2
Nim/Examples/Simple/CMakeLists.txt
Normal file
2
Nim/Examples/Simple/CMakeLists.txt
Normal file
@ -0,0 +1,2 @@
|
||||
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/main.qml DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
|
||||
add_nim_executable(TARGET Main SOURCES main.nim PATHS ../../NimQml)
|
9
Nim/NimQml/NimQml.nimble
Normal file
9
Nim/NimQml/NimQml.nimble
Normal file
@ -0,0 +1,9 @@
|
||||
[Package]
|
||||
name = "NimQml"
|
||||
version = "0.01"
|
||||
author = "Filippo Cucchetto"
|
||||
description = "QML bindings for Nimrod"
|
||||
license = "GPLv3"
|
||||
|
||||
[Deps]
|
||||
Requires: "nimrod >= 0.10.2"
|
@ -1,24 +1,32 @@
|
||||
include(CMakeParseArguments)
|
||||
|
||||
function(add_nim_executable )
|
||||
cmake_parse_arguments(ARGS "" "TARGET" "SOURCES" ${ARGN})
|
||||
set(options )
|
||||
set(oneValueArgs TARGET)
|
||||
set(multiValueArgs SOURCES PATHS)
|
||||
cmake_parse_arguments(ARGS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
||||
|
||||
# collect set of input source files
|
||||
set(in_files "")
|
||||
foreach(src ${ARGS_SOURCES} ${ARGS_UNPARSED_ARGUMENTS})
|
||||
list(APPEND in_files "${CMAKE_CURRENT_SOURCE_DIR}/${src}")
|
||||
endforeach(src ${ARGS_SOURCES} ${ARGS_UNPARSED_ARGUMENTS})
|
||||
|
||||
# collect set of input source files
|
||||
set(in_files "")
|
||||
foreach(src ${ARGS_SOURCES} ${ARGS_UNPARSED_ARGUMENTS})
|
||||
list(APPEND in_files "${CMAKE_CURRENT_SOURCE_DIR}/${src}")
|
||||
endforeach(src ${ARGS_SOURCES} ${ARGS_UNPARSED_ARGUMENTS})
|
||||
set(in_paths "")
|
||||
foreach(path ${ARGS_PATHS} ${ARGS_UNPARSED_ARGUMENTS})
|
||||
list(APPEND in_paths "--path:${CMAKE_CURRENT_SOURCE_DIR}/${path}")
|
||||
endforeach(path ${ARGS_PATHS} ${ARGS_UNPARSED_ARGUMENTS})
|
||||
|
||||
# set the target binary and nim cache directory
|
||||
set(nim_target "${CMAKE_CURRENT_BINARY_DIR}/${ARGS_TARGET}")
|
||||
set(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/nimcache")
|
||||
|
||||
# set the target binary and nim cache directory
|
||||
set(nim_target "${CMAKE_CURRENT_BINARY_DIR}/${ARGS_TARGET}")
|
||||
set(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/nimcache")
|
||||
|
||||
# add target to trigger the nimrod compiler
|
||||
add_custom_target(
|
||||
nim ALL
|
||||
COMMAND
|
||||
${NIM_EXECUTABLE} "c" "--nimcache:" ${DIRECTORY} "--out:" ${nim_target} ${in_files}
|
||||
DEPENDS
|
||||
${in_files}
|
||||
)
|
||||
# add target to trigger the nimrod compiler
|
||||
add_custom_target(
|
||||
nim ALL
|
||||
COMMAND
|
||||
${NIM_EXECUTABLE} "c" ${in_paths} "--nimcache:" ${DIRECTORY} "--out:" ${nim_target} ${in_files}
|
||||
DEPENDS
|
||||
${in_files}
|
||||
)
|
||||
endfunction(add_nim_executable)
|
Loading…
x
Reference in New Issue
Block a user