Skip to content

Commit

Permalink
Libisis now installs based on version string (#3992)
Browse files Browse the repository at this point in the history
* libisis3 -> libisis

* added simple tests to meta

* test stuff

* reverty

* removed commented out code

* added tests

:

* addressed comments
  • Loading branch information
Kelvin Rodriguez authored Aug 28, 2020
1 parent b358dbd commit 3617001
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 53 deletions.
58 changes: 32 additions & 26 deletions isis/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ set(PACKAGE_NAME "USGS ISIS")

# Version number
set(VERSION "4.1.0")
string(REPLACE "." ";" VERSION_LIST ${VERSION})
list(GET VERSION_LIST 0 VERSION_MAJOR)
list(GET VERSION_LIST 1 VERSION_MINOR)

set(PACKAGE_VERSION ${VERSION})

# Full name and version number
Expand Down Expand Up @@ -68,7 +72,7 @@ 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 )
option(buildStaticCore "Build libisis3 static as well as dynamic" OFF )
option(buildStaticCore "Build libisis static as well as dynamic" OFF )
option(buildTests "Set up unit, application, and module tests." ON )
option(JP2KFLAG "Whether or not to build using JPEG2000 support" OFF )
option(pybindings "Turn on to build Python bindings" OFF )
Expand Down Expand Up @@ -389,8 +393,8 @@ if(pybindings)
file(GLOB SIP_GENERATED_SOURCE_FILES ${ISIS_SIP_CODE_DIR}/*.cpp)
add_library(isispy MODULE ${SIP_GENERATED_SOURCE_FILES})
target_link_libraries(isispy ${ALLLIBS})
target_link_libraries(isispy isis3)
set_target_properties(isispy PROPERTIES LINK_DEPENDS isis3 INSTALL_RPATH ${CMAKE_INSTALL_PREFIX})
target_link_libraries(isispy isis)
set_target_properties(isispy PROPERTIES LINK_DEPENDS isis INSTALL_RPATH ${CMAKE_INSTALL_PREFIX})
add_dependencies(isispy sipfiles)

install(TARGETS isispy DESTINATION ${PYINSTALL_DIR})
Expand All @@ -409,7 +413,9 @@ include_directories(SYSTEM ${ALLINCDIRS})
link_directories(${ALLLIBDIRS})

include_directories(${CMAKE_BINARY_DIR}/inc)
set(CORE_LIB_NAME isis3)
set(CORE_LIB_NAME isis)
message(STATUS "CORE LIB: ${CORE_LIB_NAME}")


# Specify relative library include paths which will be set up on
# the installed files.
Expand All @@ -421,9 +427,9 @@ endif()

# We will set up some links with these files at the end of the install process so
# make sure they are cleared at the start of the install process.
install(CODE "EXECUTE_PROCESS(COMMAND rm -f ${CMAKE_INSTALL_PREFIX}/lib/libisis3.6.0${SO})")
install(CODE "EXECUTE_PROCESS(COMMAND rm -f ${CMAKE_INSTALL_PREFIX}/lib/libisis3.6${SO})")
install(CODE "EXECUTE_PROCESS(COMMAND rm -f ${CMAKE_INSTALL_PREFIX}/lib/libisis3.${SO})")
install(CODE "EXECUTE_PROCESS(COMMAND rm -f ${CMAKE_INSTALL_PREFIX}/lib/libisis${VERSION}${SO})")
install(CODE "EXECUTE_PROCESS(COMMAND rm -f ${CMAKE_INSTALL_PREFIX}/lib/libisis${VERSION_MAJOR}.${VERSION_MINOR}${SO})")
install(CODE "EXECUTE_PROCESS(COMMAND rm -f ${CMAKE_INSTALL_PREFIX}/lib/libisis${VERSION_MAJOR}${SO})")
EXECUTE_PROCESS(COMMAND cp -f ${CMAKE_SOURCE_DIR}/TestPreferences ${CMAKE_BINARY_DIR}/)
install(CODE "EXECUTE_PROCESS(COMMAND cp -f ${CMAKE_SOURCE_DIR}/IsisPreferences ${CMAKE_INSTALL_PREFIX}/)")

Expand Down Expand Up @@ -507,7 +513,7 @@ add_custom_target(docs COMMAND ${CMAKE_COMMAND}
add_custom_target(incs ALL COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_SOURCE_DIR}/src/*/objs/*/*.h ${CMAKE_SOURCE_DIR}/src/*/objs/*/*.hpp
${CMAKE_SOURCE_DIR}/src/*/apps/*/*.h ${CMAKE_BINARY_DIR}/inc)
add_dependencies(isis3 incs)
add_dependencies(isis incs)

# Add custom build target to copy modified translation files to the build/appdata/translations
## directory.
Expand All @@ -518,80 +524,80 @@ add_custom_target(appdata ALL COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_SOURCE_DIR}/src/*/apps/*/*.def ${CMAKE_SOURCE_DIR}/appdata/translations/*.def
${CMAKE_SOURCE_DIR}/appdata/translations/*.pvl
${CMAKE_BINARY_DIR}/appdata/translations)
add_dependencies(isis3 appdata)
add_dependencies(isis appdata)

# 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 apollotemplate)
add_dependencies(isis apollotemplate)

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

add_custom_target(autoseed ALL COMMAND ${CMAKE_COMMAND} -E copy_if_different
${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/* ${CMAKE_BINARY_DIR}/appdata/templates/noproj/)
add_dependencies(isis3 noproj)
add_dependencies(isis noproj)

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

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

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

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

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

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

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

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

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

add_custom_target(icons ALL COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_SOURCE_DIR}/appdata/images/icons/* ${CMAKE_SOURCE_DIR}/appdata/images/icons/licenses/*
${CMAKE_BINARY_DIR}/appdata/images/icons)
add_dependencies(isis3 icons)
add_dependencies(isis 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_dependencies(isis targets)

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

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

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_dependencies(isis hidtmgen)

# Add a custom build target to clean out everything that gets added to the source
# directory during the build process.
Expand Down
8 changes: 4 additions & 4 deletions isis/cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
message("Setting up post-install behavior...")

# Set up format version numbers for the main shared library on install
install(CODE "EXECUTE_PROCESS(COMMAND cp -f ${CMAKE_BINARY_DIR}/lib/libisis3${SO} ${CMAKE_INSTALL_PREFIX}/lib/libisis3.6.0${SO})")
install(CODE "EXECUTE_PROCESS(COMMAND ln -sf libisis3.6.0${SO} ${CMAKE_INSTALL_PREFIX}/lib/libisis3.6${SO})")
install(CODE "EXECUTE_PROCESS(COMMAND ln -sf libisis3.6${SO} ${CMAKE_INSTALL_PREFIX}/lib/libisis3${SO})")
install(CODE "EXECUTE_PROCESS(COMMAND ln -sf libisis3${SO} ${CMAKE_INSTALL_PREFIX}/lib/libisis${SO})")
install(CODE "EXECUTE_PROCESS(COMMAND cp -f ${CMAKE_BINARY_DIR}/lib/libisis${SO} ${CMAKE_INSTALL_PREFIX}/lib/libisis${VERSION}${SO})")
install(CODE "EXECUTE_PROCESS(COMMAND ln -sf libisis${VERSION}${SO} ${CMAKE_INSTALL_PREFIX}/lib/libisis${VERSION_MAJOR}.${VERSION_MINOR}${SO})")
install(CODE "EXECUTE_PROCESS(COMMAND ln -sf libisis${VERSION_MAJOR}.${VERSION_MINOR}${SO} ${CMAKE_INSTALL_PREFIX}/lib/libisis${VERSION_MAJOR}${SO})")
install(CODE "EXECUTE_PROCESS(COMMAND ln -sf libisis${VERSION_MAJOR}${SO} ${CMAKE_INSTALL_PREFIX}/lib/libisis${SO})")

# On OSX, need to correct all the paths encoded in each of the distributed library files so
# that they properly find the distruted files using relative paths.
Expand Down
17 changes: 0 additions & 17 deletions isis/cmake/cmake_install.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,3 @@ endif()
if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
set(CMAKE_INSTALL_SO_NO_EXE "0")
endif()

if("${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified" OR NOT CMAKE_INSTALL_COMPONENT)
EXECUTE_PROCESS(COMMAND cp -f /scratch/isiscmake/isis/lib/libisis3.so /scratch/isiscmake/isis/build/lib/libisis3.5.0.so)
endif()

if("${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified" OR NOT CMAKE_INSTALL_COMPONENT)
EXECUTE_PROCESS(COMMAND ln -sf libisis3.5.0.so /scratch/isiscmake/isis/build/lib/libisis3.5.so)
endif()

if("${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified" OR NOT CMAKE_INSTALL_COMPONENT)
EXECUTE_PROCESS(COMMAND ln -sf libisis3.5.so /scratch/isiscmake/isis/build/lib/libisis3.so)
endif()

if("${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified" OR NOT CMAKE_INSTALL_COMPONENT)
EXECUTE_PROCESS(COMMAND ln -sf libisis3.so /scratch/isiscmake/isis/build/lib/libisis.so)
endif()

4 changes: 2 additions & 2 deletions isis/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.10)

add_dependencies(isis3 isis3)
add_dependencies(isis isis)

file(GLOB test_source "${CMAKE_SOURCE_DIR}/tests/*.cpp")

Expand Down Expand Up @@ -43,6 +43,6 @@ add_executable(runISISTests
IsisTestMain.cpp
${test_source})

target_link_libraries(runISISTests isis3 ${MISSION_LIBS} ${ALLLIBS} ${GTEST_LIBRARIES} ${GTEST_MAIN_LIBRARIES} Threads::Threads)
target_link_libraries(runISISTests isis ${MISSION_LIBS} ${ALLLIBS} ${GTEST_LIBRARIES} ${GTEST_MAIN_LIBRARIES} Threads::Threads)

gtest_discover_tests(runISISTests WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/tests)
10 changes: 6 additions & 4 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ package:
source:
git_url: 'https://github.com/USGS-Astrogeology/ISIS3.git'
git_tag: {{ version }}

# url: 'https://github.com/USGS-Astrogeology/ISIS3/archive/{{ version }}.tar.gz'
# sha256 is the prefered checksum -- you can get it for a file with:
# `openssl sha256 <file name>`. Simply run this command with the .tar.gz
Expand Down Expand Up @@ -153,9 +153,11 @@ requirements:
- xorg-libxi
- zlib

# Add the tests eventually
# test:
#
test:
commands:
- test -e $PREFIX/lib/libisis${SHLIB_EXT}
- test -e $PREFIX/include/isis/Isis.h


about:
home: https://github.com/USGS-Astrogeology/ISIS3
Expand Down

0 comments on commit 3617001

Please sign in to comment.