Commit 25ef87f6 authored by Jesse Mapel's avatar Jesse Mapel
Browse files

Merge branch 'cmake' of github.com:USGS-Astrogeology/ISIS3 into cmake

parents 08140e3e 3c813321
Loading
Loading
Loading
Loading
+160 −0
Original line number Diff line number Diff line
@@ -43,3 +43,163 @@ print.prt
*/tsts/*/output/*
*/build/
*/install/

# Created by https://www.gitignore.io/api/c++

### C++ ###
# Prerequisites
*.d
*.hpp
*.sbf

# Compiled Object files
*.slo
*.lo
*.o
*.obj

# Precompiled Headers
*.gch
*.pch

# Compiled Dynamic libraries
*.so
*.dylib
*.dll

# Fortran module files
*.mod
*.smod

# Compiled Static libraries
*.lai
*.la
*.a
*.lib

# Executables
*.exe
*.out
*.app


# Created by https://www.gitignore.io/api/osx

### OSX ###
*.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk


# Created by https://www.gitignore.io/api/python

### Python ###
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
#  Usually these files are written by a python script from a template
#  before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# dotenv
.env

# virtualenv
.venv/
venv/
ENV/

# Spyder project settings
.spyderproject

# Rope project settings
.ropeproject
+0 −0

File moved.

configure.py

0 → 100644
+88 −0
Original line number Diff line number Diff line
import os
import sys
import sipconfig
import sipdistutils
import PyQt5
import subprocess
import argparse

from os.path import splitext
from os.path import dirname
from glob import glob
from distutils.spawn import find_executable

from PyQt5.QtCore import PYQT_CONFIGURATION
from plio.utils.utils import find_in_dict
from PyQt5.QtCore import PYQT_CONFIGURATION as qtconfigdict
from sipconfig import ModuleMakefile

def main (module):
    # The name of the SIP build file generated by SIP and used by the build
    # system.
    sipy_sip_dir = "sipfiles/"
    module = sipy_sip_dir+module + '.sip'
    build_file = "bundle"+".sbf"
    target = module+".so"

    # Get the extra SIP flags needed by the imported qt module.  Note that
    # this normally only includes those flags (-x and -t) that relate to SIP's
    # versioning system.
    qt_sip_flags = qtconfigdict["sip_flags"]

    # sip_bin = current_env_path + "/bin/sip"
    sip_bin = find_executable('sip')
    pyqt_sip_dir = dirname(dirname(sip_bin)) + "/share/sip/PyQt5"

    # Get the PyQt configuration information.
    config = sipconfig.Configuration()

    # Run SIP to generate the code.  Note that we tell SIP where to find the qt
    # module's specification files using the -I flag.

    errcode = os.system(" ".join([sip_bin, "-e","-c", ".", "-b", build_file, "-I",
        pyqt_sip_dir, qt_sip_flags, module]))

    if errcode != 0:
        print('sip exited with non zero error code: {}'.format(errcode))

    # We are going to install the SIP specification file for this module and
    # its configuration module.
    installs = []
    installs.append([module, os.path.join(pyqt_sip_dir, "isis3")])

    isis_root = os.getenv("ISISROOT")
    if not isis_root:
        raise("Please set ISIS")

    extra_libs = ["$(ALLLIBS)", "-Wl,-rpath,"+isis_root+"/lib", "-Wl,-rpath,"+isis_root+"/3rdParty/lib"]

    makefile = ModuleMakefile(configuration=config, build_file=build_file, installs=installs)
    makefile.extra_cxxflags = ["$(ALLINCDIRS)", "-Wstrict-aliasing=0", "-Wno-unused-variable"]
    makefile.extra_lflags =  ["$(ALLLIBDIRS)"]
    makefile.extra_include_dirs = [x[0] for x in os.walk('incs/')]
    makefile.extra_lib_dirs = [isis_root + '/3rdParty/lib', isis_root + 'lib']
    makefile.generate()

    # add import line for isismake.os
    isis_makefile = "include " + isis_root + "/make/isismake.os"

    with open("Makefile", 'r+') as f:
        content = f.read()
        content = content.replace("LIBS =", "LIBS = " + ' '.join(extra_libs))
        f.seek(0, 0)
        f.write(isis_makefile + '\n\n' + content)

if __name__ == "__main__":
    clean = ['cpp', 'c', 'h', 'hpp', 'o', 'sbf']

    # If clean is passed in, clear up all the files genreated by the scripts
    if len(sys.argv) > 1 and sys.argv[1] == 'clean':
        files = []
        for filetype in clean:
            files.extend(glob('*.{}'.format(filetype)))

        for f in files:
            os.remove(f)
        exit()

    main('master')
+68 −102
Original line number Diff line number Diff line
name: isisdeps
name: isis
channels:
- anaconda
- inria-pro-sed
  - krodriguez
- conda-forge
  - usgs-astrogeology
  - conda-forge
  - probcomp
  - anaconda
  - jlaura
  - defaults
dependencies:
- libgcc=4.8.5=1
- blas=1.1=openblas
- boost=1.65.1=py27_0
- boost-cpp=1.65.1=1
- bzip2=1.0.6=1
- ca-certificates=2018.1.18=0
- cairo=1.14.6=4
- certifi=2018.1.18=py27_0
- cmake=3.9.1=0
- cspice=66=0
- curl=7.55.1=0
- dbus=1.10.22=0
- doxygen=1.8.14=0
- eigen=3.3.3=0
- expat=2.2.5=0
- ffmpeg=3.2.4=3
- flann=1.8.4=0
- fontconfig=2.12.1=4
- freetype=2.7=1
- geos=3.5.1=1
- geotiff=1.4.2=1
- gettext=0.19.8.1=0
- giflib=5.1.4=0
- glib=2.51.4=0
- gsl=2.2.1=blas_openblas_3
- harfbuzz=1.3.4=2
- hdf5=1.8.18=3
- icu=58.2=0
- jasper=1.900.1=4
- jpeg=9b=2
- krb5=1.14.2=0
- lapack=3.6.1=1
- libffi=3.2.1=3
- libgfortran=3.0.0=0
- libiconv=1.15=0
- libpng=1.6.28=2
- libssh2=1.8.0=2
- libtiff=4.0.9=0
- libuv=1.11.0=0
- libwebp=0.5.2=7
- libxcb=1.12=1
- libxml2=2.9.7=0
- m4=1.4.17=1
- metis=5.1.0=3
- nanoflann=1.2.2=0
- ncurses=5.9=10
- ninja=1.7.2=0
- nn=1.86.0=2
- numpy=1.13.3=py27_blas_openblas_200
- openblas=0.2.19=2
- opencv=3.3.0=py27_blas_openblas_200
- openssl=1.0.2n=0
- pcre=8.39=0
- pip=9.0.1=py27_1
- pixman=0.34.0=1
- proj4=4.9.3=5
- protobuf=3.2.0=py27_0
- python=2.7.14=4
- qt=5.6.2=h9e3eb04_4
- qwt=6.1.3=1
- readline=7.0=0
- rhash=1.3.4=0
- setuptools=38.5.1=py27_0
- six=1.11.0=py27_1
- sqlite=3.20.1=2
- suitesparse=4.5.4=blas_openblas_200
- superlu=5.2.1=blas_openblas_201
- tk=8.6.7=0
- wheel=0.30.0=py27_2
- x264=20131217=3
- xorg-kbproto=1.0.7=1
- xorg-libx11=1.6.4=6
- xorg-libxau=1.0.8=3
- xorg-libxdmcp=1.1.2=3
- xorg-xproto=7.0.31=6
- xz=5.2.3=0
- zlib=1.2.11=0
- openmpi=1.8.6=4
- parmetis=4.0.3p2=1
- jama=125=0
- tnt=126=0
- bullet=2.86.1=he2aa7b0_0
- ds9=7.5=h35e3669_0
- embree=2.16.0=h6834224_0
- gmm=5.0=h6aef312_0
- naif=n0066
- patchelf=0.9=h879b6ae_0
- pcl=1.8.1=h7a71350_0
- qhull=7.2.0=h396fa31_0
- tbb=4.4=hf7780a4_0
- vtk=7.1.1=py27h56fd973_0
- xalan-c=1.11=h1922a5c_0
- xerces-c=3.1.4=h10f7eb2_0
prefix: /Users/krodriguez-pr/anaconda3/envs/isisdeps
  - libgfortran==3.0
  - qwt=6.1.3
  - pyqt==5.6.0
  - sip==4.18
  - mysql==5.7.20
  - ninja==1.7.2=0
  - patchelf==0.9
  - pip==9.0.1
  - setuptools=38.5.1
  - wheel==0.30.0
  - xerces-c==3.1.4=0
  - zlib==1.2.11=0
  - blas==1.1=openblas
  - boost==1.65.1
  - boost-cpp==1.65.1
  - bzip2==1.0.6=1
  - cmake==3.9.1=0
  - cspice==66-0
  - curl==7.55.1=0
  - doxygen==1.8.14=0
  - eigen==3.3.3=0
  - embree==2.14.0=0
  - geos==3.5.1=1
  - geotiff==1.4.2=1
  - gmp==6.1.2=0
  - gsl==2.2.1=blas_openblas_3
  - hdf5==1.8.18=2
  - icu==58.2=0
  - jpeg==9b=2
  - krb5==1.14.2=0
  - libpng==1.6.28=2
  - libtiff==4.0.9=0
  - libxml2==2.9.7=0
  - mesalib==17.2.0=0
  - mysql-connector-c==6.1.6=0
  - nn==1.86.0=2
  - numpy==1.13.3=py36_blas_openblas_200
  - openblas==0.2.19=2
  - opencv==3.3.0
  - nanoflann==1.22
  - gmm==5.0
  - jama==125
  - openssl==1.0.2n=0
  - python==3.6
  - sqlite==3.13.0=1
  - suitesparse==4.5.4=blas_openblas_200
  - superlu==5.2.1=blas_openblas_201
  - xorg-kbproto==1.0.7=1
  - xorg-libx11==1.6.4=6
  - bz2file==0.98
  - protobuf==3.5.1
  - libprotobuf==3.2.0=0
  - bullet==2.86.1=0
  - pcl==1.8.1
  - qhull==7.2.0=0
  - qt=5.6.2
  - qwt
  - tnt==126=0
  - xalan-c==1.11
prefix: /scratch/anaconda3/envs/isis
+260 −60
Original line number Diff line number Diff line
@@ -57,8 +57,8 @@ message("Detected Operating System: ${osVersionString}")
#  as a static library using some specialized code in Utilities.cmake.
set(BUILD_SHARED_LIBS ON)

# Specify flags used
set(thirdPartyCppFlags -Wall -std=c++11 -DISIS_LITTLE_ENDIAN=1 -fPIC -Wno-unused-parameter -Wno-overloaded-virtual)
# make sure to leave rpaths untouched on install
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)

# Specify user options that can be passed in with the initial CMake command.
option(isis3Data       "Directory containing Isis3Data"                 OFF )
@@ -69,12 +69,12 @@ option(buildMissions "Build the mission specific modules" ON )
option(buildStaticCore "Build libisis3 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" ON  )
option(develop         "Use a devleopment configuration"                ON  )
option(pybindings      "Turn on to build Python bindings"               ON )

# options only allow on/off but this flag is piped into ISIS as ENABLEJP2K
# needs to be either 1 or 0 for C style true false
if(JP2KFLAG)
  set(JP2KFLAG 1)
# if cmake install prefix is not set, and conda env is activated, use the
# conda env as the install directory
if(DEFINED ENV{CONDA_PREFIX} AND CMAKE_INSTALL_PREFIX STREQUAL "/usr/local")
 set(CMAKE_INSTALL_PREFIX $ENV{CONDA_PREFIX})
endif()

# Prioritize passed in variables over env vars, probably a better way to do this
@@ -87,20 +87,16 @@ endif()

if(EXISTS ${isis3Data})
 set(ENV{ISIS3DATA} "${isis3Data}")
  message("Using ISIS3DATA = $ENV{ISIS3DATA}")
else()
 message(WARNING "Isis3Data directory ${isis3Data} not found, unit tests will fail.")
 set(isis3Data OFF)
endif()

if(EXISTS ${isis3TestData})
 set(ENV{ISIS3TESTDATA} "${isis3TestData}")
  message("Using ISIS3TESTDATA = $ENV{ISIS3TESTDATA}")
else()
 message(WARNING "Isis3TestData directory ${isis3TestData} not found, application and module tests will fail.")
endif()

if(develop)
  
 set(isis3TestData OFF)
endif()

if(${testOutputDir} STREQUAL "OFF")
@@ -113,48 +109,267 @@ else()
 execute_process(COMMAND mkdir -p ${testOutputDir})
endif()

# Set the default library extension based on the platform
# inject ISISROOT
add_definitions( -DISISROOT="${CMAKE_SOURCE_DIR}" )
add_definitions( -DISISBUILDDIR="${CMAKE_BINARY_DIR}" )

message("CONFIGURATION")
message("\tBUILD STATIC CORE: ${buildStaticCore}")
message("\tBUILD TESTS: ${buildTests}")
message("\tBUILD CORE: ${buildCore}")
message("\tBUILD MISSIONS: ${buildMissions}")
message("\tJP2K SUPPORT: ${JP2KFLAG}")
message("\tPYTHON BINDINGS: ${pybindings}")
message("\tISIS3DATA: ${isis3Data}")
message("\tISISTESTDATA: ${isis3TestData}")
message("\tTEST OUTPUT DIR: ${testOutputDir}")
message("\tINSTALL PREFIX: ${CMAKE_INSTALL_PREFIX}")

#===============================================================================
#===============================================================================

# Set up the ctest tool which is used to run all of the tests.
enable_testing()
include(CTest)

# Set up Anaconda prefix in the case with a non-default conda env is activated
if(EXISTS $ENV{CONDA_PREFIX})
  message("CONDA PREFIX: $ENV{CONDA_PREFIX}")
  list(APPEND CMAKE_FIND_ROOT_PATH $ENV{CONDA_PREFIX}
                                   $ENV{CONDA_PREFIX}/lib/cmake/Qt5)
endif()

# options only allow on/off but this flag is piped into ISIS as ENABLEJP2K
# needs to be either 1 or 0 for C style true false
if(JP2KFLAG)
 set(JP2KFLAG 1)
endif()

 # Set up the ctest tool which is used to run all of the tests.
 enable_testing()
 include(CTest)

# Specify flags used
# on linux, add the conda prefix to handle possible issues with rpaths at link time
# sometimes third parties do not set their rpaths correctly
set(thirdPartyCppFlags -Wall
                       -std=c++11
                       -fPIC
                       -DISIS_LITTLE_ENDIAN=1
                       -fPIC -Wno-unused-parameter
                       -Wno-overloaded-virtual
                       -DGMM_USES_SUPERLU
                       -DENABLEJP2K=${JP2KFLAG}
                     )

 # Append CPP flags set in the third party lib file to the string set in this file.
 string(REPLACE ";" " " FLAGS_STR "${thirdPartyCppFlags}")
 set(CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS} ${FLAGS_STR}" )


# Flag to fix numeric literals problem with boost on linux
if(NOT APPLE)
  set(thirdPartyCppFlags ${thirdPartyCppFlags} -fext-numeric-literals
                                               -Wl,-rpath,$ENV{CONDA_PREFIX}/lib)
endif()

 # Append CPP flags set in the third party lib file to the string set in this file.
 string(REPLACE ";" " " FLAGS_STR "${thirdPartyCppFlags}")
 set(CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS} ${FLAGS_STR}" )


# Paths to required executables
find_program(XALAN Xalan REQUIRED)
find_program(LATEX latex)
find_program(DOXYGEN NAME doxygen PATH_SUFFIXES doxygen REQUIRED)
find_program(UIC uic REQUIRED)
find_program(MOC moc REQUIRED)
find_program(RCC rcc REQUIRED)
find_program(PROTOC protoc REQUIRED)

find_package(Qt5 COMPONENTS
                Core
                Concurrent
                Gui
                Multimedia
                MultimediaWidgets
                Network
                OpenGL # Needed to install mesa-common-dev for this!
                PrintSupport
                Qml
                Quick
                Script
                ScriptTools
                Sql
                Svg
                Test
                WebChannel
                Widgets
                Xml
                XmlPatterns REQUIRED)

# Some of these will have non-traditional installs with version numbers in the paths in v007
# For these, we pass in a version number, and use it in the path suffix
# This only applies to v007, and outside of the building, we should only expect standard installs
# The v007-specific installs are listed beside their find_package calls below:
find_package(Boost     1.59.0  REQUIRED)
find_package(Bullet    2.86    REQUIRED)
find_package(Cholmod   4.4.5   REQUIRED)
find_package(CSPICE    65      REQUIRED)
find_package(Eigen             REQUIRED)
find_package(Embree    2.15.0  REQUIRED)
find_package(GeoTIFF   2       REQUIRED)
find_package(GMM       5.0     REQUIRED)
find_package(GSL       19      REQUIRED)
find_package(HDF5      1.8.15  REQUIRED)
find_package(Jama      125     REQUIRED)
find_package(NN                REQUIRED)
find_package(OpenCV    3.1.0   REQUIRED)
find_package(PCL       1.8     REQUIRED)
find_package(Protobuf  2.6.1   REQUIRED)
find_package(Qwt       6       REQUIRED)
find_package(SuperLU   4.3     REQUIRED)
find_package(TIFF      4.0.5   REQUIRED)
find_package(TNT       126     REQUIRED)
find_package(XercesC   3.1.2   REQUIRED)
find_package(X11       6       REQUIRED)
find_package(nanoflann         REQUIRED)
find_package(PNG               REQUIRED)
find_package(Kakadu)
find_package(Geos    3.5.0   REQUIRED)

# Im this case, we specify the version numbers being searched for in the non-traditional installs.
if(APPLE)
  set(SO ".dylib")
else()
  set(SO ".so")
  find_package(OpenGL            REQUIRED)
endif(APPLE)

if(pybindings)
 find_package(Python REQUIRED)
 find_package(Sip    REQUIRED)
endif()

# Iterate through all variables and extract the libraries and include directories
get_cmake_property(_variableNames VARIABLES) # Get All VARIABLES

set(ALLLIBDIRS "")
set(ALLLIBS "")
set(ALLINCDIRS "")

# Get all include dir variables
foreach (_variableName ${_variableNames})
#message("VAR=${_variableName}")
   if (_variableName MATCHES ".+_INCLUDE_DIR$")
     list(APPEND ALLINCDIRS "${${_variableName}}")
   elseif (_variableName MATCHES ".+_INCLUDE_PATH$")
     list(APPEND ALLINCDIRS "${${_variableName}}")
   endif(_variableName MATCHES ".+_INCLUDE_DIR$")
endforeach()

# get all Library variables
foreach (_variableName ${_variableNames})
   get_filename_component(LIBDIR "${${_variableName}}" DIRECTORY)
   if (_variableName MATCHES "^CMAKE+")
   elseif (_variableName MATCHES ".+_LIB$")
     list(APPEND ALLLIBDIRS "${LIBDIR}")
     list(APPEND ALLLIBS "${${_variableName}}")
   elseif (_variableName MATCHES ".+_LIBRARY$")
     list(APPEND ALLLIBDIRS "${LIBDIR}")
     list(APPEND ALLLIBS "${${_variableName}}")
   elseif (_variableName MATCHES ".+_LIBRARIES$")
     list(APPEND ALLLIBDIRS "${LIBDIR}")
     list(APPEND ALLLIBS "${${_variableName}}")
   endif()
endforeach()

# Sometimes we add the same lib more than once (especially with LIBDIRS)
list(REMOVE_DUPLICATES ALLLIBDIRS)
list(REMOVE_DUPLICATES ALLLIBS)
list(REMOVE_DUPLICATES ALLINCDIRS)

#===============================================================================
#===============================================================================

# Set python bindings configuration and set target for generating C++ files
if(pybindings)
  message("Configuring Python Bindings")

  if (NOT DEFINED PYINSTALL_DIR)
    set(PYINSTALL_DIR ${PYTHON_SITE_PACKAGES_DIR})
  endif()
  message("PYTHON BINDINGS INSTALL DIR: ${PYINSTALL_DIR}")

 # We need to get the locations for sip files, modules, etc.
 set(ISIS_SIP_DIR "${CMAKE_SOURCE_DIR}/sipfiles")
 set(ISIS_SIP_MODULE "${CMAKE_SOURCE_DIR}/sipfiles/master.sip")
 set(SIP_BUILD_FILE "isispy.sbf")
 set(ISIS_SIP_CODE_DIR ${CMAKE_BINARY_DIR}/sipsrc)

 # Create the output directory for the new .CPP files
 execute_process(COMMAND mkdir -p "${ISIS_SIP_CODE_DIR}")

 # get list of output files exepected from sip

 # get the PYQT configuration based flags from Python
 execute_process(COMMAND ${PYTHON_EXECUTABLE} -c
                 "from PyQt5.QtCore import PYQT_CONFIGURATION as qtconfigdict;print(qtconfigdict['sip_flags'])"
                 OUTPUT_VARIABLE PYQT_SIP_FLAGS)

 # CMAKE doesn't handle spaces from python well when piping that into the
 # command because of white space and a trailing new line,
 # so we turn it into a list
 string(STRIP ${PYQT_SIP_FLAGS} PYQT_SIP_FLAGS)
 string(REPLACE " " ";" PYQT_SIP_FLAGS ${PYQT_SIP_FLAGS})
 message("Generating C++ code from sip files")

 message(STATUS "SIP BUILD FILE: ${SIP_BUILD_FILE}")
 message(STATUS "SIP MODULE: ${ISIS_SIP_MODULE}")
 message(STATUS "SIP GENERATED CODE DIR: ${ISIS_SIP_CODE_DIR}")


 execute_process(COMMAND ${SIP_BINARY_PATH} -e -o -c ${ISIS_SIP_CODE_DIR} -I ${SIP_DEFAULT_SIP_DIR}/PyQt5 ${PYQT_SIP_FLAGS} ${ISIS_SIP_MODULE})

 # add target so users can run the command after initial configuration
 add_custom_target(sipfiles
                  COMMAND ${SIP_BINARY_PATH} -e -o -c ${ISIS_SIP_CODE_DIR} -I ${SIP_DEFAULT_SIP_DIR}/PyQt5 ${PYQT_SIP_FLAGS} ${ISIS_SIP_MODULE}
                  COMMENT "Generating C++ code from sip files")

 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)
 add_dependencies(isispy sipfiles)

 install(TARGETS isispy DESTINATION ${PYINSTALL_DIR})
endif()


#===============================================================================
#===============================================================================

# Start setting up the build
# Add extension to find fortran until .so symlink can be added to /usr/lib64
list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES .so.3 .so.6 .so.5)

# Set up all the third party library dependencies.
include(FindAllDependencies)

# Allow everything to include the 3rd party libraries
include_directories(SYSTEM ${ALLINCDIRS})
link_directories(${ALLLIBDIRS})

# inject ISISROOT
add_definitions( -DISISROOT="${CMAKE_SOURCE_DIR}" )
add_definitions( -DISISBUILDDIR="${CMAKE_BINARY_DIR}" )

# add isis headers
file(GLOB ISIS_HEADERS ${CMAKE_SOURCE_DIR}/src/*/objs/*/*.h
${CMAKE_SOURCE_DIR}/src/*/objs/*/*.hpp)
file(COPY ${ISIS_HEADERS} DESTINATION ${CMAKE_BINARY_DIR}/inc)

include_directories(${CMAKE_BINARY_DIR}/inc)

set(CORE_LIB_NAME isis3)

# Specify relative library include paths which will be set up on
#  the installed files.
if(APPLE)
  set(CMAKE_INSTALL_RPATH "@loader_path/../lib;@loader_path/../3rdParty/lib")
  set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_RPATH};@loader_path/../lib;@loader_path/../3rdParty/lib")
else()
  set(CMAKE_INSTALL_RPATH "$ORIGIN/../lib;$ORIGIN/../3rdParty/lib")
  set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_RPATH};$ORIGIN/../lib;$ORIGIN/../3rdParty/lib")
endif()
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE)

# 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.
@@ -165,13 +380,6 @@ EXECUTE_PROCESS(COMMAND cp -f ${CMAKE_SOURCE_DIR}/src/base/objs/Preference/TestP
install(CODE "EXECUTE_PROCESS(COMMAND cp -f ${CMAKE_SOURCE_DIR}/src/base/objs/Preference/TestPreferences ${CMAKE_INSTALL_PREFIX}/)")
install(CODE "EXECUTE_PROCESS(COMMAND cp -f ${CMAKE_SOURCE_DIR}/IsisPreferences ${CMAKE_INSTALL_PREFIX}/)")

# Append CPP flags set in the third party lib file to the string set in this file.
string(REPLACE ";" " " FLAGS_STR "${thirdPartyCppFlags}")
set(CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS} ${FLAGS_STR}" )
# Set up the ctest tool which is used to run all of the tests.
enable_testing()
include(CTest)

# Delete any existing plugin files in the build folder so they
#  don't get filled with duplicate entries.
file(GLOB existingPlugins "${CMAKE_BINARY_DIR}/plugins/*.plugin")
@@ -199,19 +407,11 @@ install(DIRECTORY ${CMAKE_SOURCE_DIR}/make DESTINATION ${CMAKE_INSTALL_PREFIX})
# Have CMake process all of the source code and tests.
add_subdirectory(src objects)

# Set up third party libraries for installation
install_third_party()

# # Create a link from the build/objects directory to each folder in 3rdPartyLibs/plugins.
# # - This is required so that the plugins can be found during unit tests.
# # TIP: Set "export QT_DEBUG_PLUGINS=1" to help debug plugin errors.
# foreach(plugin ${THIRDPARTYPLUGINFOLDERS})
#   get_filename_component(pluginName ${plugin} NAME)
#   if(NOT EXISTS ${CMAKE_BINARY_DIR}/lib/${pluginName})
#     execute_process(COMMAND ln -s "${plugin}" ${pluginName}
#     WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
#   endif()
# endforeach()
if(APPLE)
 set(SO ".dylib")
else()
 set(SO ".so")
endif()

# Set up documentation build target.
# - This script is called by running "make docs".
Loading