From 1854e05e1bb14d8f2bbc4676f44024a83e972f6f Mon Sep 17 00:00:00 2001 From: Alexia Date: Sat, 26 Mar 2016 11:17:03 -0400 Subject: [PATCH] NOISSUE Fix building when embedded in another project --- CMakeLists.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4125fa29..9cd3cf47 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -79,20 +79,20 @@ set_directory_properties(PROPERTIES EP_BASE External) # Add quazip add_definitions(-DQUAZIP_STATIC) set(QUAZIP_VERSION "0.7.1") -if(NOT EXISTS ${CMAKE_BINARY_DIR}/quazip-${QUAZIP_VERSION}.tar.gz) - file(DOWNLOAD http://downloads.sourceforge.net/project/quazip/quazip/${QUAZIP_VERSION}/quazip-${QUAZIP_VERSION}.tar.gz ${CMAKE_BINARY_DIR}/quazip-${QUAZIP_VERSION}.tar.gz) +if(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/quazip-${QUAZIP_VERSION}.tar.gz) + file(DOWNLOAD http://downloads.sourceforge.net/project/quazip/quazip/${QUAZIP_VERSION}/quazip-${QUAZIP_VERSION}.tar.gz ${CMAKE_CURRENT_BINARY_DIR}/quazip-${QUAZIP_VERSION}.tar.gz) endif() ExternalProject_Add(QuaZIP SOURCE_DIR /../Source/quazip-${QUAZIP_VERSION} - DOWNLOAD_COMMAND ${CMAKE_COMMAND} -E chdir /.. ${CMAKE_COMMAND} -E tar xzf ${CMAKE_BINARY_DIR}/quazip-${QUAZIP_VERSION}.tar.gz + DOWNLOAD_COMMAND ${CMAKE_COMMAND} -E chdir /.. ${CMAKE_COMMAND} -E tar xzf ${CMAKE_CURRENT_BINARY_DIR}/quazip-${QUAZIP_VERSION}.tar.gz PATCH_COMMAND patch -p0 -i ${CMAKE_SOURCE_DIR}/quazip.patch CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} -DCMAKE_CXX_FLAGS_DEBUG=${CMAKE_CXX_FLAGS_DEBUG} -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} -DCMAKE_INSTALL_PREFIX= ) -include_directories("${CMAKE_BINARY_DIR}/External/Install/QuaZIP/include/quazip") +include_directories("${CMAKE_CURRENT_BINARY_DIR}/External/Install/QuaZIP/include/quazip") if(UNIX) -set(QUAZIP_LIBRARIES -L"${CMAKE_BINARY_DIR}/External/Install/QuaZIP/lib" quazip z) +set(QUAZIP_LIBRARIES -L"${CMAKE_CURRENT_BINARY_DIR}/External/Install/QuaZIP/lib" quazip z) else() -set(QUAZIP_LIBRARIES -L"${CMAKE_BINARY_DIR}/External/Install/QuaZIP/lib" quazip) +set(QUAZIP_LIBRARIES -L"${CMAKE_CURRENT_BINARY_DIR}/External/Install/QuaZIP/lib" quazip) endif() add_subdirectory(depends/hoedown) # markdown parser