From dfba2072f766c88c4c398f9c8b915f3fc9add62b Mon Sep 17 00:00:00 2001 From: FMMazur Date: Thu, 26 Mar 2020 23:36:20 -0400 Subject: [PATCH 01/13] Added simple CMakeLists.txt --- CMakeLists.txt | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..c2683f7 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,43 @@ +cmake_minimum_required(VERSION 3.8.2) +project(cglm LANGUAGES C) + +set(C_STANDARD 99) +set(C_STANDARD_REQUIRED YES) +set(C_EXTENSIONS NO) + +set(CGLM_BUILD) +option(CGLM_STATIC "Static build" ON) +option(CGLM_SHARED "Shared build" OFF) + +if(CGLM_STATIC AND NOT CGLM_SHARED) + set(CGLM_BUILD STATIC) +else(CGLM_SHARED) + set(CGLM_BUILD SHARED) +endif() + +add_library(cglm + ${CGLM_BUILD} + src/io.c + src/box.c + src/ease.c + src/config.h + src/euler.c + src/vec4.c + src/mat2.c + src/mat4.c + src/frustum.c + src/quat.c + src/plane.c + src/project.c + src/bezier.c + src/sphere.c + src/curve.c + src/cam.c + src/vec3.c + src/mat3.c + src/vec2.c + src/affine.c + ) + +target_include_directories(cglm PUBLIC + ${CMAKE_CURRENT_LIST_DIR}/include) From b8e978862e870c9bc9bbed47b34b7ef0ea567459 Mon Sep 17 00:00:00 2001 From: FMMazur Date: Fri, 27 Mar 2020 00:04:15 -0400 Subject: [PATCH 02/13] Added install to CMakeLists.txt --- CMakeLists.txt | 110 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 109 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c2683f7..438f0d5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,6 +15,93 @@ else(CGLM_SHARED) set(CGLM_BUILD SHARED) endif() +set(HEADERS + include/cglm/simd/arm.h + include/cglm/simd/x86.h + include/cglm/simd/sse2/mat3.h + include/cglm/simd/sse2/quat.h + include/cglm/simd/sse2/mat2.h + include/cglm/simd/sse2/mat4.h + include/cglm/simd/sse2/affine.h + include/cglm/simd/intrin.h + include/cglm/simd/avx/mat4.h + include/cglm/simd/avx/affine.h + include/cglm/simd/neon/mat4.h + include/cglm/sphere.h + include/cglm/ease.h + include/cglm/applesimd.h + include/cglm/io.h + include/cglm/mat3.h + include/cglm/affine-mat.h + include/cglm/util.h + include/cglm/common.h + include/cglm/box.h + include/cglm/cam.h + include/cglm/vec3-ext.h + include/cglm/types.h + include/cglm/version.h + include/cglm/vec4-ext.h + include/cglm/euler.h + include/cglm/vec2-ext.h + include/cglm/project.h + include/cglm/quat.h + include/cglm/call.h + include/cglm/plane.h + include/cglm/call/sphere.h + include/cglm/call/ease.h + include/cglm/call/io.h + include/cglm/call/mat3.h + include/cglm/call/box.h + include/cglm/call/cam.h + include/cglm/call/euler.h + include/cglm/call/project.h + include/cglm/call/quat.h + include/cglm/call/plane.h + include/cglm/call/vec2.h + include/cglm/call/mat2.h + include/cglm/call/mat4.h + include/cglm/call/curve.h + include/cglm/call/affine.h + include/cglm/call/vec3.h + include/cglm/call/frustum.h + include/cglm/call/vec4.h + include/cglm/call/bezier.h + include/cglm/struct/sphere.h + include/cglm/struct/io.h + include/cglm/struct/mat3.h + include/cglm/struct/box.h + include/cglm/struct/cam.h + include/cglm/struct/vec3-ext.h + include/cglm/struct/vec4-ext.h + include/cglm/struct/euler.h + include/cglm/struct/vec2-ext.h + include/cglm/struct/project.h + include/cglm/struct/quat.h + include/cglm/struct/plane.h + include/cglm/struct/vec2.h + include/cglm/struct/mat2.h + include/cglm/struct/mat4.h + include/cglm/struct/curve.h + include/cglm/struct/affine.h + include/cglm/struct/vec3.h + include/cglm/struct/frustum.h + include/cglm/struct/vec4.h + include/cglm/struct/color.h + include/cglm/vec2.h + include/cglm/cglm.h + include/cglm/mat2.h + include/cglm/mat4.h + include/cglm/curve.h + include/cglm/affine.h + include/cglm/vec3.h + include/cglm/frustum.h + include/cglm/vec4.h + include/cglm/struct.h + include/cglm/color.h + include/cglm/types-struct.h + include/cglm/bezier.h +) + add_library(cglm ${CGLM_BUILD} src/io.c @@ -40,4 +127,25 @@ add_library(cglm ) target_include_directories(cglm PUBLIC - ${CMAKE_CURRENT_LIST_DIR}/include) + ${CMAKE_CURRENT_LIST_DIR}/include + $/${CMAKE_INSTALL_PREFIX}> +) + +install( + TARGETS cglm + EXPORT cglm + ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib COMPONENT development + LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib COMPONENT runtime NAMELINK_SKIP + RUNTIME DESTINATION ${CMAKE_INSTALL_NAME_DIR} COMPONENT runtime +) + +if(CGLM_SHARED) + install( + TARGETS cglm + EXPORT cglm + LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib COMPONENT development NAMELINK_ONLY + ) +endif() + + +install(FILES ${HEADERS} DESTINATION ${CMAKE_INSTALL_PREFIX}/include/cglm COMPONENT development) From cf3888d7349ba3d3f832a6d8b45a87ed294b95ac Mon Sep 17 00:00:00 2001 From: Felipe Munoz Mazur <36215582+FMMazur@users.noreply.github.com> Date: Fri, 27 Mar 2020 00:12:47 -0400 Subject: [PATCH 03/13] Update README.md Document CMake Usage and Project Example --- README.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/README.md b/README.md index 5243140..8a6e634 100644 --- a/README.md +++ b/README.md @@ -148,6 +148,29 @@ The types used are actually unions that allow access to the same data multiple w ## Build +### CMake (All platforms) +```bash +$ mkdir build +$ cd build +$ cmake .. # [Optional] -DCGLM_SHARED=ON +$ make +$ sudo make install # [Optional] +``` + +#### Use with your CMake project +* Example: +```cmake +cmake_minimum_required(VERSION 3.8.2) + +project() + +add_executable(${PROJECT_NAME} src/main.c) +target_link_libraries(${LIBRARY_NAME} PRIVATE + cglm) + +add_subdirectory(external/cglm/) +``` + ### Unix (Autotools) ```bash From a8543bc813d6eee28d9b4474e2ab5ec54f849478 Mon Sep 17 00:00:00 2001 From: FMMazur Date: Fri, 27 Mar 2020 09:02:52 -0400 Subject: [PATCH 04/13] Added folder build/ to .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 8f9fd0c..6f1ed0d 100644 --- a/.gitignore +++ b/.gitignore @@ -72,3 +72,4 @@ cglm-test-ios* /cglm.pc test-driver Default-568h@2x.png +build/ From 0ef028244a98b4f78b24ab8322900c45e5fa02a4 Mon Sep 17 00:00:00 2001 From: FMMazur Date: Fri, 27 Mar 2020 09:11:08 -0400 Subject: [PATCH 05/13] CMake: Added LDFlags Configuration --- CMakeLists.txt | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 438f0d5..fced657 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,11 +3,11 @@ project(cglm LANGUAGES C) set(C_STANDARD 99) set(C_STANDARD_REQUIRED YES) -set(C_EXTENSIONS NO) set(CGLM_BUILD) option(CGLM_STATIC "Static build" ON) option(CGLM_SHARED "Shared build" OFF) +option(CGLM_USE_C11 "" OFF) if(CGLM_STATIC AND NOT CGLM_SHARED) set(CGLM_BUILD STATIC) @@ -15,6 +15,20 @@ else(CGLM_SHARED) set(CGLM_BUILD SHARED) endif() +if(CGLM_USE_C11) + set(C_STANDARD 99) +endif() + +if("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC") + list(APPEND LDFLAGS "/W4") +elseif("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU") + set(C_EXTENSIONS YES) + list(APPEND LDFLAGS "-Wall" "-Wpedantic" "-Wstrict-aliasing=2") + list(APPEND LDFLAGS "-Werror=strict-prototypes" "-fstrict-aliasing" "-O3") +elseif("${CMAKE_C_COMPILER_ID}" STREQUAL "CLANG") + list(APPEND LDFLAGS "-Wall" "-Weverything" "-Wpedantic") +endif() + set(HEADERS include/cglm/simd/arm.h include/cglm/simd/x86.h @@ -131,6 +145,10 @@ target_include_directories(cglm PUBLIC $/${CMAKE_INSTALL_PREFIX}> ) +if(LDFLAGS) + target_compile_options(cglm PRIVATE ${LDFLAGS}) +endif() + install( TARGETS cglm EXPORT cglm @@ -147,5 +165,4 @@ if(CGLM_SHARED) ) endif() - install(FILES ${HEADERS} DESTINATION ${CMAKE_INSTALL_PREFIX}/include/cglm COMPONENT development) From d4235b24315be5462ea06b695268612bf36f98e4 Mon Sep 17 00:00:00 2001 From: FMMazur Date: Fri, 27 Mar 2020 11:19:56 -0400 Subject: [PATCH 06/13] CMake: Added test configuration --- CMakeLists.txt | 12 +++++++++--- test/CMakeLists.txt | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 3 deletions(-) create mode 100644 test/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index fced657..1917110 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,6 +8,7 @@ set(CGLM_BUILD) option(CGLM_STATIC "Static build" ON) option(CGLM_SHARED "Shared build" OFF) option(CGLM_USE_C11 "" OFF) +option(CGLM_USE_TEST "Enable Tests" OFF) if(CGLM_STATIC AND NOT CGLM_SHARED) set(CGLM_BUILD STATIC) @@ -16,7 +17,7 @@ else(CGLM_SHARED) endif() if(CGLM_USE_C11) - set(C_STANDARD 99) + set(C_STANDARD 11) endif() if("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC") @@ -141,8 +142,7 @@ add_library(cglm ) target_include_directories(cglm PUBLIC - ${CMAKE_CURRENT_LIST_DIR}/include - $/${CMAKE_INSTALL_PREFIX}> + ${CMAKE_CURRENT_SOURCE_DIR}/include ) if(LDFLAGS) @@ -166,3 +166,9 @@ if(CGLM_SHARED) endif() install(FILES ${HEADERS} DESTINATION ${CMAKE_INSTALL_PREFIX}/include/cglm COMPONENT development) + +# Test Configuration +if(CGLM_USE_TEST) + enable_testing() + add_subdirectory(test) +endif() diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt new file mode 100644 index 0000000..7121c6e --- /dev/null +++ b/test/CMakeLists.txt @@ -0,0 +1,41 @@ +cmake_minimum_required(VERSION 3.8.2) + +# List all files containing tests. (Change as needed) +set(TESTFILES + runner.c + src/test_euler.c + src/test_bezier.c + src/test_cam.c + src/test_struct.c + src/test_clamp.c + src/test_common.c + src/tests.c + ) + +set(TEST_MAIN tests) +set(TEST_RUNNER_PARAMS "") + +add_executable(${TEST_MAIN} ${TESTFILES}) + +target_link_libraries(${TEST_MAIN} PRIVATE cglm m) +target_include_directories(${TEST_MAIN} PRIVATE + ${CMAKE_CURRENT_LIST_DIR}/include + ${CMAKE_CURRENT_LIST_DIR}/src + ) + +set_target_properties(${TEST_MAIN} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}) + +if(LDFLAGS) + target_compile_options(${TEST_MAIN} PRIVATE ${LDFLAGS}) +endif() + +# set(C_STANDARD 99) +# set(C_STANDARD_REQUIRED YES) + +# if(CGLM_USE_C11) +# set(C_STANDARD 11) +# endif() + +add_test( + NAME cglm.${TEST_MAIN} + COMMAND ${TEST_MAIN} ${TEST_RUNNER_PARAMS}) From 1fb5f89eaa593bcc8deae00e5dd9a56a828a6254 Mon Sep 17 00:00:00 2001 From: FMMazur Date: Fri, 27 Mar 2020 15:30:03 -0400 Subject: [PATCH 07/13] CMake: Change c99 to c11 and shared build as default options. --- CMakeLists.txt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1917110..dc64f9f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,23 +1,23 @@ cmake_minimum_required(VERSION 3.8.2) project(cglm LANGUAGES C) -set(C_STANDARD 99) +set(C_STANDARD 11) set(C_STANDARD_REQUIRED YES) set(CGLM_BUILD) -option(CGLM_STATIC "Static build" ON) -option(CGLM_SHARED "Shared build" OFF) -option(CGLM_USE_C11 "" OFF) +option(CGLM_SHARED "Shared build" ON) +option(CGLM_STATIC "Static build" OFF) +option(CGLM_USE_C99 "" OFF) option(CGLM_USE_TEST "Enable Tests" OFF) -if(CGLM_STATIC AND NOT CGLM_SHARED) - set(CGLM_BUILD STATIC) -else(CGLM_SHARED) +if(NOT CGLM_STATIC AND CGLM_SHARED) set(CGLM_BUILD SHARED) +else(CGLM_STATIC) + set(CGLM_BUILD STATIC) endif() -if(CGLM_USE_C11) - set(C_STANDARD 11) +if(CGLM_USE_C99) + set(C_STANDARD 99) endif() if("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC") From be68d57499288e71b44f35404bc4c481f44ad416 Mon Sep 17 00:00:00 2001 From: FMMazur Date: Fri, 27 Mar 2020 15:31:55 -0400 Subject: [PATCH 08/13] CMake: Added 'make check' as alias to 'make test' --- test/CMakeLists.txt | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 7121c6e..fb2c288 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -29,13 +29,11 @@ if(LDFLAGS) target_compile_options(${TEST_MAIN} PRIVATE ${LDFLAGS}) endif() -# set(C_STANDARD 99) -# set(C_STANDARD_REQUIRED YES) - -# if(CGLM_USE_C11) -# set(C_STANDARD 11) -# endif() - add_test( NAME cglm.${TEST_MAIN} COMMAND ${TEST_MAIN} ${TEST_RUNNER_PARAMS}) + +add_custom_target(check + make + COMMAND ${CMAKE_CTEST_COMMAND} -V + DEPENDS cglm) From bc6b75142983dce4b44e45f1bc9c680aab6b5836 Mon Sep 17 00:00:00 2001 From: FMMazur Date: Fri, 27 Mar 2020 15:50:37 -0400 Subject: [PATCH 09/13] CMake: add install path option --- CMakeLists.txt | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index dc64f9f..95229f1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,6 +9,7 @@ option(CGLM_SHARED "Shared build" ON) option(CGLM_STATIC "Static build" OFF) option(CGLM_USE_C99 "" OFF) option(CGLM_USE_TEST "Enable Tests" OFF) +option(CGLM_INSTALL_PATH "") if(NOT CGLM_STATIC AND CGLM_SHARED) set(CGLM_BUILD SHARED) @@ -149,11 +150,15 @@ if(LDFLAGS) target_compile_options(cglm PRIVATE ${LDFLAGS}) endif() +if(NOT CGLM_INSTALL_PATH) + set(CGLM_INSTALL_PATH "") +endif() + install( TARGETS cglm EXPORT cglm - ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib COMPONENT development - LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib COMPONENT runtime NAMELINK_SKIP + ARCHIVE DESTINATION ${CGLM_INSTALL_PATH}lib COMPONENT development + LIBRARY DESTINATION ${CGLM_INSTALL_PATH}lib COMPONENT runtime NAMELINK_SKIP RUNTIME DESTINATION ${CMAKE_INSTALL_NAME_DIR} COMPONENT runtime ) @@ -161,11 +166,12 @@ if(CGLM_SHARED) install( TARGETS cglm EXPORT cglm - LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib COMPONENT development NAMELINK_ONLY + LIBRARY DESTINATION ${CGLM_INSTALL_PATH}/lib COMPONENT development NAMELINK_ONLY ) endif() -install(FILES ${HEADERS} DESTINATION ${CMAKE_INSTALL_PREFIX}/include/cglm COMPONENT development) + +install(FILES ${HEADERS} DESTINATION ${CGLM_INSTALL_PATH}include/cglm COMPONENT development) # Test Configuration if(CGLM_USE_TEST) From 38019f0913804c50df49ae46e525eecd7b8e1ec7 Mon Sep 17 00:00:00 2001 From: FMMazur Date: Fri, 27 Mar 2020 15:57:26 -0400 Subject: [PATCH 10/13] CMake: add lib and include install path --- CMakeLists.txt | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 95229f1..6070de3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -153,12 +153,18 @@ endif() if(NOT CGLM_INSTALL_PATH) set(CGLM_INSTALL_PATH "") endif() +if(NOT CGLM_INSTALL_LIBDIR) + set(CGLM_INSTALL_LIBDIR "${CGLM_INSTALL_PATH}lib") +endif() +if(NOT CGLM_INSTALL_INCDIR ) + set(CGLM_INSTALL_INCDIR "${CGLM_INSTALL_PATH}include/clgm") +endif() install( TARGETS cglm EXPORT cglm - ARCHIVE DESTINATION ${CGLM_INSTALL_PATH}lib COMPONENT development - LIBRARY DESTINATION ${CGLM_INSTALL_PATH}lib COMPONENT runtime NAMELINK_SKIP + ARCHIVE DESTINATION ${CGLM_INSTALL_LIBDIR} COMPONENT development + LIBRARY DESTINATION ${CGLM_INSTALL_LIBDIR} COMPONENT runtime NAMELINK_SKIP RUNTIME DESTINATION ${CMAKE_INSTALL_NAME_DIR} COMPONENT runtime ) @@ -166,12 +172,12 @@ if(CGLM_SHARED) install( TARGETS cglm EXPORT cglm - LIBRARY DESTINATION ${CGLM_INSTALL_PATH}/lib COMPONENT development NAMELINK_ONLY + LIBRARY DESTINATION ${CGLM_INSTALL_LIBDIR} COMPONENT development NAMELINK_ONLY ) endif() -install(FILES ${HEADERS} DESTINATION ${CGLM_INSTALL_PATH}include/cglm COMPONENT development) +install(FILES ${HEADERS} DESTINATION ${CGLM_INSTALL_INCDIR} COMPONENT development) # Test Configuration if(CGLM_USE_TEST) From e493149a0a53410d57e1aa249273c5f9c6961b0e Mon Sep 17 00:00:00 2001 From: FMMazur Date: Fri, 27 Mar 2020 16:04:46 -0400 Subject: [PATCH 11/13] CMake: Fix errors --- CMakeLists.txt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6070de3..1b047c3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,7 +9,10 @@ option(CGLM_SHARED "Shared build" ON) option(CGLM_STATIC "Static build" OFF) option(CGLM_USE_C99 "" OFF) option(CGLM_USE_TEST "Enable Tests" OFF) + option(CGLM_INSTALL_PATH "") +option(CGLM_INSTALL_LIBDIR "") +option(CGLM_INSTALL_INCDIR "") if(NOT CGLM_STATIC AND CGLM_SHARED) set(CGLM_BUILD SHARED) @@ -151,13 +154,14 @@ if(LDFLAGS) endif() if(NOT CGLM_INSTALL_PATH) - set(CGLM_INSTALL_PATH "") + set(CGLM_INSTALL_PATH ".") endif() + if(NOT CGLM_INSTALL_LIBDIR) - set(CGLM_INSTALL_LIBDIR "${CGLM_INSTALL_PATH}lib") + set(CGLM_INSTALL_LIBDIR "${CGLM_INSTALL_PATH}/lib") endif() if(NOT CGLM_INSTALL_INCDIR ) - set(CGLM_INSTALL_INCDIR "${CGLM_INSTALL_PATH}include/clgm") + set(CGLM_INSTALL_INCDIR "${CGLM_INSTALL_PATH}/include/clgm") endif() install( From 83f6db1bf85e287fc811148cdd8380590bd10bf7 Mon Sep 17 00:00:00 2001 From: FMMazur Date: Fri, 27 Mar 2020 18:43:28 -0400 Subject: [PATCH 12/13] CMake: Fix install error --- CMakeLists.txt | 73 +++++++++++++++++++++++++++++++------------------- 1 file changed, 46 insertions(+), 27 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1b047c3..d4ab9a2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,17 +35,6 @@ elseif("${CMAKE_C_COMPILER_ID}" STREQUAL "CLANG") endif() set(HEADERS - include/cglm/simd/arm.h - include/cglm/simd/x86.h - include/cglm/simd/sse2/mat3.h - include/cglm/simd/sse2/quat.h - include/cglm/simd/sse2/mat2.h - include/cglm/simd/sse2/mat4.h - include/cglm/simd/sse2/affine.h - include/cglm/simd/intrin.h - include/cglm/simd/avx/mat4.h - include/cglm/simd/avx/affine.h - include/cglm/simd/neon/mat4.h include/cglm/sphere.h include/cglm/ease.h include/cglm/applesimd.h @@ -66,6 +55,22 @@ set(HEADERS include/cglm/quat.h include/cglm/call.h include/cglm/plane.h + include/cglm/vec2.h + include/cglm/cglm.h + include/cglm/mat2.h + include/cglm/mat4.h + include/cglm/curve.h + include/cglm/affine.h + include/cglm/vec3.h + include/cglm/frustum.h + include/cglm/vec4.h + include/cglm/struct.h + include/cglm/color.h + include/cglm/types-struct.h + include/cglm/bezier.h + ) + +set(HEADERS_CALL include/cglm/call/sphere.h include/cglm/call/ease.h include/cglm/call/io.h @@ -85,6 +90,29 @@ set(HEADERS include/cglm/call/frustum.h include/cglm/call/vec4.h include/cglm/call/bezier.h + ) + +set(HEADERS_SIMD + include/cglm/simd/arm.h + include/cglm/simd/x86.h + include/cglm/simd/intrin.h + include/cglm/simd/neon/mat4.h + ) +set(HEADERS_SIMD_AVX + include/cglm/simd/avx/mat4.h + include/cglm/simd/avx/affine.h + ) +set(HEADERS_SIMD_SSE2 + include/cglm/simd/sse2/mat3.h + include/cglm/simd/sse2/quat.h + include/cglm/simd/sse2/mat2.h + include/cglm/simd/sse2/mat4.h + include/cglm/simd/sse2/affine.h + ) + + + +set(HEADERS_STRUCT include/cglm/struct/sphere.h include/cglm/struct/io.h include/cglm/struct/mat3.h @@ -106,20 +134,7 @@ set(HEADERS include/cglm/struct/frustum.h include/cglm/struct/vec4.h include/cglm/struct/color.h - include/cglm/vec2.h - include/cglm/cglm.h - include/cglm/mat2.h - include/cglm/mat4.h - include/cglm/curve.h - include/cglm/affine.h - include/cglm/vec3.h - include/cglm/frustum.h - include/cglm/vec4.h - include/cglm/struct.h - include/cglm/color.h - include/cglm/types-struct.h - include/cglm/bezier.h -) + ) add_library(cglm ${CGLM_BUILD} @@ -161,7 +176,7 @@ if(NOT CGLM_INSTALL_LIBDIR) set(CGLM_INSTALL_LIBDIR "${CGLM_INSTALL_PATH}/lib") endif() if(NOT CGLM_INSTALL_INCDIR ) - set(CGLM_INSTALL_INCDIR "${CGLM_INSTALL_PATH}/include/clgm") + set(CGLM_INSTALL_INCDIR "${CGLM_INSTALL_PATH}include") endif() install( @@ -181,7 +196,11 @@ if(CGLM_SHARED) endif() -install(FILES ${HEADERS} DESTINATION ${CGLM_INSTALL_INCDIR} COMPONENT development) +INSTALL(DIRECTORY include/ DESTINATION ${CGLM_INSTALL_INCDIR} + COMPONENT development + FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE + # PATTERN "cglm/*" + ) # Test Configuration if(CGLM_USE_TEST) From a84ebc4aaa4852c66c8bddadc5f7187ce177aedf Mon Sep 17 00:00:00 2001 From: FMMazur Date: Thu, 9 Apr 2020 14:03:18 -0400 Subject: [PATCH 13/13] CMake: Use CCMAKE_INSTALL_PREFIX as default to set directory install --- CMakeLists.txt | 27 ++++----------------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d4ab9a2..fcb53ba 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,10 +10,6 @@ option(CGLM_STATIC "Static build" OFF) option(CGLM_USE_C99 "" OFF) option(CGLM_USE_TEST "Enable Tests" OFF) -option(CGLM_INSTALL_PATH "") -option(CGLM_INSTALL_LIBDIR "") -option(CGLM_INSTALL_INCDIR "") - if(NOT CGLM_STATIC AND CGLM_SHARED) set(CGLM_BUILD SHARED) else(CGLM_STATIC) @@ -168,22 +164,11 @@ if(LDFLAGS) target_compile_options(cglm PRIVATE ${LDFLAGS}) endif() -if(NOT CGLM_INSTALL_PATH) - set(CGLM_INSTALL_PATH ".") -endif() - -if(NOT CGLM_INSTALL_LIBDIR) - set(CGLM_INSTALL_LIBDIR "${CGLM_INSTALL_PATH}/lib") -endif() -if(NOT CGLM_INSTALL_INCDIR ) - set(CGLM_INSTALL_INCDIR "${CGLM_INSTALL_PATH}include") -endif() - install( TARGETS cglm EXPORT cglm - ARCHIVE DESTINATION ${CGLM_INSTALL_LIBDIR} COMPONENT development - LIBRARY DESTINATION ${CGLM_INSTALL_LIBDIR} COMPONENT runtime NAMELINK_SKIP + ARCHIVE DESTINATION lib/ COMPONENT development + LIBRARY DESTINATION lib/ COMPONENT runtime NAMELINK_SKIP RUNTIME DESTINATION ${CMAKE_INSTALL_NAME_DIR} COMPONENT runtime ) @@ -191,16 +176,12 @@ if(CGLM_SHARED) install( TARGETS cglm EXPORT cglm - LIBRARY DESTINATION ${CGLM_INSTALL_LIBDIR} COMPONENT development NAMELINK_ONLY + LIBRARY DESTINATION include/ COMPONENT development NAMELINK_ONLY ) endif() -INSTALL(DIRECTORY include/ DESTINATION ${CGLM_INSTALL_INCDIR} - COMPONENT development - FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE - # PATTERN "cglm/*" - ) +INSTALL(DIRECTORY include/ DESTINATION include) # Test Configuration if(CGLM_USE_TEST)