Skip to content

Commit

Permalink
Revert cmake PROJECT_IS_TOP_LEVEL
Browse files Browse the repository at this point in the history
This only appears to work with cmake >= 3.25 which isn't ready for most
of the CI runs, so it will be reverted for now and re-worked moving
forward.
  • Loading branch information
jbaldwin committed Feb 14, 2024
1 parent f8641ef commit 948c1ea
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ if (NOT "$ENV{version}" STREQUAL "")
endif()

option(LIBCORO_EXTERNAL_DEPENDENCIES "Use Cmake find_package to resolve dependencies instead of embedded libraries, Default=OFF." OFF)
option(LIBCORO_BUILD_TESTS "Build the tests, Default=ON." ON)
option(LIBCORO_CODE_COVERAGE "Enable code coverage, tests must also be enabled, Default=OFF" OFF)
option(LIBCORO_BUILD_EXAMPLES "Build the examples, Default=ON." ON)
option(LIBCORO_RUN_GITCONFIG "Set the githooks directory to auto format and update the readme, Default=OFF." OFF)
option(LIBCORO_BUILD_SHARED_LIBS "Build shared libraries, Default=OFF." OFF)

Expand All @@ -35,19 +37,8 @@ if (LIBCORO_RUN_GITCONFIG)
)
endif()

if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.21)
set(LIBCORO_PROJECT_IS_TOP_LEVEL "${PROJECT_IS_TOP_LEVEL}")
else()
get_property(not_top DIRECTORY PROPERTY PARENT_DIRECTORY)
if(NOT not_top)
set(LIBCORO_PROJECT_IS_TOP_LEVEL true)
endif()
endif()

cmake_dependent_option(LIBCORO_BUILD_TESTS "Build the tests, Default=ON." ON "LIBCORO_PROJECT_IS_TOP_LEVEL" OFF)
cmake_dependent_option(LIBCORO_BUILD_EXAMPLES "Build the examples, Default=ON." ON "LIBCORO_PROJECT_IS_TOP_LEVEL" OFF)
cmake_dependent_option(LIBCORO_FEATURE_NETWORKING "Include networking features, Default=ON." ON "NOT EMSCRIPTEN; LINUX" OFF)
cmake_dependent_option(LIBCORO_FEATURE_TLS "Include TLS encryption features, Default=ON." ON "NOT EMSCRIPTEN; LINUX" OFF)
cmake_dependent_option(LIBCORO_FEATURE_NETWORKING "Include networking features, Default=ON." ON "NOT EMSCRIPTEN; NOT MSVC" OFF)
cmake_dependent_option(LIBCORO_FEATURE_TLS "Include TLS encryption features, Default=ON." ON "NOT EMSCRIPTEN; NOT MSVC" OFF)

message("${PROJECT_NAME} LIBCORO_EXTERNAL_DEPENDENCIES = ${LIBCORO_EXTERNAL_DEPENDENCIES}")
message("${PROJECT_NAME} LIBCORO_BUILD_TESTS = ${LIBCORO_BUILD_TESTS}")
Expand Down

0 comments on commit 948c1ea

Please sign in to comment.