cmake_minimum_required(VERSION 3.2.1 FATAL_ERROR)
project("soxy")
add_definitions(-std=c99)
include_directories(soxy)
# Includes
include(ExternalProject)
ExternalProject_Add(
LibUV
GIT_REPOSITORY "https://github.com/libuv/libuv.git"
GIT_TAG "v1.4.2"
CONFIGURE_COMMAND sh <SOURCE_DIR>/autogen.sh && ./configure --prefix=${CMAKE_CURRENT_SOURCE_DIR}
PATCH_COMMAND ""
BUILD_COMMAND "make"
BUILD_IN_SOURCE 1
PREFIX ${CMAKE_CURRENT_SOURCE_DIR}/build
)
set( SOXY_SRC src/file_utils.c
src/http_parser.c
src/http_request.c
src/path_utils.c
src/string_utils.c
)
set( SOXY_HDR src/debug.h
src/file_utils.h
src/http_client.h
src/http_parser.h
src/http_request.h
src/logger.h
src/path_utils.h
src/soxy_constantsh
src/soxy.h
src/string_utils.h
)
set( SOXY_BIN src/soxy.c )
add_executable(soxy ${SOXY_BIN})
add_dependencies(soxy LibUV)
Project structure:
/soxy
/soxy/CMakeLists.txt
/soxy/build/
When I build the makefile and run make, the lib and include for the external project end up in /soxy, I'd like them to show up in /soxy/build/ and when it builds my project it doesn't setup the include right such that #include <uv.h>
doesn't work and is an unresolved header file inclusion.