File: CMakeLists.txt

package info (click to toggle)
portmidi 1:184-2.2
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 2,432 kB
  • ctags: 1,295
  • sloc: ansic: 7,287; java: 860; lisp: 363; makefile: 142; awk: 83; cpp: 63; python: 29; sh: 3
file content (74 lines) | stat: -rw-r--r-- 2,962 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# portmidi
# Roger B. Dannenberg
# 20 Sep 2009

cmake_minimum_required(VERSION 2.6)

if(UNIX)
  # allow user to set Release or Debug
  set(CMAKE_BUILD_TYPE Release CACHE STRING 
      "Semicolon-separate list of supported configuration types")
  # set default directories but don't override cached values...
  set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/${CMAKE_BUILD_TYPE}
      CACHE STRING "libraries go here")
  set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/${CMAKE_BUILD_TYPE}
      CACHE STRING "libraries go here")
  set(CMAKE_RUNTIME_OUTPUT_DIRECTORY 
      ${PROJECT_BINARY_DIR}/${CMAKE_BUILD_TYPE}
      CACHE STRING "executables go here")

else(UNIX)
  # this does not seem to work for xcode:
  set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING 
      "Semicolon-separate list of supported configuration types")
endif(UNIX)

#set(CMAKE_RELATIVE_PATHS ON CACHE STRING "avoid absolute paths" FORCE)

# Clear out the built-in C++ compiler and link flags for each of the 
# unused configurations.
set(CMAKE_CXX_FLAGS_MINSIZEREL "" CACHE INTERNAL "Unused")
set(CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL "" CACHE INTERNAL "Unused")
set(CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL "" CACHE INTERNAL "Unused")
set(CMAKE_EXE_LINKER_FLAGS_MINSIZEREL "" CACHE INTERNAL "Unused")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "" CACHE INTERNAL "Unused")
set(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO "" CACHE INTERNAL "Unused")
set(CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO "" CACHE INTERNAL "Unused")
set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "" CACHE INTERNAL "Unused")

set(CMAKE_OSX_ARCHITECTURES i386 ppc CACHE STRING "do not build for 64-bit" FORCE)

PROJECT(portmidi)
if(UNIX)
  # Problem: if there was an old Debug build and you change
  #  CMAKE_BUILD_TYPE to Release, then the OUTPUT_DIRECTORY's will
  #  still be Debug. Try to fix this by checking if the DIRECTORY's
  #  look wrong, and if so, force them to the defaults:
  if(CMAKE_BUILD_TYPE MATCHES "Debug")
    set(BAD_DIR "Release")
  else(CMAKE_BUILD_TYPE MATCHES "Debug")
    set(BAD_DIR "Debug")
  endif(CMAKE_BUILD_TYPE MATCHES "Debug")
  # use library as reference -- if you give it a non-BAD_DIR location
  # then every other path is left alone
  if(CMAKE_LIBRARY_OUTPUT_DIRECTORY MATCHES ${BAD_DIR})
    set(CMAKE_RUNTIME_OUTPUT_DIRECTORY 
        ${PROJECT_BINARY_DIR}/${CMAKE_BUILD_TYPE}
        CACHE STRING "executables go here" FORCE)
    set(CMAKE_LIBRARY_OUTPUT_DIRECTORY 
        ${PROJECT_BINARY_DIR}/${CMAKE_BUILD_TYPE}
        CACHE STRING "libraries go here" FORCE)
    set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY 
        ${PROJECT_BINARY_DIR}/${CMAKE_BUILD_TYPE}
        CACHE STRING "libraries go here" FORCE)
  endif(CMAKE_LIBRARY_OUTPUT_DIRECTORY MATCHES ${BAD_DIR})
endif(UNIX)

include_directories(pm_common porttime)
add_subdirectory(pm_common)

add_subdirectory(pm_test)

# Cannot figure out how to make an xcode Java application with CMake
add_subdirectory(pm_java)