-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clean up CMake + PackageConfig (#39)
- Cleaned up old and obsolete stuff from the CMake files - Modernized the interface library target - Added PackageConfig.cmake
- Loading branch information
Showing
6 changed files
with
141 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
set(Mathter_VERSION @PROJECT_VERSION@) | ||
set(MATHTER_ENABLE_SIMD @MATHTER_ENABLE_SIMD@) | ||
|
||
@PACKAGE_INIT@ | ||
|
||
set_and_check(Mathter_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@") | ||
|
||
include(CMakeFindDependencyMacro) | ||
if (${MATHTER_ENABLE_SIMD}) | ||
find_dependency(xsimd REQUIRED) | ||
endif() | ||
|
||
include("${CMAKE_CURRENT_LIST_DIR}/MathterTargets.cmake") | ||
|
||
check_required_components(Mathter) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,74 @@ | ||
add_library(Mathter INTERFACE) | ||
|
||
message("${CMAKE_CURRENT_SOURCE_DIR}/..") | ||
target_include_directories(Mathter INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/..") | ||
|
||
target_sources(Mathter | ||
INTERFACE | ||
INTERFACE FILE_SET natvis TYPE HEADERS BASE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/.." FILES | ||
"Mathter.natvis" | ||
INTERFACE FILE_SET headers TYPE HEADERS BASE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/.." FILES | ||
"Geometry.hpp" | ||
"IoStream.hpp" | ||
"Matrix.hpp" | ||
"Quaternion.hpp" | ||
"Utility.hpp" | ||
"Vector.hpp" | ||
"Common/Approx.hpp" | ||
"Common/Definitions.hpp" | ||
"Common/DeterministicInitializer.hpp" | ||
"Common/MathUtil.hpp" | ||
"Common/Range.hpp" | ||
"Common/Traits.hpp" | ||
"Decompositions/DecomposeLU.hpp" | ||
"Decompositions/DecomposeQR.hpp" | ||
"Decompositions/DecomposeSVD.hpp" | ||
"Matrix/MatrixArithmetic.hpp" | ||
"Matrix/MatrixCast.hpp" | ||
"Matrix/MatrixCompare.hpp" | ||
"Matrix/MatrixFunction.hpp" | ||
"Matrix/MatrixImpl.hpp" | ||
"Matrix/MatrixVectorArithmetic.hpp" | ||
"Quaternion/QuaternionArithmetic.hpp" | ||
"Quaternion/QuaternionCompare.hpp" | ||
"Quaternion/QuaternionFunction.hpp" | ||
"Quaternion/QuaternionImpl.hpp" | ||
"Quaternion/QuaternionLiterals.hpp" | ||
"Quaternion/QuaternionVectorArithmetic.hpp" | ||
"Swizzle/Swizzle_1.inc.hpp" | ||
"Swizzle/Swizzle_2.inc.hpp" | ||
"Swizzle/Swizzle_3.inc.hpp" | ||
"Swizzle/Swizzle_4.inc.hpp" | ||
"Transforms/IdentityBuilder.hpp" | ||
"Transforms/OrthographicBuilder.hpp" | ||
"Transforms/PerspectiveBuilder.hpp" | ||
"Transforms/Rotation2DBuilder.hpp" | ||
"Transforms/Rotation3DBuilder.hpp" | ||
"Transforms/ScaleBuilder.hpp" | ||
"Transforms/ShearBuilder.hpp" | ||
"Transforms/TranslationBuilder.hpp" | ||
"Transforms/ViewBuilder.hpp" | ||
"Transforms/ZeroBuilder.hpp" | ||
"Vector/VectorArithmetic.hpp" | ||
"Vector/VectorCompare.hpp" | ||
"Vector/VectorConcat.hpp" | ||
"Vector/VectorFunction.hpp" | ||
"Vector/VectorImpl.hpp" | ||
) | ||
|
||
set_target_properties(Mathter PROPERTIES VERIFY_INTERFACE_HEADER_SETS ON) | ||
|
||
target_compile_features(Mathter INTERFACE cxx_std_17) | ||
|
||
if (${MATHTER_USE_XSIMD}) | ||
find_package(xsimd) | ||
if (MATHTER_INIT_MODE STREQUAL "NULL") | ||
target_compile_definitions(Mathter INTERFACE MATHTER_NULL_INITIALIZE=1) | ||
elseif(MATHTER_INIT_MODE STREQUAL "INVALID") | ||
target_compile_definitions(Mathter INTERFACE MATHTER_INVALID_INITIALIZE=1) | ||
elseif(MATHTER_INIT_MODE STREQUAL "UNINITIALIZED") | ||
target_compile_definitions(Mathter INTERFACE MATHTER_DONT_INITIALIZE=1) | ||
endif() | ||
|
||
if (${MATHTER_ENABLE_SIMD}) | ||
message("Vectorization: ON (using XSimd).") | ||
find_package(xsimd REQUIRED) | ||
target_link_libraries(Mathter INTERFACE xsimd) | ||
target_compile_definitions(Mathter INTERFACE MATHTER_ENABLE_SIMD=1) | ||
else() | ||
message("Vectorization: OFF.") | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters