cmake_modules/paths.cmake
author koda
Mon, 10 Jun 2013 16:46:58 +0200
changeset 9190 4fc0e95e7b64
child 9198 48b92ff6238f
permissions -rw-r--r--
move paths setup in separate cmake module
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9190
4fc0e95e7b64 move paths setup in separate cmake module
koda
parents:
diff changeset
     1
#where to build libs and bins
4fc0e95e7b64 move paths setup in separate cmake module
koda
parents:
diff changeset
     2
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
4fc0e95e7b64 move paths setup in separate cmake module
koda
parents:
diff changeset
     3
set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
4fc0e95e7b64 move paths setup in separate cmake module
koda
parents:
diff changeset
     4
4fc0e95e7b64 move paths setup in separate cmake module
koda
parents:
diff changeset
     5
#resource paths
4fc0e95e7b64 move paths setup in separate cmake module
koda
parents:
diff changeset
     6
if(UNIX AND NOT APPLE)
4fc0e95e7b64 move paths setup in separate cmake module
koda
parents:
diff changeset
     7
    set(target_binary_install_dir "bin")
4fc0e95e7b64 move paths setup in separate cmake module
koda
parents:
diff changeset
     8
    set(target_library_install_dir "lib")
4fc0e95e7b64 move paths setup in separate cmake module
koda
parents:
diff changeset
     9
4fc0e95e7b64 move paths setup in separate cmake module
koda
parents:
diff changeset
    10
    string(SUBSTRING "${DATA_INSTALL_DIR}" 0 1 sharepath_start)
4fc0e95e7b64 move paths setup in separate cmake module
koda
parents:
diff changeset
    11
    if (NOT (${sharepath_start} MATCHES "/"))
4fc0e95e7b64 move paths setup in separate cmake module
koda
parents:
diff changeset
    12
        set(HEDGEWARS_DATADIR "${CMAKE_INSTALL_PREFIX}/${DATA_INSTALL_DIR}/")
4fc0e95e7b64 move paths setup in separate cmake module
koda
parents:
diff changeset
    13
    else()
4fc0e95e7b64 move paths setup in separate cmake module
koda
parents:
diff changeset
    14
        set(HEDGEWARS_DATADIR "${DATA_INSTALL_DIR}/")
4fc0e95e7b64 move paths setup in separate cmake module
koda
parents:
diff changeset
    15
    endif()
4fc0e95e7b64 move paths setup in separate cmake module
koda
parents:
diff changeset
    16
    set(HEDGEWARS_FULL_DATADIR "${HEDGEWARS_DATADIR}")
4fc0e95e7b64 move paths setup in separate cmake module
koda
parents:
diff changeset
    17
else()
4fc0e95e7b64 move paths setup in separate cmake module
koda
parents:
diff changeset
    18
    set(target_binary_install_dir "./")
4fc0e95e7b64 move paths setup in separate cmake module
koda
parents:
diff changeset
    19
4fc0e95e7b64 move paths setup in separate cmake module
koda
parents:
diff changeset
    20
    if(APPLE)
4fc0e95e7b64 move paths setup in separate cmake module
koda
parents:
diff changeset
    21
        set(target_library_install_dir "../Frameworks/")
4fc0e95e7b64 move paths setup in separate cmake module
koda
parents:
diff changeset
    22
        set(CMAKE_INSTALL_PREFIX "Hedgewars.app/Contents/MacOS/")
4fc0e95e7b64 move paths setup in separate cmake module
koda
parents:
diff changeset
    23
        set(HEDGEWARS_DATADIR "../Resources/")
4fc0e95e7b64 move paths setup in separate cmake module
koda
parents:
diff changeset
    24
        set(HEDGEWARS_FULL_DATADIR "/Applications/${CMAKE_INSTALL_PREFIX}/${HEDGEWARS_DATADIR}")
4fc0e95e7b64 move paths setup in separate cmake module
koda
parents:
diff changeset
    25
    elseif(WIN32)
4fc0e95e7b64 move paths setup in separate cmake module
koda
parents:
diff changeset
    26
        set(target_library_install_dir "./")
4fc0e95e7b64 move paths setup in separate cmake module
koda
parents:
diff changeset
    27
        set(HEDGEWARS_DATADIR "./")
4fc0e95e7b64 move paths setup in separate cmake module
koda
parents:
diff changeset
    28
        set(HEDGEWARS_FULL_DATADIR "${CMAKE_INSTALL_PREFIX}/")
4fc0e95e7b64 move paths setup in separate cmake module
koda
parents:
diff changeset
    29
        link_directories("${EXECUTABLE_OUTPUT_PATH}" "${CMAKE_SOURCE_DIR}/misc/winutils/bin")
4fc0e95e7b64 move paths setup in separate cmake module
koda
parents:
diff changeset
    30
    endif()
4fc0e95e7b64 move paths setup in separate cmake module
koda
parents:
diff changeset
    31
endif()