diff --git a/CMakeLists.txt b/CMakeLists.txt index 89ca414..342d21b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,8 +1,14 @@ cmake_minimum_required(VERSION 3.2) project(3DSceneModel - VERSION 0.4.0 - LANGUAGES CXX) + VERSION 0.4.1 + LANGUAGES CXX +) + +configure_file ( + "${PROJECT_SOURCE_DIR}/src/config.h.in" + "${PROJECT_BINARY_DIR}/config.h" +) ## # ________________________________________________ Modules __________________________________________________ @@ -14,6 +20,7 @@ include(cmake/dependencies.cmake) # _______________________________________________ Libraries __________________________________________________ ## +include_directories("${PROJECT_SOURCE_DIR}/src/libs") add_subdirectory(src/libs libs) ## diff --git a/src/cli/CMakeLists.txt b/src/cli/CMakeLists.txt index 9e698d8..4dbb358 100644 --- a/src/cli/CMakeLists.txt +++ b/src/cli/CMakeLists.txt @@ -1,4 +1,3 @@ set(Proj_XY_CLI_SRC "${3DSceneModel_SOURCE_DIR}/src/cli/project_scene_xy.cpp") add_executable(project_scene_xy ${Proj_XY_CLI_SRC} ${urban_HEADER}) -target_compile_options(project_scene_xy PUBLIC -DVERSION=\"${PROJECT_VERSION}\") target_link_libraries(project_scene_xy urban) diff --git a/src/cli/project_scene_xy.cpp b/src/cli/project_scene_xy.cpp index 52e9d7e..9ef8584 100644 --- a/src/cli/project_scene_xy.cpp +++ b/src/cli/project_scene_xy.cpp @@ -1,7 +1,9 @@ -#include "../libs/urban.h" -#include "arguments.h" +#include "config.h" + +#include #include +#include "arguments.h" #include diff --git a/src/config.h.in b/src/config.h.in new file mode 100644 index 0000000..c19e6fa --- /dev/null +++ b/src/config.h.in @@ -0,0 +1,7 @@ + +/** Project version*/ +#define _VERSION_MAJOR @3DSceneModel_VERSION_MAJOR@ +#define _VERSION_MINOR @3DSceneModel_VERSION_MINOR@ +#define _VERSION_PATCH @3DSceneModel_VERSION_PATCH@ + +#define VERSION "@3DSceneModel_VERSION_MAJOR@.@3DSceneModel_VERSION_MINOR@.@3DSceneModel_VERSION_PATCH@" diff --git a/src/libs/CMakeLists.txt b/src/libs/CMakeLists.txt index ba5d02e..7e84842 100644 --- a/src/libs/CMakeLists.txt +++ b/src/libs/CMakeLists.txt @@ -65,29 +65,29 @@ set(IO_SRC "${3DSceneModel_SOURCE_DIR}/src/libs/io/io_off.cpp" "${3DSceneModel_SOURCE_DIR}/src/libs/io/io_gdal.cpp" ) +set(urban_HEADER "${3DSceneModel_SOURCE_DIR}/src/libs/urban.h") # Shadow -add_library(urban_shadow ${Shadow_HEADERS} ${Shadow_SRC}) +add_library(urban_shadow ${Shadow_SRC}) target_link_libraries(urban_shadow ${LIBS}) -# Projections -add_library(urban_projection ${Projection_HEADER} ${Projection_SRC} ${Scene_HEADERS} ${Algorithms_HEADER}) -target_link_libraries(urban_projection urban_algorithms ${LIBS}) +# Scene +add_library(urban_scene ${Scene_SRC}) +target_link_libraries(urban_scene urban_shadow urban_projection ${LIBS}) # Algorithms -add_library(urban_algorithms ${Algorithms_HEADER} ${Algorithms_SRC} ${Scene_HEADERS} ${Shadow_HEADERS} ${Projection_HEADER}) -target_link_libraries(urban_algorithms urban_scene urban_shadow urban_projection ${LIBS}) - -# Scene -add_library(urban_scene ${Scene_HEADERS} ${Scene_SRC} ${Shadow_HEADERS} ${Projection_HEADER} ${Algorithms_HEADER}) -target_link_libraries(urban_scene urban_shadow urban_algorithms urban_projection ${LIBS}) +add_library(urban_algorithms ${Algorithms_SRC}) +target_link_libraries(urban_algorithms urban_scene urban_shadow ${LIBS}) +# Projections +add_library(urban_projection ${Projection_SRC}) +target_link_libraries(urban_projection urban_algorithms ${LIBS}) + # Input/Output -add_library(urban_io ${IO_HEADERS} ${IO_SRC} ${Shadow_HEADERS} ${Projection_HEADER} ${Line_HEADER} ${Adjacency_HEADER} ${Off_HEADER} ${Scene_HEADERS}) +add_library(urban_io ${IO_SRC}) target_link_libraries(urban_io urban_shadow urban_projection ${LIBS}) # urban -set(urban_HEADER "${3DSceneModel_SOURCE_DIR}/src/libs/urban.h") -add_library(urban SHARED ${urban_HEADER}) +add_library(urban SHARED) link_directories(urban ${LIBS_DIRS}) target_link_libraries(urban urban_shadow urban_io urban_scene urban_projection urban_algorithms ${LIBS}) diff --git a/src/libs/urban.h b/src/libs/urban.h index 35da202..74f4e85 100644 --- a/src/libs/urban.h +++ b/src/libs/urban.h @@ -1,5 +1,7 @@ #pragma once +#include "config.h" + #include "shadow/mesh.h" #include "io/io_off.h" diff --git a/src/samples/CMakeLists.txt b/src/samples/CMakeLists.txt index ff055f9..213c58d 100644 --- a/src/samples/CMakeLists.txt +++ b/src/samples/CMakeLists.txt @@ -1,9 +1,9 @@ # Santa set(SANTA_SRC "${3DSceneModel_SOURCE_DIR}/src/samples/hello_santa.cpp") -add_executable(hello_santa ${SANTA_SRC} ${urban_HEADER}) +add_executable(hello_santa ${SANTA_SRC}) target_link_libraries(hello_santa urban) # Project Santa set(Proj_XY_SANTA_SRC "${3DSceneModel_SOURCE_DIR}/src/samples/project_santa_xy.cpp") -add_executable(project_santa_xy ${Proj_XY_SANTA_SRC} ${urban_HEADER}) +add_executable(project_santa_xy ${Proj_XY_SANTA_SRC}) target_link_libraries(project_santa_xy urban) diff --git a/src/samples/hello_santa.cpp b/src/samples/hello_santa.cpp index 328cb01..a75cb98 100644 --- a/src/samples/hello_santa.cpp +++ b/src/samples/hello_santa.cpp @@ -1,4 +1,4 @@ -#include "../libs/urban.h" +#include #ifdef CGAL_USE_GEOMVIEW #include diff --git a/src/samples/project_santa_xy.cpp b/src/samples/project_santa_xy.cpp index 5912c64..0dccd98 100644 --- a/src/samples/project_santa_xy.cpp +++ b/src/samples/project_santa_xy.cpp @@ -1,4 +1,4 @@ -#include "../libs/urban.h" +#include #include diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index 7f11f58..6a9d849 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -1,4 +1,4 @@ file(GLOB_RECURSE TEST_SRC "${3DSceneModel_SOURCE_DIR}/src/tests/*.cpp") -add_executable(tests ${TEST_SRC} ${urban_HEADER}) +add_executable(tests ${TEST_SRC}) target_link_libraries(tests Catch urban) diff --git a/src/tests/test_io_3ds.cpp b/src/tests/test_io_3ds.cpp index 7a723b3..e2ab85a 100644 --- a/src/tests/test_io_3ds.cpp +++ b/src/tests/test_io_3ds.cpp @@ -1,4 +1,4 @@ -#include "../libs/io/io_3ds.h" +#include #include #include diff --git a/src/tests/test_io_gdal.cpp b/src/tests/test_io_gdal.cpp index a49dd26..a969743 100644 --- a/src/tests/test_io_gdal.cpp +++ b/src/tests/test_io_gdal.cpp @@ -1,6 +1,6 @@ -#include "../libs/io/io_gdal.h" -#include "../libs/algorithms/algorithms.h" -#include "../libs/scene/brick/brick.h" +#include +#include +#include #include #include diff --git a/src/tests/test_io_off.cpp b/src/tests/test_io_off.cpp index c001602..6b0b261 100644 --- a/src/tests/test_io_off.cpp +++ b/src/tests/test_io_off.cpp @@ -1,5 +1,5 @@ -#include "../libs/io/io_off.h" -#include "../libs/io/Line/line.h" +#include +#include #include #include diff --git a/src/tests/test_projection_algorithms.cpp b/src/tests/test_projection_algorithms.cpp index 08ad406..228197e 100644 --- a/src/tests/test_projection_algorithms.cpp +++ b/src/tests/test_projection_algorithms.cpp @@ -1,5 +1,5 @@ -#include "../libs/algorithms/algorithms.h" -#include "../libs/scene/brick/brick.h" +#include +#include #include diff --git a/src/tests/test_projection_brick.cpp b/src/tests/test_projection_brick.cpp index ce05140..a2562fa 100644 --- a/src/tests/test_projection_brick.cpp +++ b/src/tests/test_projection_brick.cpp @@ -1,4 +1,4 @@ -#include "../libs/projection/Brick/brick_projection.h" +#include #include diff --git a/src/tests/test_projection_face.cpp b/src/tests/test_projection_face.cpp index d0bfacb..5027b4f 100644 --- a/src/tests/test_projection_face.cpp +++ b/src/tests/test_projection_face.cpp @@ -1,4 +1,4 @@ -#include "../libs/projection/Face/face_projection.h" +#include #include diff --git a/src/tests/test_shadow_face.cpp b/src/tests/test_shadow_face.cpp index 4870bef..393ad29 100644 --- a/src/tests/test_shadow_face.cpp +++ b/src/tests/test_shadow_face.cpp @@ -1,4 +1,4 @@ -#include "../libs/shadow/Face/face.h" +#include #include diff --git a/src/tests/test_shadow_geometry.cpp b/src/tests/test_shadow_geometry.cpp index 39ff51a..147049a 100644 --- a/src/tests/test_shadow_geometry.cpp +++ b/src/tests/test_shadow_geometry.cpp @@ -1,6 +1,6 @@ -#include "../libs/shadow/Point/point.h" -#include "../libs/shadow/Vector/vector.h" -#include "../libs/shadow/Bbox/bbox.h" +#include +#include +#include #include #include diff --git a/src/tests/test_shadow_mesh.cpp b/src/tests/test_shadow_mesh.cpp index cc798d9..fcd5fa3 100644 --- a/src/tests/test_shadow_mesh.cpp +++ b/src/tests/test_shadow_mesh.cpp @@ -1,7 +1,5 @@ -#include "../libs/shadow/mesh.h" -#include "../libs/algorithms/shadow/shadow_algorithms.h" - -#include "../libs/urban.h" +#include +#include #ifdef CGAL_USE_GEOMVIEW #include diff --git a/src/tests/test_urban_object.cpp b/src/tests/test_urban_object.cpp index a5f5ac4..8699a62 100644 --- a/src/tests/test_urban_object.cpp +++ b/src/tests/test_urban_object.cpp @@ -1,5 +1,5 @@ -#include "../libs/scene/brick/brick.h" -#include "../libs/io/io_off.h" +#include +#include #include