diff --git a/CMakeLists.txt b/CMakeLists.txt index b1a88ec..273c968 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,34 +15,33 @@ set(WUT_ROOT ${CMAKE_CURRENT_SOURCE_DIR}) set(WUT_TOOLCHAIN "${CMAKE_CURRENT_SOURCE_DIR}/share/wut.toolchain.cmake") set(WUT_STAGING "${CMAKE_BINARY_DIR}/staging") +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib") +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/lib") +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/lib") + +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib") +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/lib") +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/lib") + +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin") +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/bin") +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/bin") + if(WUT_BUILD_DOCS) add_subdirectory(docs) endif() -externalproject_add(tools - SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/tools" - INSTALL_DIR "${WUT_STAGING}" - CMAKE_CACHE_ARGS - -DCMAKE_C_COMPILER:string=${CMAKE_C_COMPILER} - -DCMAKE_C_FLAGS:string=${CMAKE_C_FLAGS} - -DCMAKE_CXX_COMPILER:string=${CMAKE_CXX_COMPILER} - -DCMAKE_CXX_FLAGS:string=${CMAKE_CXX_FLAGS} - -DCMAKE_INSTALL_PREFIX:string= - BUILD_ALWAYS 1) -externalproject_get_property(tools BINARY_DIR) -set(TOOLS_BINARY_DIR ${BINARY_DIR}) - -set(WUT_RPLGEN "${TOOLS_BINARY_DIR}/bin/rplgen") +add_subdirectory(tools) externalproject_add(cafe SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/cafe" INSTALL_DIR "${WUT_STAGING}" CMAKE_CACHE_ARGS - -DWUT_RPLGEN:filepath=${WUT_RPLGEN} + -DWUT_RPLGEN:filepath=$ -DWUT_ROOT:filepath=${WUT_ROOT} -DCMAKE_TOOLCHAIN_FILE:filepath=${WUT_TOOLCHAIN} -DCMAKE_INSTALL_PREFIX:string= - DEPENDS tools + DEPENDS rplgen BUILD_ALWAYS 1) externalproject_add(libraries diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 7831975..c75ea28 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -1,10 +1,5 @@ -cmake_minimum_required(VERSION 3.2) project(tools) -set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) -set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) - if(MSVC) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++latest") elseif(APPLE)