fix cmake pre build step

pull/36/head
Thomas Fussell 2015-10-26 16:26:47 -04:00
parent 56fb036279
commit 0d53471ff7
7 changed files with 16 additions and 6 deletions

2
.gitignore vendored
View File

@ -13,5 +13,3 @@ docs/doxyxml/
#*#
*~
.DS_Store
tests/test_data/writer/*.xlsx
tests/runner-autogen.cpp

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.2.2)
cmake_minimum_required(VERSION 2.8.7)
project(xlnt)

View File

@ -1,7 +1,16 @@
cmake_minimum_required(VERSION 3.2.2)
project(xlnt.test)
include_directories(../../../include)
include_directories(../../../third-party/pugixml/src)
include_directories(../../../third-party/cxxtest)
add_executable(xlnt.test ../../../tests/runner-autogen.cpp)
target_link_libraries(xlnt.test xlnt)
add_custom_target (generate
COMMAND ../generate-tests.sh
COMMENT "Generating test runner tests/runner-autogen.cpp"
)
add_dependencies(xlnt.test generate)

View File

@ -1,4 +1,3 @@
cmake_minimum_required(VERSION 3.2.2)
project(xlnt)
include_directories(../../../include)

3
build/generate-tests.sh Executable file
View File

@ -0,0 +1,3 @@
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $DIR
../third-party/cxxtest/bin/cxxtestgen --runner=ErrorPrinter -o ../tests/runner-autogen.cpp ../tests/*.hpp

View File

@ -21,7 +21,7 @@ project "xlnt.test"
"../../tests/runner-autogen.cpp"
}
links { "xlnt", "miniz" }
prebuildcommands { "../../../third-party/cxxtest/bin/cxxtestgen --runner=ErrorPrinter -o ../../../tests/runner-autogen.cpp ../../../tests/*.hpp" }
prebuildcommands { "../generate-tests.sh" }
flags { "Unicode" }
configuration "windows"
defines { "WIN32" }

1
tests/runner-autogen.cpp Normal file
View File

@ -0,0 +1 @@
#error This file should be generated from tests before compiling