diff --git a/libs/pcg/CMakeLists.txt b/libs/pcg/CMakeLists.txt index 0f1a18b9..3eab3a97 100644 --- a/libs/pcg/CMakeLists.txt +++ b/libs/pcg/CMakeLists.txt @@ -5,4 +5,4 @@ file(GLOB_RECURSE PSEMEK_PCG_SOURCES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "sou add_library(psemek-pcg ${PSEMEK_PCG_HEADERS} ${PSEMEK_PCG_SOURCES}) target_include_directories(psemek-pcg PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include") -target_link_libraries(psemek-pcg PUBLIC psemek-util psemek-geom psemek-gfx Boost::random) +target_link_libraries(psemek-pcg PUBLIC psemek-util psemek-geom psemek-gfx psemek-random Boost::random) diff --git a/libs/random/CMakeLists.txt b/libs/random/CMakeLists.txt new file mode 100644 index 00000000..c20b7783 --- /dev/null +++ b/libs/random/CMakeLists.txt @@ -0,0 +1,8 @@ +find_package(Boost COMPONENTS random REQUIRED) + +file(GLOB_RECURSE PSEMEK_RANDOM_HEADERS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "include/*.hpp") +file(GLOB_RECURSE PSEMEK_RANDOM_SOURCES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "source/*.cpp") + +add_library(psemek-random ${PSEMEK_RANDOM_HEADERS} ${PSEMEK_RANDOM_SOURCES}) +target_include_directories(psemek-random PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include") +target_link_libraries(psemek-random PUBLIC psemek-util psemek-geom Boost::random) diff --git a/libs/pcg/include/psemek/pcg/random/device.hpp b/libs/random/include/psemek/random/device.hpp similarity index 93% rename from libs/pcg/include/psemek/pcg/random/device.hpp rename to libs/random/include/psemek/random/device.hpp index 1275ab9d..8453b590 100644 --- a/libs/pcg/include/psemek/pcg/random/device.hpp +++ b/libs/random/include/psemek/random/device.hpp @@ -2,7 +2,7 @@ #include -namespace psemek::pcg +namespace psemek::random { using random_device = boost::random_device; diff --git a/libs/pcg/include/psemek/pcg/random/generator.hpp b/libs/random/include/psemek/random/generator.hpp similarity index 97% rename from libs/pcg/include/psemek/pcg/random/generator.hpp rename to libs/random/include/psemek/random/generator.hpp index 2af31ac4..ea36591a 100644 --- a/libs/pcg/include/psemek/pcg/random/generator.hpp +++ b/libs/random/include/psemek/random/generator.hpp @@ -3,7 +3,7 @@ #include #include -namespace psemek::pcg +namespace psemek::random { // based on www.pcg-random.org diff --git a/libs/pcg/include/psemek/pcg/random/normal.hpp b/libs/random/include/psemek/random/normal.hpp similarity index 94% rename from libs/pcg/include/psemek/pcg/random/normal.hpp rename to libs/random/include/psemek/random/normal.hpp index 2cbf5c4d..54b94bb7 100644 --- a/libs/pcg/include/psemek/pcg/random/normal.hpp +++ b/libs/random/include/psemek/random/normal.hpp @@ -1,12 +1,12 @@ #pragma once -#include +#include #include #include #include -namespace psemek::pcg +namespace psemek::random { template diff --git a/libs/pcg/include/psemek/pcg/random/uniform.hpp b/libs/random/include/psemek/random/uniform.hpp similarity index 64% rename from libs/pcg/include/psemek/pcg/random/uniform.hpp rename to libs/random/include/psemek/random/uniform.hpp index 1e492e37..9faf52fa 100644 --- a/libs/pcg/include/psemek/pcg/random/uniform.hpp +++ b/libs/random/include/psemek/random/uniform.hpp @@ -1,11 +1,11 @@ #pragma once -#include -#include +#include +#include #include -namespace psemek::pcg +namespace psemek::random { template diff --git a/libs/pcg/include/psemek/pcg/random/uniform_ball.hpp b/libs/random/include/psemek/random/uniform_ball.hpp similarity index 91% rename from libs/pcg/include/psemek/pcg/random/uniform_ball.hpp rename to libs/random/include/psemek/random/uniform_ball.hpp index 5698a1ba..9cc1a485 100644 --- a/libs/pcg/include/psemek/pcg/random/uniform_ball.hpp +++ b/libs/random/include/psemek/random/uniform_ball.hpp @@ -1,9 +1,9 @@ #pragma once -#include -#include +#include +#include -namespace psemek::pcg +namespace psemek::random { template diff --git a/libs/pcg/include/psemek/pcg/random/uniform_box.hpp b/libs/random/include/psemek/random/uniform_box.hpp similarity index 92% rename from libs/pcg/include/psemek/pcg/random/uniform_box.hpp rename to libs/random/include/psemek/random/uniform_box.hpp index 7cdedcc7..89f63938 100644 --- a/libs/pcg/include/psemek/pcg/random/uniform_box.hpp +++ b/libs/random/include/psemek/random/uniform_box.hpp @@ -2,9 +2,9 @@ #include #include -#include +#include -namespace psemek::pcg +namespace psemek::random { template diff --git a/libs/pcg/include/psemek/pcg/random/uniform_int.hpp b/libs/random/include/psemek/random/uniform_int.hpp similarity index 98% rename from libs/pcg/include/psemek/pcg/random/uniform_int.hpp rename to libs/random/include/psemek/random/uniform_int.hpp index ae08fba4..4439471f 100644 --- a/libs/pcg/include/psemek/pcg/random/uniform_int.hpp +++ b/libs/random/include/psemek/random/uniform_int.hpp @@ -5,7 +5,7 @@ #include #include -namespace psemek::pcg +namespace psemek::random { template diff --git a/libs/pcg/include/psemek/pcg/random/uniform_real.hpp b/libs/random/include/psemek/random/uniform_real.hpp similarity index 98% rename from libs/pcg/include/psemek/pcg/random/uniform_real.hpp rename to libs/random/include/psemek/random/uniform_real.hpp index c32ca8ae..7b2dfcd2 100644 --- a/libs/pcg/include/psemek/pcg/random/uniform_real.hpp +++ b/libs/random/include/psemek/random/uniform_real.hpp @@ -5,7 +5,7 @@ #include #include -namespace psemek::pcg +namespace psemek::random { template diff --git a/libs/pcg/include/psemek/pcg/random/uniform_sphere.hpp b/libs/random/include/psemek/random/uniform_sphere.hpp similarity index 96% rename from libs/pcg/include/psemek/pcg/random/uniform_sphere.hpp rename to libs/random/include/psemek/random/uniform_sphere.hpp index 31c1dcc9..69bc1dbb 100644 --- a/libs/pcg/include/psemek/pcg/random/uniform_sphere.hpp +++ b/libs/random/include/psemek/random/uniform_sphere.hpp @@ -3,10 +3,10 @@ #include #include #include -#include -#include +#include +#include -namespace psemek::pcg +namespace psemek::random { template