summaryrefslogtreecommitdiff
blob: 76fd8513213a9dd4f6de542e19518229ba229014 (plain)
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a316b76..50176f0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -6,6 +6,8 @@ cmake_minimum_required( VERSION 3.2 )
 
 cmake_policy( SET CMP0048 NEW )
 
+include( GNUInstallDirs )
+
 #------------------------------------------------------------------------------
 #   Define the project
 #------------------------------------------------------------------------------
@@ -131,8 +133,8 @@ set_target_properties( ${FULLNAME} PROPERTIES
                        COMPILE_PDB_NAME            ${FULLNAME} )
 
 install( TARGETS ${FULLNAME}
-         PUBLIC_HEADER DESTINATION include
-         ARCHIVE       DESTINATION ${LIB_INSTALL_DIR} )
+         PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_LIBDIR}/hercules-sdl/include
+         ARCHIVE       DESTINATION ${CMAKE_INSTALL_LIBDIR}/hercules-sdl/lib )
 
 
 #------------------------------------------------------------------------------
diff --git a/cmake/modules/ParseBinaryDir.cmake b/cmake/modules/ParseBinaryDir.cmake
index 7983107..2ede77b 100644
--- a/cmake/modules/ParseBinaryDir.cmake
+++ b/cmake/modules/ParseBinaryDir.cmake
@@ -7,6 +7,8 @@ macro( ParseBinaryDir )
     set(  CMAKE_DISABLE_IN_SOURCE_BUILD  ON  )
     set(  CMAKE_DISABLE_SOURCE_CHANGES   ON  )
 
+    set( FULLNAME ${EXTPKG_NAME} )
+
     #--------------------------------------------------------------------------
     #  Make sure they are not trying to do an "in source" build by making
     #  sure the cmake "binary" (build) directory is not a subdirectory of
@@ -48,102 +50,6 @@ Remove the 'CMakeCache.txt' file and the entire 'CMakeFiles' directory and try a
 
     TEST_BIG_ENDIAN( IS_BIG_ENDIAN )
 
-    #--------------------------------------------------------------------------
-    #   Split the binary build directory into its constituent components.
-    #   Refer to the "BUILDING" document for more information.
-    #--------------------------------------------------------------------------
-
-    get_filename_component( BINARY_HLQ "${CMAKE_BINARY_DIR}" DIRECTORY )
-    get_filename_component( BINARY_DIR "${CMAKE_BINARY_DIR}" NAME )
-
-    trace( BINARY_HLQ )
-    trace( BINARY_DIR )
-
-    string( FIND ${BINARY_DIR} " " _n )
-    if( NOT ${_n} EQUAL -1 )
-        message( FATAL_ERROR "Build directory name cannot have spaces! ${BINARY_DIR}" )
-    endif()
-
-    #--------------------------------------------------------------------------
-    #  First, split it into two parts: before the dot and after the dot
-    #--------------------------------------------------------------------------
-
-    string( REGEX MATCH "([^\\.]*)" _xxxxx ${BINARY_DIR} )
-    string( REGEX MATCH "([^.]*\$)" CONFIG ${BINARY_DIR} )
-
-    trace( _xxxxx )
-    trace( CONFIG )
-
-    #--------------------------------------------------------------------------
-    #  The second part tells us if this is a "Debug" or "Release" build.
-    #--------------------------------------------------------------------------
-
-    string( LENGTH ${CONFIG} _n )
-    if( ${_n} LESS 1 )
-        message( FATAL_ERROR "Invalid Release/Debug build type! ${CONFIG}" )
-    endif()
-
-    #--------------------------------------------------------------------------
-    #  Capitalize "Debug" and "Release" for Visual Studio compatibility.
-    #--------------------------------------------------------------------------
-
-    include( CapitalizeWord )
-
-    Capitalize_Word( ${CONFIG} CONFIG )
-
-    if(( NOT CONFIG STREQUAL "Debug" ) AND (NOT CONFIG STREQUAL "Release" ))
-        message( FATAL_ERROR "Invalid Release/Debug build type! ${CONFIG}" )
-    endif()
-
-    #--------------------------------------------------------------------------
-    #  Define the "Debug" or "Release" build type
-    #--------------------------------------------------------------------------
-
-    if( CONFIG STREQUAL "Debug" )
-        set( CMAKE_BUILD_TYPE "Debug" CACHE PATH "" FORCE )
-        set( DBGCHAR "d" )
-    elseif( CONFIG STREQUAL "Release" )
-        set( CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE PATH "" FORCE )
-        set( DBGCHAR "" )
-    endif()
-
-    trace( CMAKE_BUILD_TYPE )
-
-    #--------------------------------------------------------------------------
-    #  Now split the first part into the base package/product name
-    #  and build architecture (32-bit ot 64-bit).
-    #--------------------------------------------------------------------------
-
-    string( LENGTH ${_xxxxx} _n )
-    if( ${_n} LESS 3 )
-        message( FATAL_ERROR "Invalid base package name! ${_xxxxx}" )
-    endif()
-
-    math( EXPR _n "${_n} - 2" )     # (want the last two characters)
-
-    string( SUBSTRING ${_xxxxx} 0 ${_n}    BASENAME )
-    string( SUBSTRING ${_xxxxx}   ${_n} -1 BITNESS  )
-
-    if( NOT BITNESS STREQUAL "32" AND
-        NOT BITNESS STREQUAL "64" )
-        message( FATAL_ERROR "Invalid package architecture! ${BITNESS}" )
-    endif()
-
-    #--------------------------------------------------------------------------
-    #  Show results
-    #--------------------------------------------------------------------------
-
-    set( SUFFIX   "${BITNESS}${DBGCHAR}" )
-    set( FULLNAME "${BASENAME}${SUFFIX}" )
-
-    trace( BASENAME )
-    trace( BITNESS  )
-    trace( CONFIG   )
-    trace( DBGCHAR  )
-    trace( SUFFIX   )
-    trace( FULLNAME )
-    trace( CMAKE_BINARY_DIR )
-
     #--------------------------------------------------------------------------
     #  Define the install directory
     #--------------------------------------------------------------------------
diff --git a/extra.txt b/extra.txt
index dfb293d..6018eb6 100644
--- a/extra.txt
+++ b/extra.txt
@@ -2,8 +2,8 @@
 #   Define additional files to be installed
 #------------------------------------------------------------------------------

-install( FILES "telnet.LICENSE.txt" DESTINATION . )
-install( FILES "telnet.README.txt"  DESTINATION . )
+install( FILES "telnet.LICENSE.txt" DESTINATION ${CMAKE_INSTALL_DOCDIR} )
+install( FILES "telnet.README.txt"  DESTINATION ${CMAKE_INSTALL_DOCDIR} )
 
 #------------------------------------------------------------------------------