Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework folder structure and cmake files #298

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 28 additions & 39 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,59 +32,48 @@ project(
LANGUAGES CXX
)

# The export set for all of our headers.
set(AU_EXPORT_SET_NAME AuHeaders)
option(AU_BUILD_TESTS "Build Tests" ON)
option(AU_USE_VENDORED_GTEST "Build GTest from sources" ON)

enable_testing()
add_library(au INTERFACE)
add_library(Au::au ALIAS au)

# Bring in GoogleTest so we can build and run the tests.
include(FetchContent)
FetchContent_Declare(
googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG 58d77fa8070e8cec2dc1ed015d66b454c8d78850 # Release 1.12.1
FIND_PACKAGE_ARGS
1.12.1
NAMES GTest
target_include_directories(au INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)

# https://google.github.io/googletest/quickstart-cmake.html
# For Windows: Prevent overriding the parent project's compiler/linker settings
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
if(AU_BUILD_TESTS)
enable_testing()
add_subdirectory(tests)
endif()

FetchContent_MakeAvailable(googletest)
include(GoogleTest)
include( GNUInstallDirs )
include( CMakePackageConfigHelpers )

add_subdirectory(au)

# Configure how Au will be installed.
#
# (This is necessary for it to be usable in other CMake projects.)
install(
DIRECTORY include/
DESTINATION include
)

set(AU_CMAKE_DIR ${CMAKE_INSTALL_LIBDIR}/cmake/Au)
install(
TARGETS au
EXPORT AuTargets
)

install(
EXPORT ${AU_EXPORT_SET_NAME}
DESTINATION ${AU_CMAKE_DIR}
EXPORT AuTargets
NAMESPACE Au::
FILE AuHeaders.cmake
DESTINATION lib/cmake/Au
)

include(CMakePackageConfigHelpers)
configure_package_config_file(
${CMAKE_CURRENT_SOURCE_DIR}/cmake/AuConfig.cmake.in
configure_file(
cmake/AuConfig.cmake.in
AuConfig.cmake
INSTALL_DESTINATION ${AU_CMAKE_DIR}
)

write_basic_package_version_file(
AuConfigVersion.cmake
COMPATIBILITY SameMinorVersion
COPYONLY
)

install(
FILES
${CMAKE_CURRENT_BINARY_DIR}/AuConfig.cmake
${CMAKE_CURRENT_BINARY_DIR}/AuConfigVersion.cmake
DESTINATION ${AU_CMAKE_DIR}
FILES ${CMAKE_BINARY_DIR}/AuConfig.cmake
DESTINATION lib/cmake/Au
)
15 changes: 0 additions & 15 deletions au/CMakeLists.txt

This file was deleted.

15 changes: 0 additions & 15 deletions au/code/CMakeLists.txt

This file was deleted.

Loading
Loading