Skip to content

Commit 9044019

Browse files
committed
install meta
1 parent 44630ca commit 9044019

File tree

3 files changed

+15
-9
lines changed

3 files changed

+15
-9
lines changed

CMakeLists.txt

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,22 @@
11
cmake_minimum_required(VERSION 3.14...3.28)
2-
project(GKlib LANGUAGES C)
2+
3+
project(GKlib LANGUAGES C
4+
VERSION 1.0.0
5+
)
6+
37
enable_testing()
48

59
option(BUILD_TESTING "Build tests" ON)
610

711
option(BUILD_SHARED_LIBS "Build shared libraries (.dll/.so) instead of static ones (.lib/.a)" OFF)
812

13+
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT AND GKlib_IS_TOP_LEVEL)
14+
set(CMAKE_INSTALL_PREFIX "${PROJECT_BINARY_DIR}/local" CACHE PATH "install prefix" FORCE)
15+
endif()
16+
917
set(CMAKE_C_STANDARD 99)
1018

11-
message(STATUS "${PROJECT_NAME} ${PROJECT_VERSION} Arch: ${CMAKE_SYSTEM_PROCESSOR}")
19+
message(STATUS "${PROJECT_NAME} ${PROJECT_VERSION} CMake ${CMAKE_VERSION} Arch: ${CMAKE_SYSTEM_PROCESSOR} install prefix: ${CMAKE_INSTALL_PREFIX}")
1220

1321
set(GKLIB_PATH ${PROJECT_SOURCE_DIR})
1422

@@ -37,5 +45,7 @@ if(BUILD_TESTING)
3745
add_subdirectory(test)
3846
endif()
3947

40-
install(TARGETS GKlib)
48+
install(TARGETS GKlib EXPORT ${PROJECT_NAME}-targets)
4149
install(FILES ${GKlib_includes} TYPE INCLUDE)
50+
51+
include(cmake/install.cmake)

LICENSE.txt renamed to LICENSE

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ http://www.apache.org/licenses/LICENSE-2.0
1212

1313
Unless required by applicable law or agreed to in writing, software
1414
distributed under the License is distributed on an "AS IS" BASIS,
15-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
16-
implied. See the License for the specific language governing
15+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
16+
implied. See the License for the specific language governing
1717
permissions and limitations under the License.
18-

test/CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,3 @@ foreach(prog IN ITEMS strings gksort fis gkrw gkgraph csrcnv grKx m2mnbrs cmpnbr
1717
add_test(NAME ${prog} COMMAND ${prog})
1818
endif()
1919
endforeach()
20-
21-
# Install a subset of them
22-
install(TARGETS csrcnv)

0 commit comments

Comments
 (0)