From c227d46cf462cb8e15b12962867a30150d9ce51f Mon Sep 17 00:00:00 2001 From: Markus Elfring Date: Mon, 1 Sep 2014 19:17:03 +0200 Subject: [PATCH 1/2] Bug #14: Completed quoting for parameters of some CMake commands A wiki article pointed out that whitespace will only be preserved for parameters in CMake commands if passed strings will be appropriately quoted or escaped. http://cmake.org/Wiki/CMake/Language_Syntax#CMake_splits_arguments_unless_you_use_quotation_marks_or_escapes. Quoting was added so that more places should also handle file names correctly which contain space characters or semicolons eventually. Signed-off-by: Markus Elfring --- CMakeLists.txt | 4 ++-- test_constraints/CMakeLists.txt | 20 ++++++++++---------- tests/CMakeLists.txt | 15 +++++++-------- 3 files changed, 19 insertions(+), 20 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 556cdf06..34d69400 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,8 +38,8 @@ elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") endif () set(include_dir "${PROJECT_SOURCE_DIR}/include") -file(GLOB_RECURSE sqlpp_headers ${include_dir}/*.h) -include_directories(${include_dir}) +file(GLOB_RECURSE sqlpp_headers "${include_dir}/*.h") +include_directories("${include_dir}") add_subdirectory(tests) add_subdirectory(test_constraints) diff --git a/test_constraints/CMakeLists.txt b/test_constraints/CMakeLists.txt index aec592e4..55255498 100644 --- a/test_constraints/CMakeLists.txt +++ b/test_constraints/CMakeLists.txt @@ -1,26 +1,26 @@ -include_directories(${CMAKE_SOURCE_DIR}/tests) +include_directories("${CMAKE_SOURCE_DIR}/tests") add_custom_target(test_sqlpp_constraints COMMAND true) function(test_constraint name pattern) add_executable( - ${name} + "${name}" EXCLUDE_FROM_ALL - ${name}.cpp + "${name}.cpp" ) - add_custom_command(OUTPUT ${name}.out - COMMAND ${CMAKE_MAKE_PROGRAM} ${name} > ${CMAKE_CURRENT_BINARY_DIR}/${name}.out 2>&1 || true - COMMAND grep ${pattern} ${CMAKE_CURRENT_BINARY_DIR}/${name}.out > /dev/null - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${name}.cpp + add_custom_command(OUTPUT "${name}.out" + COMMAND "${CMAKE_MAKE_PROGRAM}" "${name}" > "${CMAKE_CURRENT_BINARY_DIR}/${name}.out" 2>&1 || true + COMMAND grep "${pattern}" "${CMAKE_CURRENT_BINARY_DIR}/${name}.out" > /dev/null + DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/${name}.cpp" COMMENT "${name}" - ) + VERBATIM) - add_custom_target(test_${name} DEPENDS ${name}.out COMMAND true) + add_custom_target("test_${name}" DEPENDS "${name}.out" COMMAND true) - add_dependencies(test_sqlpp_constraints test_${name}) + add_dependencies(test_sqlpp_constraints "test_${name}") endfunction(test_constraint) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 6582425b..86462e61 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,9 +1,9 @@ macro (build_and_run arg) # Add headers to sources to enable file browsing in IDEs - include_directories(${CMAKE_BINARY_DIR}/tests) - add_executable(${arg} ${arg}.cpp ${sqlpp_headers} ${CMAKE_CURRENT_LIST_DIR}/Sample.h) - add_test(${arg} ${arg}) + include_directories("${CMAKE_BINARY_DIR}/tests") + add_executable("${arg}" "${arg}.cpp" ${sqlpp_headers} "${CMAKE_CURRENT_LIST_DIR}/Sample.h") + add_test("${arg}" "${arg}") endmacro () build_and_run(BooleanExpressionTest) @@ -21,8 +21,7 @@ build_and_run(ResultTest) # if you want to use the generator, you can do something like this: #find_package(PythonInterp REQUIRED) #add_custom_command( -# OUTPUT ${CMAKE_CURRENT_LIST_DIR}/Sample.h -# COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/scripts/ddl2cpp ${CMAKE_CURRENT_LIST_DIR}/sample.sql Sample test -# DEPENDS ${CMAKE_CURRENT_LIST_DIR}/sample.sql -# ) - +# OUTPUT "${CMAKE_CURRENT_LIST_DIR}/Sample.h" +# COMMAND "${PYTHON_EXECUTABLE}" "${CMAKE_SOURCE_DIR}/scripts/ddl2cpp" "${CMAKE_CURRENT_LIST_DIR}/sample.sql" Sample test +# DEPENDS "${CMAKE_CURRENT_LIST_DIR}/sample.sql" +# VERBATIM) From f31d28d413ce4f5a8f30024c158e8a848f8c932c Mon Sep 17 00:00:00 2001 From: rbock Date: Thu, 4 Sep 2014 22:50:55 +0200 Subject: [PATCH 2/2] Added open content --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0b8d6ebe..7e3020ed 100644 --- a/README.md +++ b/README.md @@ -5,9 +5,11 @@ A type safe embedded domain specific language for SQL queries and results in C++ Extensive documentation is found in the wiki, https://github.com/rbock/sqlpp11/wiki -Upcoming talks at +Upcoming talks/workshops) at * CppCon (Bellevue, Washington, USA): http://cppcon.org - * 2014-09-11: http://sched.co/1r4lue3 + * 2014-09-08: http://sched.co/1qhngYK (Workshop Part 1) + * 2014-09-11: http://sched.co/1r4lue3 (Talk) + * 2014-09-12: http://sched.co/Wi8aWM (Workshop Part 2) * MeetingC++ (Berlin, Germany): http://meetingcpp.com/index.php/mcpp2014.html * 2014-12-05:http://meetingcpp.com/index.php/tv14/items/4.html