~s-cecilio/lenmus/v5.3

« back to all changes in this revision

Viewing changes to CMakeLists.txt

  • Committer: Cecilio Salmeron
  • Date: 2012-12-20 12:15:09 UTC
  • Revision ID: s.cecilios@gmail.com-20121220121509-of1ic9v71x1i6m13
Added option to CMakeList.txt for suppressing version folder

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
#---------------------------------------------------------------------------------------
20
20
 
21
21
#-------------------------------------------------------------------------------------
22
 
#  This is a CMake configuration file for building makefiles and installfiles for
23
 
#  the LenMus Phonascus program
24
 
#
25
 
#  To use it you need CMake which can be downloaded from http://www.cmake.org/
26
 
#
27
 
#  This file has been tested with the following generators:
28
 
#   Windows:
29
 
#       Visual Studio 7 .NET
30
 
#       Visual Studio 2008
31
 
#   Linux:
32
 
#       Unix Makefiles
33
 
#       CodeBlocks - Unix Makefiles
 
22
# This is a CMake configuration file for building makefiles and installfiles for
 
23
# the LenMus Phonascus program
 
24
#
 
25
# To use it you need CMake which can be downloaded from http://www.cmake.org/
 
26
#
 
27
# Usage
 
28
#   cmake [<options>] <source-tree>
 
29
#
 
30
# example:
 
31
#   cmake ../lenmus
 
32
#
 
33
# The default target (in Linux) is "Unix Makefiles". If you would like to generate
 
34
# a diferent makefile use option -G<desired-target>. For instance:
 
35
#   cmake -G "CodeBlocks - Unix Makefiles" ...
 
36
#
 
37
# The default installation prefix is "/usr/local". You can change the install 
 
38
# location by specifying option CMAKE_INSTALL_PREFIX:
 
39
#   cmake -DCMAKE_INSTALL_PREFIX=/new/install/prefix ...
 
40
#
 
41
# By default, lenmus is installed in a version subfolder, such as
 
42
# /usr/local/share/lenmus/5.3/<files>, so that several lenmus versions can
 
43
# coexist in your machine. But if this is not required, you can install without 
 
44
# the version folder (i.e. to /usr/local/share/lenmus/<files>) by setting option
 
45
# LENMUS_USE_VERSION_FOLDER to OFF:
 
46
#   cmake -DLENMUS_USE_VERSION_FOLDER:BOOL=OFF ...
34
47
#
35
48
#-------------------------------------------------------------------------------------
36
49
 
54
67
# directories to search for CMake modules
55
68
set( CMAKE_MODULE_PATH    "${ROOT_DIR}/cmake-modules" )
56
69
 
 
70
# some options for building
 
71
OPTION(LENMUS_USE_VERSION_FOLDER
 
72
  "Install LenMus using a version subfolder (i.e. /usr/local/share/lenmus/5.3/)"
 
73
  ON)
 
74
 
57
75
 
58
76
# set up configuration variables for lenmus_config.h
59
77
#------------------------------------------------------
143
161
set(ROOT_INSTALL ${CMAKE_INSTALL_PREFIX} )
144
162
 
145
163
if( UNIX )
146
 
    set(ROOT_INSTALL_HOME ${ROOT_INSTALL}/share/${CMAKE_PROJECT_NAME}/${LENMUS_VERSION_STRING} )
 
164
    if (LENMUS_USE_VERSION_FOLDER)
 
165
        set(ROOT_INSTALL_HOME ${ROOT_INSTALL}/share/${CMAKE_PROJECT_NAME}/${LENMUS_VERSION_STRING} )
 
166
    else()
 
167
        set(ROOT_INSTALL_HOME ${ROOT_INSTALL}/share/${CMAKE_PROJECT_NAME} )
 
168
    endif()
147
169
elseif( WIN32 )
148
170
    set(ROOT_INSTALL_HOME ${ROOT_INSTALL} )
149
171
endif()
562
584
#   cmake -DCMAKE_INSTALL_PREFIX=/new/install/prefix
563
585
#
564
586
# By default, the prefix is "/usr/local"
 
587
#
 
588
# Remember:
 
589
#  ROOT_DIR: the root of the package source tree: i.e. $HOME/Downloads/lenmus-5.3
 
590
#  ROOT_INSTALL:  install location: i.e. /usr/local
 
591
#  ROOT_INSTALL_HOME: shared files i.e. /usr/local/share/lenmus/5.3/
565
592
#///////////////////////////////////////////////////////////////////////////////
566
593
 
567
594
    # lenmus program
639
666
    # ------------------------------------------------------------------------------
640
667
if( UNIX )
641
668
    set(ROOT_DATA_HOME $ENV{HOME}/${CMAKE_PROJECT_NAME} )
 
669
    set(ROOT_SAMPLES ${ROOT_INSTALL_HOME} )
642
670
elseif( WIN32 )
643
671
    set(ROOT_DATA_HOME ${ROOT_INSTALL} )
 
672
    set(ROOT_SAMPLES ${ROOT_DATA_HOME}/${LENMUS_VERSION_STRING} )
644
673
endif()
645
674
set(ROOT_SCORES ${ROOT_DATA_HOME}/scores )
646
 
set(ROOT_SAMPLES ${ROOT_DATA_HOME}/${LENMUS_VERSION_STRING}/samples )
 
675
 
647
676
message("ROOT_SCORES = " ${ROOT_SCORES} )
648
677
message("ROOT_SAMPLES = " ${ROOT_SAMPLES} )
649
678
 
650
 
if( UNIX )
651
 
        install(DIRECTORY ${ROOT_DIR}/scores/samples  DESTINATION "${ROOT_INSTALL_HOME}"
652
 
                    FILES_MATCHING PATTERN "*.lms"
653
 
                    PATTERN ".svn" EXCLUDE
654
 
                    PATTERN "test_set" EXCLUDE
655
 
        )
656
 
elseif( WIN32 )
657
 
        install(DIRECTORY ${ROOT_DIR}/scores/samples  DESTINATION "${ROOT_SAMPLES}"
658
 
                    FILES_MATCHING PATTERN "*.lms"
659
 
                    PATTERN ".svn" EXCLUDE
660
 
                    PATTERN "test_set" EXCLUDE
661
 
        )
662
 
endif()
663
 
#install(FILES ${ROOT_DIR}/scores/samples/  DESTINATION "${ROOT_SCORES}")
 
679
install(DIRECTORY ${ROOT_DIR}/scores/samples  DESTINATION "${ROOT_SAMPLES}"
 
680
            FILES_MATCHING PATTERN "*.lms"
 
681
            PATTERN ".svn" EXCLUDE
 
682
            PATTERN "test_set" EXCLUDE
 
683
)
664
684
 
665
685
 
666
686