Skip to content

Commit

Permalink
Refactored CMake project structure
Browse files Browse the repository at this point in the history
  • Loading branch information
pedroperrusi committed Feb 7, 2019
1 parent 2ec41ad commit a0a2290
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 9 deletions.
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,8 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# add cnpy library subdirectory
add_subdirectory(extern/cnpy)

# add library source code subdirectory
add_subdirectory(src)

# add project source code subdirectory
add_subdirectory(src)
add_subdirectory(app)
14 changes: 14 additions & 0 deletions app/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
add_executable(
bunny_mesh_normals
main.cc
)

find_package (Eigen3 3.3 REQUIRED)

target_include_directories(
bunny_mesh_normals
PUBLIC
${CMAKE_HOME_DIRECTORY}/include
)

target_link_libraries(bunny_mesh_normals bunny_mesh)
4 changes: 2 additions & 2 deletions src/main.cc → app/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
* @copyright Copyright (c) 2019 Pedro Henrique S. Perrusi
*
*/
#include "data_io.h"
#include "Mesh.h"
#include "bunny_mesh/data_io.h"
#include "bunny_mesh/Mesh.h"

#include <Eigen/Dense>
#include <iostream>
Expand Down
File renamed without changes.
File renamed without changes.
22 changes: 17 additions & 5 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
add_executable(
bunny_mesh_normals
main.cc
Mesh.cc
add_library(bunny_mesh "")

target_sources(
bunny_mesh
PRIVATE
Mesh.cc
PUBLIC
${CMAKE_HOME_DIRECTORY}/include/bunny_mesh/Mesh.h
${CMAKE_HOME_DIRECTORY}/include/bunny_mesh/data_io.h
)

target_include_directories(
bunny_mesh
PUBLIC
${CMAKE_HOME_DIRECTORY}/include
)


find_package (Eigen3 3.3 REQUIRED)

target_link_libraries(bunny_mesh_normals cnpy Eigen3::Eigen)
target_link_libraries(bunny_mesh cnpy Eigen3::Eigen)
2 changes: 1 addition & 1 deletion src/Mesh.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* @copyright Copyright (c) 2019 Pedro Henrique S. Perrusi
*
*/
#include "Mesh.h"
#include "bunny_mesh/Mesh.h"

#include <iostream>

Expand Down

0 comments on commit a0a2290

Please sign in to comment.