diff options
| author | Mikhail Romanko <me@blankhex.com> | 2025-07-30 18:39:51 +0300 |
|---|---|---|
| committer | Mikhail Romanko <me@blankhex.com> | 2025-07-30 18:39:51 +0300 |
| commit | d0230c3b30f8f753d94377eb25177623fbbcc6d9 (patch) | |
| tree | 826a0a418653548978771e209c189c66dc83b03e | |
| parent | da5a4cb4837175523414782935ebd05828bcb3fa (diff) | |
| download | bhlib-d0230c3b30f8f753d94377eb25177623fbbcc6d9.tar.gz | |
Fix and simplify CMakeLists.txt
| -rw-r--r-- | CMakeLists.txt | 66 | ||||
| -rw-r--r-- | Config.cmake | 7 |
2 files changed, 18 insertions, 55 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 62e4d04..91166c1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -52,6 +52,8 @@ set(ENABLE_COVERAGE OFF CACHE BOOL "Enable coverage") set(ENABLE_EXAMPLES ON CACHE BOOL "Enable building examples") set(ENABLE_LTO ON CACHE BOOL "Enable LTO support") set(ENABLE_MT ON CACHE BOOL "Enable multithreading support") +set(USE_CLOCK_GETTIME OFF CACHE BOOL "Force use clock gettime") +set(BH_ENABLE_LFS OFF CACHE BOOL "Enable long file support") # Enable IPO/LTO if(ENABLE_LTO) @@ -77,63 +79,15 @@ if(ENABLE_TESTING) endif() # Set library code -set(BH_SOURCE - src/Algo.c - src/Args.c - src/Buffer.c - src/Bytes.c - src/Color.c - src/Hashmap.c - src/IO.c - src/Math/Box2f.c - src/Math/Box3f.c - src/Math/Line.c - src/Math/Mat3f.c - src/Math/Mat4f.c - src/Math/Misc.c - src/Math/Plane.c - src/Math/Quat4f.c - src/Math/Ray2f.c - src/Math/Ray3f.c - src/Math/Vec2f.c - src/Math/Vec2i.c - src/Math/Vec3f.c - src/Math/Vec3i.c - src/Math/Vec4f.c - src/Math/Vec4i.c - src/Queue.c - src/String/Float.c - src/String/Int.c - src/String/Unicode.c - src/Util.c +file(GLOB BH_SOURCE + "src/*.c" + "src/Math/*.c" + "src/String/*.c" ) -set(BH_HEADER - include/BH/Algo.h - include/BH/Args.h - include/BH/Color.h - include/BH/Common.h - include/BH/Hashmap.h - include/BH/IO.h - include/BH/Math/Box2f.h - include/BH/Math/Box3f.h - include/BH/Math/Line.h - include/BH/Math/Mat3f.h - include/BH/Math/Mat4f.h - include/BH/Math/Misc.h - include/BH/Math/Plane.h - include/BH/Math/Quat.h - include/BH/Math/Ray2f.h - include/BH/Math/Ray3f.h - include/BH/Math/Vec2f.h - include/BH/Math/Vec2i.h - include/BH/Math/Vec3f.h - include/BH/Math/Vec3i.h - include/BH/Math/Vec4f.h - include/BH/Math/Vec4i.h - include/BH/Queue.h - include/BH/Thread.h - include/BH/Util.h +file(GLOB BH_HEADER + "include/BH/*.h" + "include/BH/Math/*.h" ) set(BH_SOURCE_DUMMY @@ -232,6 +186,8 @@ endif() add_library(BHLib STATIC ${BH_SOURCE} ${BH_HEADER}) target_include_directories(BHLib PUBLIC ${BH_INCLUDE_DIRS}) target_link_libraries(BHLib PUBLIC m) +configure_file(Config.cmake Config.h @ONLY) +target_include_directories(BHLib PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) # Enable all compiler warnings if(MSVC) diff --git a/Config.cmake b/Config.cmake new file mode 100644 index 0000000..3b6df51 --- /dev/null +++ b/Config.cmake @@ -0,0 +1,7 @@ +#ifndef BH_SRC_CONFIG_H +#define BH_SRC_CONFIG_H + +#cmakedefine BH_USE_CLOCK_GETTIME +#cmakedefine BH_ENABLE_LFS + +#endif /* BH_SRC_CONFIG_H */ |
