Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cmake update for appdata branch #3803

Merged
merged 6 commits into from
Mar 25, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
123 changes: 46 additions & 77 deletions isis/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ cmake_minimum_required(VERSION 3.10)
# Point cmake to our other CMake files.
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")

# set(CMAKE_FIND_FRAMEWORK LAST)
set(CMAKE_FRAMEWORK_PATH /System/Library/Frameworks/)

set(CMAKE_FIND_FRAMEWORK LAST)

include(AddIsisModule)
Expand Down Expand Up @@ -66,7 +64,7 @@ set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)

# Specify user options that can be passed in with the initial CMake command.
option(isisData "Directory containing IsisData" OFF )
option(isisTestData "Directory containing IsisTestData" OFF )
option(isisTestData "Directory containing IsisTestData" OFF )
option(testOutputDir "Directory to store app test output folders" OFF )
option(buildCore "Build the core ISIS modules" ON )
option(buildMissions "Build the mission specific modules" ON )
Expand Down Expand Up @@ -448,45 +446,41 @@ install(FILES "${CMAKE_BINARY_DIR}/qt.conf" DESTINATION ${CMAKE_INSTALL_PREFIX}/
# Create the inc directory
execute_process(COMMAND mkdir -p ${CMAKE_BINARY_DIR}/inc)

# Create the appdata directory and translations directory
execute_process(COMMAND mkdir -p ${CMAKE_BINARY_DIR}/appdata/translations)
execute_process(COMMAND mkdir -p ${CMAKE_BINARY_DIR}/appdata/templates/apollo)
execute_process(COMMAND mkdir -p ${CMAKE_BINARY_DIR}/appdata/templates/autoreg) # *.def
execute_process(COMMAND mkdir -p ${CMAKE_BINARY_DIR}/appdata/templates/noproj) # *.pvl
execute_process(COMMAND mkdir -p ${CMAKE_BINARY_DIR}/appdata/templates/autoseed) # *.def, *.pvl
execute_process(COMMAND mkdir -p ${CMAKE_BINARY_DIR}/appdata/templates/cnetref) # *.def, *.def.example
execute_process(COMMAND mkdir -p ${CMAKE_BINARY_DIR}/appdata/templates/cnetstats) # *.def, *.def.example
execute_process(COMMAND mkdir -p ${CMAKE_BINARY_DIR}/appdata/templates/cnet_validmeasure) # *.def, *.def.example
execute_process(COMMAND mkdir -p ${CMAKE_BINARY_DIR}/appdata/templates/controlnetworks)
execute_process(COMMAND mkdir -p ${CMAKE_BINARY_DIR}/appdata/templates/findfeatures) # *.lis
execute_process(COMMAND mkdir -p ${CMAKE_BINARY_DIR}/appdata/templates/fullcnetdiff) # *.lis
execute_process(COMMAND mkdir -p ${CMAKE_BINARY_DIR}/appdata/templates/jigsaw) # *.pvl
execute_process(COMMAND mkdir -p ${CMAKE_BINARY_DIR}/appdata/templates/kernels) # *.txt
execute_process(COMMAND mkdir -p ${CMAKE_BINARY_DIR}/appdata/templates/photometry) # *.pvl
execute_process(COMMAND mkdir -p ${CMAKE_BINARY_DIR}/appdata/templates/hidtmgen) # *.pvl

execute_process(COMMAND mkdir -p ${CMAKE_BINARY_DIR}/appdata/templates/maps)
execute_process(COMMAND mkdir -p ${CMAKE_BINARY_DIR}/appdata/images/icons)
execute_process(COMMAND mkdir -p ${CMAKE_BINARY_DIR}/appdata/images/targets)
execute_process(COMMAND mkdir -p ${CMAKE_BINARY_DIR}/appdata/templates/labels)
#execute_process(COMMAND mkdir -p ${CMAKE_BINARY_DIR}/appdata/autoreg)

# Create an xml folder in the source directory that we will need later
set(sourceXmlFolder ${CMAKE_BINARY_DIR}/bin/xml)
execute_process(COMMAND mkdir -p ${CMAKE_BINARY_DIR}/bin/xml)

# Create the version file
configure_file(${CMAKE_SOURCE_DIR}/cmake/version.in ${CMAKE_BINARY_DIR}/version)

# Set up install of the templates folder.
install(DIRECTORY ${CMAKE_SOURCE_DIR}/templates DESTINATION .)

# Set up install of the make folder.
install(DIRECTORY ${CMAKE_SOURCE_DIR}/make DESTINATION ${CMAKE_INSTALL_PREFIX})

# Set up install of appdata folder
install(DIRECTORY ${CMAKE_BINARY_DIR}/appdata DESTINATION ${CMAKE_INSTALL_PREFIX})

# Create the appdata directory with translations directory, images directory, templates directories
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/appdata/translations
${CMAKE_BINARY_DIR}/appdata/templates/apollo
${CMAKE_BINARY_DIR}/appdata/templates/autoseed
${CMAKE_BINARY_DIR}/appdata/templates/autoreg
${CMAKE_BINARY_DIR}/appdata/templates/noproj
${CMAKE_BINARY_DIR}/appdata/templates/cnetref
${CMAKE_BINARY_DIR}/appdata/templates/cnetstats
${CMAKE_BINARY_DIR}/appdata/templates/cnet_validmeasure
${CMAKE_BINARY_DIR}/appdata/templates/controlnetworks
${CMAKE_BINARY_DIR}/appdata/templates/hidtmgen
${CMAKE_BINARY_DIR}/appdata/templates/findfeatures
${CMAKE_BINARY_DIR}/appdata/templates/fullcnetdiff
${CMAKE_BINARY_DIR}/appdata/templates/jigsaw
${CMAKE_BINARY_DIR}/appdata/templates/kernels
${CMAKE_BINARY_DIR}/appdata/templates/labels
${CMAKE_BINARY_DIR}/appdata/templates/maps
${CMAKE_BINARY_DIR}/appdata/templates/photometry
${CMAKE_BINARY_DIR}/appdata/images/icons
${CMAKE_BINARY_DIR}/appdata/images/targets)


# Have CMake process all of the source code and tests.
add_subdirectory(src objects)

Expand Down Expand Up @@ -516,7 +510,7 @@ add_custom_target(incs ALL COMMAND ${CMAKE_COMMAND} -E copy_if_different
add_dependencies(isis3 incs)

# Add custom build target to copy modified translation files to the build/appdata/translations
# directory. (As above - may need to be updated)
## directory.
add_custom_target(appdata ALL COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_SOURCE_DIR}/appdata/serialnumbers/*.trn ${CMAKE_SOURCE_DIR}/appdata/translations/*.trn
${CMAKE_SOURCE_DIR}/appdata/translations/*.typ ${CMAKE_SOURCE_DIR}/src/*/apps/*/*.typ
Expand All @@ -526,103 +520,78 @@ add_custom_target(appdata ALL COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_BINARY_DIR}/appdata/translations)
add_dependencies(isis3 appdata)

# Add custom build target to copy modified template files to the build/appdata/templates
# directory. (As above - may need to be updated)
add_custom_target(templates ALL COMMAND ${CMAKE_COMMAND} -E copy_if_different
# Add custom build targets to copy modified template files to build/appdata/templates
add_custom_target(apollotemplate ALL COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_SOURCE_DIR}/src/*/templates/*.def ${CMAKE_BINARY_DIR}/appdata/templates/apollo/)
add_dependencies(isis3 templates)
add_dependencies(isis3 apollotemplate)

# Add custom build target to copy modified template files to the build/appdata/templates
# directory. (As above - may need to be updated)
add_custom_target(autoreg ALL COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_SOURCE_DIR}/appdata/templates/autoreg/*.def ${CMAKE_BINARY_DIR}/appdata/templates/autoreg/)
${CMAKE_SOURCE_DIR}/appdata/templates/autoreg/* ${CMAKE_BINARY_DIR}/appdata/templates/autoreg/)
add_dependencies(isis3 autoreg)

# Add custom build target to copy modified template files to the build/appdata/templates
# directory. (As above - may need to be updated)
add_custom_target(hidtmgen ALL COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_SOURCE_DIR}/appdata/templates/hidtmgen/*.pvl ${CMAKE_BINARY_DIR}/appdata/templates/hidtmgen/)
add_dependencies(isis3 hidtmgen)

add_custom_target(autoseed ALL COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_SOURCE_DIR}/appdata/templates/autoseed/*.def ${CMAKE_SOURCE_DIR}/appdata/templates/autoseed/*.pvl
${CMAKE_BINARY_DIR}/appdata/templates/autoseed/)
add_dependencies(isis3 autoseed)
${CMAKE_SOURCE_DIR}/appdata/templates/autoseed/* ${CMAKE_BINARY_DIR}/appdata/templates/autoseed/)

add_custom_target(noproj ALL COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_SOURCE_DIR}/appdata/templates/noproj/*.pvl
${CMAKE_BINARY_DIR}/appdata/templates/noproj/)
${CMAKE_SOURCE_DIR}/appdata/templates/noproj/* ${CMAKE_BINARY_DIR}/appdata/templates/noproj/)
add_dependencies(isis3 noproj)

add_custom_target(cnetref ALL COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_SOURCE_DIR}/appdata/templates/cnetref/*.def ${CMAKE_SOURCE_DIR}/appdata/templates/cnetref/*.def.example
${CMAKE_BINARY_DIR}/appdata/templates/cnetref/)
${CMAKE_SOURCE_DIR}/appdata/templates/cnetref/* ${CMAKE_BINARY_DIR}/appdata/templates/cnetref/)
add_dependencies(isis3 cnetref)

add_custom_target(cnetstats ALL COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_SOURCE_DIR}/appdata/templates/cnetstats/*.def ${CMAKE_SOURCE_DIR}/appdata/templates/cnetstats/*.def.example
${CMAKE_BINARY_DIR}/appdata/templates/cnetstats/)
${CMAKE_SOURCE_DIR}/appdata/templates/cnetstats/* ${CMAKE_BINARY_DIR}/appdata/templates/cnetstats/)
add_dependencies(isis3 cnetstats)

add_custom_target(cnetvalid ALL COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_SOURCE_DIR}/appdata/templates/cnet_validmeasure/*.def ${CMAKE_SOURCE_DIR}/appdata/templates/cnet_validmeasure/*.def.example
${CMAKE_BINARY_DIR}/appdata/templates/cnet_validmeasure/)
${CMAKE_SOURCE_DIR}/appdata/templates/cnet_validmeasure/* ${CMAKE_BINARY_DIR}/appdata/templates/cnet_validmeasure/)
add_dependencies(isis3 cnetvalid)

add_custom_target(controlnetworks ALL COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_SOURCE_DIR}/appdata/templates/controlnetworks/*.template
${CMAKE_BINARY_DIR}/appdata/templates/controlnetworks/)
${CMAKE_SOURCE_DIR}/appdata/templates/controlnetworks/* ${CMAKE_BINARY_DIR}/appdata/templates/controlnetworks/)
add_dependencies(isis3 controlnetworks)

add_custom_target(findfeatures ALL COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_SOURCE_DIR}/appdata/templates/findfeatures/*.lis
${CMAKE_BINARY_DIR}/appdata/templates/findfeatures/)
${CMAKE_SOURCE_DIR}/appdata/templates/findfeatures/* ${CMAKE_BINARY_DIR}/appdata/templates/findfeatures/)
add_dependencies(isis3 findfeatures)

add_custom_target(fullcnetdiff ALL COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_SOURCE_DIR}/appdata/templates/fullcnetdiff/*.def
${CMAKE_BINARY_DIR}/appdata/templates/fullcnetdiff/)
${CMAKE_SOURCE_DIR}/appdata/templates/fullcnetdiff/* ${CMAKE_BINARY_DIR}/appdata/templates/fullcnetdiff/)
add_dependencies(isis3 fullcnetdiff)

add_custom_target(jigsaw ALL COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_SOURCE_DIR}/appdata/templates/jigsaw/*.pvl
${CMAKE_BINARY_DIR}/appdata/templates/jigsaw/)
${CMAKE_SOURCE_DIR}/appdata/templates/jigsaw/* ${CMAKE_BINARY_DIR}/appdata/templates/jigsaw/)
add_dependencies(isis3 jigsaw)

add_custom_target(kernels ALL COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_SOURCE_DIR}/appdata/templates/kernels/*.txt
${CMAKE_BINARY_DIR}/appdata/templates/kernels/)
${CMAKE_SOURCE_DIR}/appdata/templates/kernels/* ${CMAKE_BINARY_DIR}/appdata/templates/kernels/)
add_dependencies(isis3 kernels)

add_custom_target(photometry ALL COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_SOURCE_DIR}/appdata/templates/photometry/*.pvl
${CMAKE_BINARY_DIR}/appdata/templates/photometry/)
${CMAKE_SOURCE_DIR}/appdata/templates/photometry/* ${CMAKE_BINARY_DIR}/appdata/templates/photometry/)
add_dependencies(isis3 photometry)

# Either add these for maps, labels, autoreg, images or approach in a different way.

# Add custom build target to copy modified template files to the build/appdata/templates
# directory. (As above - may need to be updated)

add_custom_target(icons ALL COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_SOURCE_DIR}/appdata/images/icons/* ${CMAKE_BINARY_DIR}/appdata/images/icons)
${CMAKE_SOURCE_DIR}/appdata/images/icons/* ${CMAKE_SOURCE_DIR}/appdata/images/icons/licenses/*
${CMAKE_BINARY_DIR}/appdata/images/icons)
add_dependencies(isis3 icons)

add_custom_target(targets ALL COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_SOURCE_DIR}/appdata/images/targets/* ${CMAKE_BINARY_DIR}/appdata/images/targets)
add_dependencies(isis3 targets)

add_custom_target(maps ALL COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_SOURCE_DIR}/appdata/templates/maps/*.map ${CMAKE_BINARY_DIR}/appdata/templates/maps)
${CMAKE_SOURCE_DIR}/appdata/templates/maps/* ${CMAKE_BINARY_DIR}/appdata/templates/maps)
add_dependencies(isis3 maps)

add_custom_target(labels ALL COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_SOURCE_DIR}/appdata/templates/labels/*.pft ${CMAKE_BINARY_DIR}/appdata/templates/labels)
${CMAKE_SOURCE_DIR}/appdata/templates/labels/* ${CMAKE_BINARY_DIR}/appdata/templates/labels)
add_dependencies(isis3 labels)

#add_custom_target(autoreg ALL COMMAND ${CMAKE_COMMAND} -E copy_if_different
# ${CMAKE_SOURCE_DIR}/appdata/autoreg/*.def ${CMAKE_BINARY_DIR}/appdata/autoreg)
#add_dependencies(isis3 autoreg)
add_custom_target(hidtmgen ALL COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_SOURCE_DIR}/appdata/templates/hidtmgen/* ${CMAKE_BINARY_DIR}/appdata/templates/hidtmgen/)
add_dependencies(isis3 hidtmgen)

# Add a custom build target to clean out everything that gets added to the source
# directory during the build process.
Expand Down