#  $Id: build_config.py,v 1.48 2008/02/19 21:01:22 hvengel Exp $
#
#  Lttle cms Profiler
# Copyright (C) 2007 Hal Engel
#
# THIS SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
#
# IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
# INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
# OF THIS SOFTWARE.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
# Version 1.11

import os
import sys
from build_support import *

#### You should not change these.  These are only here
#### If you want to start your own build setup with a
#### different layout than mine.

build_base_dir = 'build'
source_base_dir = 'src'

# setup default target names

target_lprof = 'lprof'
target_icc2it8 = 'icc2it8'
target_spyd2enlprof = 'spyd2enlprof'

build_dir = '#' + SelectBuildDir(build_base_dir)

common_lib_search_path = [
os.path.join(build_dir, 'liblprof'),
os.path.join(build_dir, 'argyll/icc'),
os.path.join(build_dir, 'lcms/src'),
os.path.join(build_dir, 'argyll/rspl'),
os.path.join(build_dir, 'argyll/numlib'),
os.path.join(build_dir, 'solvopt'),
os.path.join(build_dir, 'argyll/spectro'),
os.path.join(build_dir, 'argyll/xicc'),
os.path.join(build_dir, 'argyll/cgats'),
# os.path.join(build_dir, 'qwt'),
os.path.join(build_dir, 'videoLUTutils'),
os.path.join(build_dir, 'moncalqt'),
os.path.join(build_dir, 'moncalcontrolqt'),
os.path.join(build_dir, 'wwfloatspinbox'),
os.path.join(build_dir, 'libqtlcmswidgets'),
os.path.join(build_dir, 'parmsqt'),
os.path.join(build_dir, 'checkerqt'),
os.path.join(build_dir, 'reference_inst_qt'),
os.path.join(build_dir, 'IDqt'),
os.path.join(build_dir, 'gammaqt'),
os.path.join(build_dir, 'monqt')
]

source_base_dir1 = '#src'

## where we should find things to include
# XXX We need a general way to add prefixes whose include dirs should
# be searched.  Until then, add /usr/pkg/include.

common_include_search_path = [
os.path.join(source_base_dir1, 'lcms', 'include'),
os.path.join(source_base_dir1, 'libqtlcmswidgets'),
os.path.join(source_base_dir1, 'liblprof'),
os.path.join(source_base_dir1, 'lprofqt'),
os.path.join(source_base_dir1, 'checkerqt'),
os.path.join(source_base_dir1, 'gammaqt'),
os.path.join(source_base_dir1, 'IDqt'),
os.path.join(source_base_dir1, 'monqt'),
os.path.join(source_base_dir1, 'moncalqt'),
os.path.join(source_base_dir1, 'moncalcontrolqt'),
os.path.join(source_base_dir1, 'parmsqt'),
os.path.join(source_base_dir1, 'reference_inst_qt'),
os.path.join(source_base_dir1, 'argyll', 'rspl'),
os.path.join(source_base_dir1, 'argyll', 'numlib'),
os.path.join(source_base_dir1, 'solvopt'),
os.path.join(source_base_dir1, 'argyll', 'h'),
os.path.join(source_base_dir1, 'argyll', 'spectro'),
os.path.join(source_base_dir1, 'argyll', 'xicc'),
os.path.join(source_base_dir1, 'argyll', 'icc'),
os.path.join(source_base_dir1, 'argyll', 'plot'),
os.path.join(source_base_dir1, 'argyll', 'gamut'),
os.path.join(source_base_dir1, 'argyll', 'profile'),
os.path.join(source_base_dir1, 'argyll', 'cgats'),
os.path.join(source_base_dir1, 'argyll', 'plot'),
os.path.join(source_base_dir1, 'videoLUTutils'),
os.path.join(build_dir, 'libqtlcmswidgets'),
os.path.join(build_dir, 'lprofqt'),
os.path.join(build_dir, 'checkerqt'),
os.path.join(build_dir, 'gammaqt'),
os.path.join(build_dir, 'IDqt'),
os.path.join(build_dir, 'monqt'),
os.path.join(build_dir, 'parmsqt'),
os.path.join(build_dir, 'reference_inst_qt'),
os.path.join(build_dir, 'moncalqt'),
os.path.join(build_dir, 'moncalcontrolqt'),
os.path.join(build_dir, 'solvopt')
]

# pltform specific settings for lib and include search path 
# and to include the corret versions of platform specifc modules

if sys.platform.startswith('win'):
    # Windows usrs must set these environment variables for the 
    # build to work.  Along with QTDIR and HOME
    lib_search_path = [
    common_lib_search_path,    
    os.path.join(os.environ[ 'MINGW2' ], 'lib'),
    os.path.join(os.environ[ 'MINGW' ], 'lib'),
    os.path.join(os.environ[ 'QTDIR' ], 'lib'),
    os.path.join(os.environ[ 'DDK_LIB_PATH' ]) 
    ]
    include_search_path = [
    common_include_search_path,
    os.path.join(os.environ[ 'MINGW2' ], 'include'),
    os.path.join(os.environ[ 'MINGW' ], 'include'),
    os.path.join(os.environ[ 'DDK_INC_PATH' ])
    ]
elif sys.platform.startswith('darwin'):
    lib_search_path = [
    common_lib_search_path,
    os.path.normpath('/lib'),
    os.path.normpath('/usr/lib'),
    os.path.normpath('/usr/local/lib'),
    os.path.normpath('/usr/pkg/lib')
    ]
    include_search_path = [
    common_include_search_path,
    os.path.normpath('/usr/include'),
    os.path.normpath('/usr/pkg/include'),
    os.path.normpath('/usr/local/include'),
    os.path.normpath('/usr/local/pkg/include')
    ]
else:
    lib_search_path = [
    common_lib_search_path,
    os.path.normpath('/lib'),
    os.path.normpath('/usr/lib'),
    os.path.normpath('/usr/X11R6/lib'),
    os.path.normpath('/usr/local/lib'),
    os.path.normpath('/usr/pkg/lib')
    ]
    include_search_path = [
    common_include_search_path,
    os.path.normpath('/usr/include'),
    os.path.normpath('/usr/pkg/include'),
    os.path.normpath('/usr/local/include'),
    os.path.normpath('/usr/local/pkg/include')
    ]


## These are our source files


lprof_sources = [ os.path.join(build_dir, 'lprofqt', x) for x in [
    'lprofmain.cpp',
    'main.cpp',
    'figureeditor.cpp',
    'slots.cpp',
    'lprofmain-priv.cpp',
    'griditem.cpp',
    'imageitem.cpp',
    'interfaces.cpp',
    'config.cpp'
]] 

lprof_resources = [ 'lprof.qrc' ] 

lprof_translations = [os.path.join('translations', x) for x in [
    'lprof_de.ts',
    'lprof_fr.ts',
    'lprof_no.ts',
    'lprof_ru.ts'
]]

lprof_interfaces = [ os.path.join(build_dir, 'lprofqt', x) for x in [
    'lprofmainbase.ui'
]]

ICCtoIT8_sources = [ os.path.join(build_dir, 'ICCtoIT8', x) for x in [
    'getopt.c',
    'icc2it8.c'
]]

spyd2en_sources=[ os.path.join(build_dir, 'argyll', *xs) for xs in [
    ['spectro', 'spyd2en.c'],
    ['spectro', 'vinflate.c']
]]
