Skip to content

Commit 304c358

Browse files
author
Samuel Rodriguez Sevilla
committed
Fixing building
WIP: It still needs a lot of work to do.
1 parent 4ec679b commit 304c358

File tree

5 files changed

+51
-17
lines changed

5 files changed

+51
-17
lines changed

CMakeLists.txt

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
cmake_minimum_required(VERSION 3.25)
22
project(lzc-coro VERSION 0.1.0
33
DESCRIPTION "A simple header-only C++ library to use coroutines"
4-
HOMEPAGE "https://github.com/lzcoders/lzc-coro"
5-
CXX)
4+
LANGUAGES CXX)
65

7-
set(CMAKE_CXX_STANDARD 23)
8-
set(CMAKE_CXX_STANDARD_REQUIRED ON)
6+
#set(CMAKE_CXX_STANDARD 23)
7+
#set(CMAKE_CXX_STANDARD_REQUIRED ON)
98

9+
include(cmake/CPM.cmake)
1010

1111
add_library(lzc-coro INTERFACE)
1212
target_include_directories(
@@ -24,14 +24,14 @@ install(TARGETS lzc-coro
2424
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
2525
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
2626

27-
include(CMakePackageConfigHelpers)
28-
write_basic_package_version_file("lzc-coroConfigVersion.cmake"
29-
VERSION ${PROJECT_VERSION}
30-
COMPATIBILITY SameMajorVersion)
31-
configure_package_config_file(
32-
"${PROJECT_SOURCE_DIR}/cmake/${PROJECT_NAME}Config.cmake.in"
33-
"${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
34-
INSTALL_DESTINATION
35-
${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/cmake)
27+
#include(CMakePackageConfigHelpers)
28+
#write_basic_package_version_file("lzc-coroConfigVersion.cmake"
29+
# VERSION ${PROJECT_VERSION}
30+
# COMPATIBILITY SameMajorVersion)
31+
#configure_package_config_file(
32+
# "${PROJECT_SOURCE_DIR}/cmake/${PROJECT_NAME}Config.cmake.in"
33+
# "${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
34+
# INSTALL_DESTINATION
35+
# ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/cmake)
3636

3737
add_subdirectory(tests)

cmake/CPM.cmake

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# SPDX-License-Identifier: MIT
2+
#
3+
# SPDX-FileCopyrightText: Copyright (c) 2019-2023 Lars Melchior and contributors
4+
5+
set(CPM_DOWNLOAD_VERSION 0.38.7)
6+
set(CPM_HASH_SUM "83e5eb71b2bbb8b1f2ad38f1950287a057624e385c238f6087f94cdfc44af9c5")
7+
8+
if(CPM_SOURCE_CACHE)
9+
set(CPM_DOWNLOAD_LOCATION "${CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
10+
elseif(DEFINED ENV{CPM_SOURCE_CACHE})
11+
set(CPM_DOWNLOAD_LOCATION "$ENV{CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
12+
else()
13+
set(CPM_DOWNLOAD_LOCATION "${CMAKE_BINARY_DIR}/cmake/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
14+
endif()
15+
16+
# Expand relative path. This is important if the provided path contains a tilde (~)
17+
get_filename_component(CPM_DOWNLOAD_LOCATION ${CPM_DOWNLOAD_LOCATION} ABSOLUTE)
18+
19+
file(DOWNLOAD
20+
https://github.com/cpm-cmake/CPM.cmake/releases/download/v${CPM_DOWNLOAD_VERSION}/CPM.cmake
21+
${CPM_DOWNLOAD_LOCATION} EXPECTED_HASH SHA256=${CPM_HASH_SUM}
22+
)
23+
24+
include(${CPM_DOWNLOAD_LOCATION})

include/lzcoders/coro.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include <coroutine>
44
#include <future>
55
#include <optional>
6-
#include <debug.hpp>
6+
#include <lzcoders/debug.hpp>
77

88
namespace lzcoders
99
{

tests/CMakeLists.txt

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,12 @@
1-
add_executable(coro main.cpp)
2-
target_include_directories(coro PUBLIC include)
1+
#CPMAddPackage(
2+
# NAME googletest
3+
# GITHUB_REPOSITORY google/googletest
4+
# GIT_TAG release-1.12.1
5+
# VERSION 1.12.1
6+
# OPTIONS "INSTALL_GTEST OFF" "gtest_force_shared_crt"
7+
#)
8+
9+
#add_test(NAME lzc-coro-test )
10+
add_executable(lzc-coro-test main.cpp)
11+
target_link_libraries(lzc-coro-test PRIVATE lzc-coro)
12+
#target_include_directories(coro PUBLIC include)

io_reader.hpp renamed to tests/io_reader.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#pragma once
22
#include <thread>
3-
#include "d.hpp"
3+
#include <lzcoders/debug.hpp>
44

55
namespace lzcoders
66
{

0 commit comments

Comments
 (0)