From 6bf64fb149dae91946971ed39278bb315b975bef Mon Sep 17 00:00:00 2001 From: Jimmy Nguyen Date: Tue, 21 Feb 2017 12:00:38 -0800 Subject: [PATCH] Use CMake to create resources/out directory --- CMakeLists.txt | 4 +++- xmltest.cpp | 17 ----------------- 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0a21405..9a4c0cc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -96,9 +96,11 @@ else(BUILD_STATIC_LIBS) target_link_libraries(xmltest tinyxml2_static) endif() -# Copy test resources +# Copy test resources and create test output directory add_custom_command(TARGET xmltest POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/resources ${CMAKE_BINARY_DIR}/resources + COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/resources/out + COMMENT "Configuring xmltest resources directory: ${CMAKE_BINARY_DIR}/resources" ) install(FILES tinyxml2.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/xmltest.cpp b/xmltest.cpp index b6bb76f..8221e68 100644 --- a/xmltest.cpp +++ b/xmltest.cpp @@ -10,16 +10,10 @@ #include #if defined( _MSC_VER ) - #include // _mkdir #include #define WIN32_LEAN_AND_MEAN #include _CrtMemState startMemState; - _CrtMemState endMemState; -#elif defined(MINGW32) || defined(__MINGW32__) - #include // mkdir -#else - #include // mkdir #endif using namespace tinyxml2; @@ -299,17 +293,6 @@ int main( int argc, const char ** argv ) _CrtSetDbgFlag(_CrtSetDbgFlag(_CRTDBG_REPORT_FLAG) | _CRTDBG_LEAK_CHECK_DF); #endif - #if defined(_MSC_VER) || defined(MINGW32) || defined(__MINGW32__) - #if defined __MINGW64_VERSION_MAJOR && defined __MINGW64_VERSION_MINOR - //MINGW64: both 32 and 64-bit - mkdir( "resources/out/" ); - #else - _mkdir( "resources/out/" ); - #endif - #else - mkdir( "resources/out/", S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH); - #endif - { TIXMLASSERT( true ); }