mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-06 11:29:55 -05:00
Move timelineview application into app folder
This commit is contained in:
+1
-1
@@ -22,7 +22,7 @@
|
||||
# OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #
|
||||
#########################################################################################
|
||||
|
||||
cmake_minimum_required (VERSION 3.0)
|
||||
cmake_minimum_required (VERSION 3.0 FATAL_ERROR)
|
||||
|
||||
project (OpenSpace)
|
||||
message(STATUS "Generating OpenSpace project")
|
||||
|
||||
@@ -22,25 +22,15 @@
|
||||
# OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #
|
||||
#########################################################################################
|
||||
|
||||
add_executable(OpenSpace ${OPENSPACE_APPS_DIR}/OpenSpace/main.cpp)
|
||||
target_include_directories(OpenSpace PUBLIC ${OPENSPACE_BASE_DIR}/include)
|
||||
target_link_libraries(OpenSpace libOpenSpace)
|
||||
set(APPLICATION_NAME OpenSpace)
|
||||
set(APPLICATION_LINK_TO_OPENSPACE ON)
|
||||
|
||||
add_executable(${APPLICATION_NAME} ${OPENSPACE_APPS_DIR}/OpenSpace/main.cpp)
|
||||
target_include_directories(${APPLICATION_NAME} PUBLIC ${OPENSPACE_BASE_DIR}/include)
|
||||
target_link_libraries(${APPLICATION_NAME} libOpenSpace)
|
||||
|
||||
if (MSVC)
|
||||
if (OPENSPACE_WARNINGS_AS_ERRORS)
|
||||
target_compile_options(OpenSpace PUBLIC "/WX")
|
||||
endif ()
|
||||
|
||||
set_target_properties(OpenSpace PROPERTIES LINK_FLAGS
|
||||
set_target_properties(${APPLICATION_NAME} PROPERTIES LINK_FLAGS
|
||||
"/NODEFAULTLIB:LIBCMTD.lib /NODEFAULTLIB:LIBCMT.lib"
|
||||
)
|
||||
elseif (APPLE)
|
||||
if (OPENSPACE_WARNINGS_AS_ERRORS)
|
||||
target_compile_options(OpenSpace PUBLIC "-Werror")
|
||||
endif ()
|
||||
elseif (UNIX)
|
||||
if (OPENSPACE_WARNINGS_AS_ERRORS)
|
||||
target_compile_options(OpenSpace PUBLIC "-Werror")
|
||||
endif ()
|
||||
target_compile_options(OpenSpace PUBLIC "-ggdb" "-Wall" "-Wno-long-long" "-pedantic" "-Wextra")
|
||||
endif ()
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
#########################################################################################
|
||||
# #
|
||||
# OpenSpace #
|
||||
# #
|
||||
# Copyright (c) 2014-2015 #
|
||||
# #
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy of this #
|
||||
# software and associated documentation files (the "Software"), to deal in the Software #
|
||||
# without restriction, including without limitation the rights to use, copy, modify, #
|
||||
# merge, publish, distribute, sublicense, and/or sell copies of the Software, and to #
|
||||
# permit persons to whom the Software is furnished to do so, subject to the following #
|
||||
# conditions: #
|
||||
# #
|
||||
# The above copyright notice and this permission notice shall be included in all copies #
|
||||
# or substantial portions of the Software. #
|
||||
# #
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, #
|
||||
# INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A #
|
||||
# PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT #
|
||||
# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF #
|
||||
# CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE #
|
||||
# OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #
|
||||
#########################################################################################
|
||||
|
||||
set(APPLICATION_NAME TimelineView)
|
||||
set(APPLICATION_LINK_TO_OPENSPACE OFF)
|
||||
|
||||
set(SOURCE_FILES
|
||||
${OPENSPACE_APPS_DIR}/TimelineView/main.cpp
|
||||
${OPENSPACE_APPS_DIR}/TimelineView/mainwindow.cpp
|
||||
${OPENSPACE_APPS_DIR}/TimelineView/configurationwidget.cpp
|
||||
${OPENSPACE_APPS_DIR}/TimelineView/informationwidget.cpp
|
||||
${OPENSPACE_APPS_DIR}/TimelineView/controlwidget.cpp
|
||||
${OPENSPACE_APPS_DIR}/TimelineView/timelinewidget.cpp
|
||||
)
|
||||
|
||||
set(HEADER_FILES
|
||||
${OPENSPACE_APPS_DIR}/TimelineView/mainwindow.h
|
||||
${OPENSPACE_APPS_DIR}/TimelineView/configurationwidget.h
|
||||
${OPENSPACE_APPS_DIR}/TimelineView/informationwidget.h
|
||||
${OPENSPACE_APPS_DIR}/TimelineView/controlwidget.h
|
||||
${OPENSPACE_APPS_DIR}/TimelineView/timelinewidget.h
|
||||
)
|
||||
|
||||
find_package(Qt5Widgets)
|
||||
find_package(Qt5Network)
|
||||
|
||||
qt5_wrap_cpp(MOC_FILES ${HEADER_FILES})
|
||||
|
||||
add_executable(${APPLICATION_NAME} MACOSX_BUNDLE ${SOURCE_FILES} ${HEADER_FILES} ${MOC_FILES})
|
||||
|
||||
target_link_libraries(${APPLICATION_NAME}
|
||||
Qt5::Widgets
|
||||
Qt5::Network
|
||||
)
|
||||
|
||||
if (APPLE)
|
||||
INSTALL(CODE "
|
||||
include(BundleUtilities)
|
||||
fixup_bundle(\"/Users/alex/Development/OpenSpace/bin/openspace/Debug/TimelineView.app/Contents/MacOS/TimelineView\" \"/Users/alex/Development/OpenSpace/bin/openspace/Debug/TimelineView.app/Contents/plugins/platforms/libqcocoa.dylib\" \"\")
|
||||
" COMPONENT Runtime)
|
||||
endif ()
|
||||
@@ -1,3 +0,0 @@
|
||||
cmake_minimum_required(VERSION 2.8.11)
|
||||
|
||||
add_subdirectory(timelineview)
|
||||
@@ -1,22 +0,0 @@
|
||||
cmake_minimum_required(VERSION 2.8.11)
|
||||
|
||||
project(TimelineView)
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
find_package(Qt5Widgets)
|
||||
find_package(Qt5Network)
|
||||
if (APPLE)
|
||||
add_executable(TimelineView MACOSX_BUNDLE main.cpp mainwindow.cpp configurationwidget.cpp informationwidget.cpp controlwidget.cpp timelinewidget.cpp)
|
||||
else (APPLE)
|
||||
add_executable(TimelineView main.cpp mainwindow.cpp configurationwidget.cpp informationwidget.cpp controlwidget.cpp timelinewidget.cpp)
|
||||
endif ()
|
||||
|
||||
target_link_libraries(TimelineView Qt5::Widgets Qt5::Network)
|
||||
|
||||
if (APPLE)
|
||||
INSTALL(CODE "
|
||||
include(BundleUtilities)
|
||||
fixup_bundle(\"/Users/alex/Development/OpenSpace/bin/openspace/Debug/TimelineView.app/Contents/MacOS/TimelineView\" \"/Users/alex/Development/OpenSpace/bin/openspace/Debug/TimelineView.app/Contents/plugins/platforms/libqcocoa.dylib\" \"\")
|
||||
" COMPONENT Runtime)
|
||||
endif ()
|
||||
@@ -168,17 +168,55 @@ endfunction ()
|
||||
|
||||
function (handle_applications)
|
||||
set(applications "")
|
||||
option(OPENSPACE_APPLICATION_OPENSPACE "Main OpenSpace Application" ON)
|
||||
if (OPENSPACE_APPLICATION_OPENSPACE)
|
||||
include(${OPENSPACE_APPS_DIR}/OpenSpace/CMakeLists.txt)
|
||||
list(APPEND applications "OpenSpace")
|
||||
endif ()
|
||||
set(applications_link_to_openspace "")
|
||||
|
||||
file(GLOB appDirs RELATIVE ${OPENSPACE_APPS_DIR} ${OPENSPACE_APPS_DIR}/*)
|
||||
list(REMOVE_ITEM appDirs ".DS_Store") # Removing the .DS_Store present on Mac
|
||||
|
||||
set(DEFAULT_APPLICATIONS
|
||||
"OpenSpace"
|
||||
)
|
||||
mark_as_advanced(DEFAULT_APPLICATIONS)
|
||||
|
||||
foreach (app ${appDirs})
|
||||
string(TOUPPER ${app} upper_app)
|
||||
list (FIND DEFAULT_APPLICATIONS "${app}" _index)
|
||||
if (${_index} GREATER -1)
|
||||
# App is a default application
|
||||
option(OPENSPACE_APPLICATION_${upper_app} "${app} Application" ON)
|
||||
else ()
|
||||
option(OPENSPACE_APPLICATION_${upper_app} "${app} Application" OFF)
|
||||
endif()
|
||||
if (OPENSPACE_APPLICATION_${upper_app})
|
||||
unset(APPLICATION_NAME)
|
||||
unset(APPLICATION_LINK_TO_OPENSPACE)
|
||||
include(${OPENSPACE_APPS_DIR}/${app}/CMakeLists.txt)
|
||||
set_compile_settings(${APPLICATION_NAME})
|
||||
list(APPEND applications ${APPLICATION_NAME})
|
||||
list(APPEND applications_link_to_openspace ${APPLICATION_LINK_TO_OPENSPACE})
|
||||
unset(APPLICATION_NAME)
|
||||
unset(APPLICATION_LINK_TO_OPENSPACE)
|
||||
endif ()
|
||||
endforeach ()
|
||||
|
||||
|
||||
# option(OPENSPACE_APPLICATION_OPENSPACE "Main OpenSpace Application" ON)
|
||||
# if (OPENSPACE_APPLICATION_OPENSPACE)
|
||||
# include(${OPENSPACE_APPS_DIR}/OpenSpace/CMakeLists.txt)
|
||||
# list(APPEND applications "OpenSpace")
|
||||
# endif ()
|
||||
set(OPENSPACE_APPLICATIONS ${applications} PARENT_SCOPE)
|
||||
set(OPENSPACE_APPLICATIONS_LINK_REQUEST ${applications_link_to_openspace} PARENT_SCOPE)
|
||||
|
||||
message(STATUS "Applications:")
|
||||
foreach (app ${applications})
|
||||
message(STATUS "\t${app}")
|
||||
endforeach ()
|
||||
list(LENGTH applications len1)
|
||||
math(EXPR len2 "${len1} - 1")
|
||||
|
||||
foreach(val RANGE ${len2})
|
||||
list(GET applications ${val} val1)
|
||||
list(GET applications_link_to_openspace ${val} val2)
|
||||
message(STATUS "\t${val1} (Link: ${val2})")
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
|
||||
@@ -316,9 +354,18 @@ function (handle_internal_modules)
|
||||
if (${optionName})
|
||||
create_library_name(${module} libraryName)
|
||||
add_subdirectory(${OPENSPACE_MODULE_DIR}/${module})
|
||||
foreach (app ${OPENSPACE_APPLICATIONS})
|
||||
target_link_libraries(${app} ${libraryName})
|
||||
endforeach ()
|
||||
|
||||
list(LENGTH OPENSPACE_APPLICATIONS len1)
|
||||
math(EXPR len2 "${len1} - 1")
|
||||
|
||||
foreach(val RANGE ${len2})
|
||||
list(GET OPENSPACE_APPLICATIONS ${val} val1)
|
||||
list(GET OPENSPACE_APPLICATIONS_LINK_REQUEST ${val} val2)
|
||||
if (${val2})
|
||||
target_link_libraries(${app} ${libraryName})
|
||||
endif ()
|
||||
endforeach()
|
||||
|
||||
target_link_libraries(libOpenSpace ${libraryName})
|
||||
create_define_name(${module} defineName)
|
||||
target_compile_definitions(libOpenSpace PUBLIC "${defineName}")
|
||||
|
||||
Reference in New Issue
Block a user