update cmakelists for new tests

fix problematic macro expansion issues
This commit is contained in:
ThePhD 2017-12-10 01:34:48 -05:00
parent 87b4dd6cba
commit c3c7f42d91
5 changed files with 24 additions and 31 deletions

View File

@ -57,7 +57,7 @@ if (NOT MSVC)
endif()
if (EXAMPLES)
file(GLOB EXAMPLES_SRC examples/*.cpp)
file(GLOB EXAMPLES_SRC examples/*.cpp examples/tutorials/quick_n_dirty/*.cpp)
source_group(examples FILES ${EXAMPLES_SRC})
foreach(example_source_file ${EXAMPLES_SRC})
get_filename_component(example_name ${example_source_file} NAME_WE)
@ -83,9 +83,10 @@ endif()
find_package(PythonInterp 3)
if (PYTHONINTERP_FOUND)
add_custom_command(OUTPUT single/sol/sol.hpp COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/single.py --output ${CMAKE_CURRENT_SOURCE_DIR}/single/sol/sol.hpp DEPENDS ${HEADER_SRCS})
add_custom_target(single_sol DEPENDS single/sol/sol.hpp)
add_custom_command(OUTPUT single/sol/sol.hpp single/sol/sol_forward.hpp COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/single.py --output ${CMAKE_CURRENT_SOURCE_DIR}/single/sol/sol.hpp DEPENDS ${HEADER_SRCS})
add_custom_target(single_sol DEPENDS single/sol/sol.hpp single/sol/sol_forward.hpp)
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/single/sol/sol.hpp" DESTINATION include/sol)
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/single/sol/sol_forward.hpp" DESTINATION include/sol)
message(STATUS "single_sol can be generated as python 3 has been found.")
else()
message(STATUS "single_sol cannot be generated as python 3 has not been found.")

View File

@ -20,8 +20,8 @@
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// This file was generated with a script.
// Generated 2017-12-09 07:45:45.246313 UTC
// This header was generated with sol v2.19.0 (revision 5f68853)
// Generated 2017-12-10 06:34:23.982786 UTC
// This header was generated with sol v2.19.0 (revision 87b4dd6)
// https://github.com/ThePhD/sol2
#ifndef SOL_SINGLE_INCLUDE_HPP
@ -16964,21 +16964,19 @@ namespace sol {
case meta_function::construct:
if (prop) {
#ifndef SOL_NO_EXCEPTIONS
throw error(
throw error("sol: 2 separate constructor (new) functions were set on this type. Please specify only 1 sol::meta_function::construct/'new' type AND wrap the function in a sol::factories/initializers call, as shown by the documentation and examples, otherwise you may create problems");
#else
assert(false &&
assert(false && "sol: 2 separate constructor (new) functions were set on this type. Please specify only 1 sol::meta_function::construct/'new' type AND wrap the function in a sol::factories/initializers call, as shown by the documentation and examples, otherwise you may create problems");
#endif
"sol: 2 separate constructor (new) functions were set on this type. Please specify only 1 sol::meta_function::construct/'new' type AND wrap the function in a sol::factories/initializers call, as shown by the documentation and examples, otherwise you may create problems");
}
break;
case meta_function::garbage_collect:
if (destructfunc != nullptr) {
#ifndef SOL_NO_EXCEPTIONS
throw error(
throw error("sol: 2 separate constructor (new) functions were set on this type. Please specify only 1 sol::meta_function::construct/'new' type AND wrap the function in a sol::factories/initializers call, as shown by the documentation and examples, otherwise you may create problems");
#else
assert(false &&
assert(false && "sol: 2 separate constructor (new) functions were set on this type. Please specify only 1 sol::meta_function::construct/'new' type AND wrap the function in a sol::factories/initializers call, as shown by the documentation and examples, otherwise you may create problems");
#endif
"sol: 2 separate garbage_collect functions were set on this type. Please specify only 1 sol::meta_function::gc type AND wrap the function in a sol::destruct call, as shown by the documentation and examples");
}
destructfunc = reg.func;
return;
@ -17695,21 +17693,19 @@ namespace sol {
case meta_function::construct:
if (prop) {
#ifndef SOL_NO_EXCEPTIONS
throw error(
throw error("sol: 2 separate constructor (new) functions were set on this type. Please specify only 1 sol::meta_function::construct/'new' type AND wrap the function in a sol::factories/initializers call, as shown by the documentation and examples, otherwise you may create problems");
#else
assert(false &&
assert(false && "sol: 2 separate constructor (new) functions were set on this type. Please specify only 1 sol::meta_function::construct/'new' type AND wrap the function in a sol::factories/initializers call, as shown by the documentation and examples, otherwise you may create problems");
#endif
"sol: 2 separate constructor (new) functions were set on this type. Please specify only 1 sol::meta_function::construct/'new' type AND wrap the function in a sol::factories/initializers call, as shown by the documentation and examples, otherwise you may create problems");
}
break;
case meta_function::garbage_collect:
if (prop) {
#ifndef SOL_NO_EXCEPTIONS
throw error(
throw error("sol: 2 separate constructor (new) functions were set on this type. Please specify only 1 sol::meta_function::construct/'new' type AND wrap the function in a sol::factories/initializers call, as shown by the documentation and examples, otherwise you may create problems");
#else
assert(false &&
assert(false && "sol: 2 separate constructor (new) functions were set on this type. Please specify only 1 sol::meta_function::construct/'new' type AND wrap the function in a sol::factories/initializers call, as shown by the documentation and examples, otherwise you may create problems");
#endif
"sol: 2 separate garbage_collect functions were set on this type. Please specify only 1 sol::meta_function::gc type AND wrap the function in a sol::destruct call, as shown by the documentation and examples");
}
return;
default:

View File

@ -20,8 +20,8 @@
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// This file was generated with a script.
// Generated 2017-12-09 07:45:45.424818 UTC
// This header was generated with sol v2.19.0 (revision 5f68853)
// Generated 2017-12-10 06:34:24.172779 UTC
// This header was generated with sol v2.19.0 (revision 87b4dd6)
// https://github.com/ThePhD/sol2
#ifndef SOL_SINGLE_INCLUDE_FORWARD_HPP

View File

@ -433,21 +433,19 @@ namespace sol {
case meta_function::construct:
if (prop) {
#ifndef SOL_NO_EXCEPTIONS
throw error(
throw error("sol: 2 separate constructor (new) functions were set on this type. Please specify only 1 sol::meta_function::construct/'new' type AND wrap the function in a sol::factories/initializers call, as shown by the documentation and examples, otherwise you may create problems");
#else
assert(false &&
assert(false && "sol: 2 separate constructor (new) functions were set on this type. Please specify only 1 sol::meta_function::construct/'new' type AND wrap the function in a sol::factories/initializers call, as shown by the documentation and examples, otherwise you may create problems");
#endif
"sol: 2 separate constructor (new) functions were set on this type. Please specify only 1 sol::meta_function::construct/'new' type AND wrap the function in a sol::factories/initializers call, as shown by the documentation and examples, otherwise you may create problems");
}
break;
case meta_function::garbage_collect:
if (prop) {
#ifndef SOL_NO_EXCEPTIONS
throw error(
throw error("sol: 2 separate constructor (new) functions were set on this type. Please specify only 1 sol::meta_function::construct/'new' type AND wrap the function in a sol::factories/initializers call, as shown by the documentation and examples, otherwise you may create problems");
#else
assert(false &&
assert(false && "sol: 2 separate constructor (new) functions were set on this type. Please specify only 1 sol::meta_function::construct/'new' type AND wrap the function in a sol::factories/initializers call, as shown by the documentation and examples, otherwise you may create problems");
#endif
"sol: 2 separate garbage_collect functions were set on this type. Please specify only 1 sol::meta_function::gc type AND wrap the function in a sol::destruct call, as shown by the documentation and examples");
}
return;
default:

View File

@ -469,21 +469,19 @@ namespace sol {
case meta_function::construct:
if (prop) {
#ifndef SOL_NO_EXCEPTIONS
throw error(
throw error("sol: 2 separate constructor (new) functions were set on this type. Please specify only 1 sol::meta_function::construct/'new' type AND wrap the function in a sol::factories/initializers call, as shown by the documentation and examples, otherwise you may create problems");
#else
assert(false &&
assert(false && "sol: 2 separate constructor (new) functions were set on this type. Please specify only 1 sol::meta_function::construct/'new' type AND wrap the function in a sol::factories/initializers call, as shown by the documentation and examples, otherwise you may create problems");
#endif
"sol: 2 separate constructor (new) functions were set on this type. Please specify only 1 sol::meta_function::construct/'new' type AND wrap the function in a sol::factories/initializers call, as shown by the documentation and examples, otherwise you may create problems");
}
break;
case meta_function::garbage_collect:
if (destructfunc != nullptr) {
#ifndef SOL_NO_EXCEPTIONS
throw error(
throw error("sol: 2 separate constructor (new) functions were set on this type. Please specify only 1 sol::meta_function::construct/'new' type AND wrap the function in a sol::factories/initializers call, as shown by the documentation and examples, otherwise you may create problems");
#else
assert(false &&
assert(false && "sol: 2 separate constructor (new) functions were set on this type. Please specify only 1 sol::meta_function::construct/'new' type AND wrap the function in a sol::factories/initializers call, as shown by the documentation and examples, otherwise you may create problems");
#endif
"sol: 2 separate garbage_collect functions were set on this type. Please specify only 1 sol::meta_function::gc type AND wrap the function in a sol::destruct call, as shown by the documentation and examples");
}
destructfunc = reg.func;
return;