mirror of
https://github.com/rbock/sqlpp11.git
synced 2024-11-15 20:31:16 +08:00
Merge pull request #220 from sjoubert/install_ddl2cpp
Install and export ddl2cpp script
This commit is contained in:
commit
78c6bc0670
@ -72,6 +72,11 @@ install(TARGETS sqlpp11
|
||||
EXPORT Sqlpp11Targets
|
||||
)
|
||||
|
||||
install(PROGRAMS "${PROJECT_SOURCE_DIR}/scripts/ddl2cpp"
|
||||
RENAME sqlpp11-ddl2cpp
|
||||
DESTINATION bin
|
||||
)
|
||||
|
||||
include(CMakePackageConfigHelpers)
|
||||
|
||||
write_basic_package_version_file(
|
||||
@ -113,4 +118,4 @@ if(ENABLE_TESTS)
|
||||
add_subdirectory(test_static_asserts)
|
||||
add_subdirectory(test_constraints)
|
||||
add_subdirectory(test_scripts)
|
||||
endif()
|
||||
endif()
|
||||
|
@ -29,3 +29,17 @@ include(CMakeFindDependencyMacro)
|
||||
find_dependency(HinnantDate REQUIRED)
|
||||
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/Sqlpp11Targets.cmake")
|
||||
|
||||
# Import "ddl2cpp" script
|
||||
if(TARGET sqlpp11::ddl2cpp)
|
||||
message(FATAL_ERROR "Target sqlpp11::ddl2cpp already defined")
|
||||
endif()
|
||||
get_filename_component(sqlpp11_ddl2cpp_location "${CMAKE_CURRENT_LIST_DIR}/../../../bin/sqlpp11-ddl2cpp" REALPATH)
|
||||
if(NOT EXISTS "${sqlpp11_ddl2cpp_location}")
|
||||
message(FATAL_ERROR "The imported target sqlpp11::ddl2cpp references the file '${sqlpp11_ddl2cpp_location}' but this file does not exists.")
|
||||
endif()
|
||||
add_executable(sqlpp11::ddl2cpp IMPORTED)
|
||||
set_target_properties(sqlpp11::ddl2cpp PROPERTIES
|
||||
IMPORTED_LOCATION "${sqlpp11_ddl2cpp_location}"
|
||||
)
|
||||
unset(sqlpp11_ddl2cpp_location)
|
||||
|
Loading…
Reference in New Issue
Block a user