From f13c241263763d18cc067c22ae6cc964ec2f7baf Mon Sep 17 00:00:00 2001 From: Erlend Andersen Date: Wed, 25 Sep 2019 22:16:53 +0200 Subject: [PATCH] cleaning up code and cmake files --- src/opendxmc/CMakeLists.txt | 23 +++++++++++++--- src/opendxmc/external/CMakeLists.txt | 41 ---------------------------- src/opendxmc/src/app.cpp | 2 -- 3 files changed, 19 insertions(+), 47 deletions(-) delete mode 100644 src/opendxmc/external/CMakeLists.txt diff --git a/src/opendxmc/CMakeLists.txt b/src/opendxmc/CMakeLists.txt index 971a6f3..26d8fe6 100644 --- a/src/opendxmc/CMakeLists.txt +++ b/src/opendxmc/CMakeLists.txt @@ -85,8 +85,23 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}") #spdlog -add_subdirectory(external) -file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/logs") +#include(ExternalProject) +#ExternalProject_Add(spdlog +# GIT_REPOSITORY https://github.com/gabime/spdlog.git +# TIMEOUT 5 +# CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} +# PREFIX "${CMAKE_CURRENT_BINARY_DIR}" +# CONFIGURE_COMMAND "" # Disable configure step +# BUILD_COMMAND "" # Disable build step +# INSTALL_COMMAND "" # Disable install step +# UPDATE_COMMAND "" # Disable update step: clones the project only once +#) +#ExternalProject_Get_Property(spdlog source_dir) +#SET(spdlog_DIR ${source_dir}) +#set(spdlog_INCLUDE_DIRS ${SOURCE_DIR}/include) +#include_directories(${spdlog_INCLUDE_DIRS}) +#message(STATUS "spdlog source is located at: ${source_dir}") +#file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/logs") # Define an executable (WIN32 argument to prevent console window on windows) add_executable(OpenDXMC WIN32 @@ -132,8 +147,8 @@ add_executable(OpenDXMC WIN32 src/opendxmcconfig.h ) -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/opendxmc") +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/opendxmc") # Define the libraries this project depends upon target_link_libraries(OpenDXMC @@ -143,7 +158,7 @@ target_link_libraries(OpenDXMC PRIVATE Qt5::Core PRIVATE Qt5::Gui PRIVATE Qt5::Charts - PRIVATE spdlog::spdlog_header_only +# PRIVATE spdlog::spdlog_header_only ## adding spdlog later ) # Adding vtk modules (replaces include(${VTK_USE_FILE}) since vtk 8.90) diff --git a/src/opendxmc/external/CMakeLists.txt b/src/opendxmc/external/CMakeLists.txt deleted file mode 100644 index d6f9507..0000000 --- a/src/opendxmc/external/CMakeLists.txt +++ /dev/null @@ -1,41 +0,0 @@ - - -include(ExternalProject) - ExternalProject_Add(spdlog - GIT_REPOSITORY https://github.com/gabime/spdlog.git - TIMEOUT 5 - CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} - PREFIX "${CMAKE_CURRENT_BINARY_DIR}" - CONFIGURE_COMMAND "" # Disable configure step - BUILD_COMMAND "" # Disable build step - INSTALL_COMMAND "" # Disable install step - UPDATE_COMMAND "" # Disable update step: clones the project only once -) -#ExternalProject_Get_Property(spdlog_external source_dir) -#set(spdlog_INCLUDE_DIR ${source_dir}/include) -## add the imported library which is -## an INTERFACE (ie header only) -## IMPORTED (ie third party - no compilation necessary) -## GLOBAL (you can reference it from everywhere -## even if the target is not in the same scope -## which is the case for project1 and project2 because -## the spdlog target is not in their parent folder) - - -ExternalProject_Get_Property(spdlog source_dir) -SET(spdlog_DIR ${source_dir}) -add_subdirectory(${source_dir}) -find_package(spdlog) - - -#include_directories(${source_dir}/include ) -#find_package(spdlog PATHS ${source_dir}) - -#add_library(spdlog INTERFACE IMPORTED GLOBAL) -#add_dependencies(spdlog spdlog_external) -#ExternalProject_Get_Property(spdlog_external source_dir) -message(STATUS "spdlog source is located at: ${source_dir}") -## set the include directory which is to be associated with this target -## and which will be inherited by all targets which use -## target_link_libraries( spdlog) -#target_include_directories(spdlog INTERFACE ${source_dir}) \ No newline at end of file diff --git a/src/opendxmc/src/app.cpp b/src/opendxmc/src/app.cpp index b7df255..6b6bdc1 100644 --- a/src/opendxmc/src/app.cpp +++ b/src/opendxmc/src/app.cpp @@ -27,8 +27,6 @@ Copyright 2019 Erlend Andersen #include -#include "include/spdlog/spdlog.h" - int main (int argc, char *argv[]) {