Commit 24e628fb authored by VAN TOLL Wouter's avatar VAN TOLL Wouter
Browse files

- Changed the file hierarchy of all source code.

- Changed CMakeLists accordingly.
parent 826f073d
......@@ -24,17 +24,16 @@ set (CMAKE_CXX_STANDARD 14)
# === Include 3rd-party code
file( GLOB_RECURSE src_All src/*)
file( GLOB_RECURSE src_Engine src/Engine/* src/3rd-party/* )
file( GLOB_RECURSE src_Library src/Library/* )
file( GLOB_RECURSE src_ConsoleApplication src/ConsoleApplication/* )
file( GLOB_RECURSE src_QtDemo src/QtDemo/* )
include_directories( ./include )
include_directories(./3rd-party/tinyxml/ ./3rd-party/nanoflann/ ./3rd-party/ORCA/)
# --- ensure that certain directories are recognized in "#include <...>" lines
include_directories( ./src/ ./src/Engine/ )
#link_directories( ./lib/${CMAKE_BUILD_TYPE} )
file( GLOB_RECURSE source_files src/* include/*)
file( GLOB_RECURSE 3rd_party 3rd-party/*)
# === include the GUI application (which requires Qt)?
# === Include the GUI application (which requires Qt)?
option(UMANS_USE_GUI_APPLICATION "Include a GUI demo application (which relies on Qt)" OFF)
......@@ -57,21 +56,21 @@ endif()
# === Engine project: a static library that performs the simulation
add_library(Engine STATIC ${source_files} ${3rd_party})
add_library(Engine STATIC ${src_Engine})
# === Console application
if (WIN32)
add_executable(UMANS_ConsoleApplication_Windows ConsoleApplication/main.cpp)
add_executable(UMANS_ConsoleApplication_Windows ${src_ConsoleApplication})
target_link_libraries(UMANS_ConsoleApplication_Windows Engine)
add_executable(UMANS_ConsoleApplication_Linux ConsoleApplication/main.cpp)
add_executable(UMANS_ConsoleApplication_Linux ${src_ConsoleApplication})
target_link_libraries(UMANS_ConsoleApplication_Linux Engine)
# === Dynamic library (e.g. a DLL on Windows) to include into other programs
add_library(UMANS_Library SHARED Library/APIFunctions.h Library/APIFunctions.cpp)
add_library(UMANS_Library SHARED ${src_Library})
target_link_libraries(UMANS_Library Engine)
# === Qt demo project (if enabled)
......@@ -91,8 +90,7 @@ if (UMANS_USE_GUI_APPLICATION)
qt5_add_resources(UI_RESOURCES_RCC ${UI_RESOURCES})
# --- define the project itself
file( GLOB_RECURSE src_QtDemo QtDemo/*)
add_executable(UMANS_QtDemo QtDemo/main.cpp ${src_QtDemo} ${UI_RESOURCES_RCC})
add_executable(UMANS_QtDemo src/QtDemo/main.cpp ${src_QtDemo} ${UI_RESOURCES_RCC})
# --- the project depends on some libraries
target_link_libraries(UMANS_QtDemo Engine Qt5::Widgets opengl32.lib glu32.lib)
......@@ -108,12 +106,10 @@ endif (UMANS_USE_GUI_APPLICATION)
# === Clean up the project's directory structure
foreach(_source IN ITEMS ${source_files})
foreach(_source IN ITEMS ${src_All})
get_filename_component(_source_path "${_source}" PATH)
file(RELATIVE_PATH _source_path_rel "${CMAKE_CURRENT_SOURCE_DIR}" "${_source_path}")
string(REPLACE "include/" "" _source_path_rel ${_source_path_rel})
string(REPLACE "src/" "" _source_path_rel ${_source_path_rel})
file(RELATIVE_PATH _source_path_rel "${CMAKE_CURRENT_SOURCE_DIR}/src/" "${_source_path}")
string(REPLACE "/" "\\" _group_path "${_source_path_rel}")
source_group("${_group_path}" FILES "${_source}")
source_group("3rd-party" FILES ${3rd_party})
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment