Skip to content

Commit

Permalink
CMakeLists.txt - Allow passing CMAKE_BUILD_TYPE to externalproject bu…
Browse files Browse the repository at this point in the history
…ilds
  • Loading branch information
chmorgan committed Dec 22, 2017
1 parent 4db3521 commit dc120fb
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,34 @@ set(DEFAULT_INSTALL_DIR ${CMAKE_BINARY_DIR}/install)

set(ARGS "-DCMAKE_INSTALL_PREFIX=${DEFAULT_INSTALL_DIR}")

message("${CMAKE_BUILD_TYPE}")

if(NOT ${CMAKE_BUILD_TYPE} STREQUAL "")
message("appending CMAKE_BUILD_TYPE")
list(APPEND ARGS "-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}")
endif(NOT ${CMAKE_BUILD_TYPE} STREQUAL "")

message("ARGS is ${ARGS}")

ExternalProject_Add(esphttpd
SOURCE_DIR "${CMAKE_SOURCE_DIR}/libesphttpd"
DOWNLOAD_COMMAND ""
UPDATE_COMMAND ""
CMAKE_ARGS ${ARGS}
CMAKE_ARGS "${ARGS}"
)

ExternalProject_Add(httpd
SOURCE_DIR "${CMAKE_SOURCE_DIR}/httpd"
DOWNLOAD_COMMAND ""
UPDATE_COMMAND ""
CMAKE_ARGS ${ARGS}
CMAKE_ARGS "${ARGS}"
)

ExternalProject_Add(tests
SOURCE_DIR "${CMAKE_SOURCE_DIR}/tests"
DOWNLOAD_COMMAND ""
UPDATE_COMMAND ""
CMAKE_ARGS ${ARGS}
CMAKE_ARGS "${ARGS}"
)

add_test(NAME test_post
Expand Down

0 comments on commit dc120fb

Please sign in to comment.