Fix misuse of CMake

OK jeremy@, sthen@
This commit is contained in:
dcoppa 2012-09-27 07:23:55 +00:00
parent 3a3b3ac9d0
commit 6fae77692b
3 changed files with 28 additions and 63 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.8 2012/04/23 17:15:17 espie Exp $
# $OpenBSD: Makefile,v 1.9 2012/09/27 07:23:55 dcoppa Exp $
SHARED_ONLY= Yes
@ -6,7 +6,7 @@ COMMENT= C++ database API
DISTNAME= deepfryed-dbicpp-v0.6.0
PKGNAME= dbic++-0.6.0
REVISION = 0
REVISION = 1
CATEGORIES= databases
HOMEPAGE= https://github.com/deepfryed/dbicpp
@ -27,14 +27,17 @@ WANTLIB = e2fs-uuid m mysqlclient pcrecpp pq stdc++ sqlite3
MASTER_SITES= http://distfiles.bsdfrog.org/
BUILD_DEPENDS= devel/cmake \
shells/bash
MODULES = devel/cmake
LIB_DEPENDS= mysql-client->=5:databases/mysql \
postgresql-client->=8.4:databases/postgresql \
devel/pcre \
sysutils/e2fsprogs
CONFIGURE_STYLE= none
CONFIGURE_ARGS+= -DCMAKE_MYSQL_VERSION=${LIBdbdmysql_VERSION} \
-DCMAKE_PG_VERSION=${LIBdbdpg_VERSION} \
-DCMAKE_SQLITE3_VERSION=${LIBdbdsqlite3_VERSION}
WRKDIST= ${WRKDIR}/deepfryed-dbicpp
NO_REGRESS= Yes
@ -43,13 +46,6 @@ post-extract:
mv ${WRKDIR}/deepfryed-dbicpp-* ${WRKDIR}/deepfryed-dbicpp
pre-configure:
${SUBST_CMD} ${WRKSRC}/{CMakeLists.txt,inc/dbic++.h,src/dbic++.cc,pkgconfig/dbic++.pc}
do-build:
cd ${WRKSRC} && ${SET_ENV} ${MAKE_ENV} ${LOCALBASE}/bin/bash build
do-install:
cd ${WRKSRC} && ${SET_ENV} ${MAKE_ENV} \
${LOCALBASE}/bin/bash build -i
${SUBST_CMD} ${WRKSRC}/{inc/dbic++.h,src/dbic++.cc,pkgconfig/dbic++.pc}
.include <bsd.port.mk>

View File

@ -1,45 +1,31 @@
$OpenBSD: patch-CMakeLists_txt,v 1.3 2012/04/06 19:25:23 jeremy Exp $
--- CMakeLists.txt.orig Wed Mar 28 22:09:47 2012
+++ CMakeLists.txt Thu Mar 29 16:09:46 2012
@@ -35,7 +35,7 @@ IF (PQ_FOUND)
TARGET_LINK_LIBRARIES(dbdpg ${PQ_LIBRARIES})
ENDIF()
$OpenBSD: patch-CMakeLists_txt,v 1.4 2012/09/27 07:23:55 dcoppa Exp $
--- CMakeLists.txt.orig Thu Mar 29 07:09:47 2012
+++ CMakeLists.txt Thu Sep 27 09:15:40 2012
@@ -2,7 +2,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT(DBICPP CXX C)
- SET_TARGET_PROPERTIES(dbdpg PROPERTIES VERSION ${CMAKE_PG_VERSION} SOVERSION 1)
+ SET_TARGET_PROPERTIES(dbdpg PROPERTIES VERSION "${CMAKE_PG_VERSION}${LIBdbdpg_VERSION}")
INSTALL(TARGETS dbdpg
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/dbic++
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/dbic++)
@@ -50,7 +50,7 @@ IF (MYSQL_FOUND)
ELSE()
TARGET_LINK_LIBRARIES(dbdmysql ${MYSQL_LIBRARIES})
ENDIF()
- SET_TARGET_PROPERTIES(dbdmysql PROPERTIES VERSION ${CMAKE_MYSQL_VERSION} SOVERSION 1)
+ SET_TARGET_PROPERTIES(dbdmysql PROPERTIES VERSION "${CMAKE_MYSQL_VERSION}${LIBdbdmysql_VERSION}")
INSTALL(TARGETS dbdmysql
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/dbic++
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/dbic++)
@@ -65,19 +65,19 @@ IF (SQLITE3_FOUND)
ELSE()
TARGET_LINK_LIBRARIES(dbdsqlite3 ${SQLITE3_LIBRARIES})
ENDIF()
- SET_TARGET_PROPERTIES(dbdsqlite3 PROPERTIES VERSION ${CMAKE_SQLITE3_VERSION} SOVERSION 1)
+ SET_TARGET_PROPERTIES(dbdsqlite3 PROPERTIES VERSION "${CMAKE_SQLITE3_VERSION}${LIBdbdsqlite3_VERSION}")
INSTALL(TARGETS dbdsqlite3
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/dbic++
LINK_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/lib)
-SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules modules)
+SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/modules)
FIND_PACKAGE(uuid REQUIRED)
FIND_PACKAGE(pcre REQUIRED)
@@ -71,13 +71,13 @@ IF (SQLITE3_FOUND)
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/dbic++)
ENDIF()
ADD_EXECUTABLE(demo/demo src/examples/demo.cc)
-ADD_EXECUTABLE(demo/demo src/examples/demo.cc)
-TARGET_LINK_LIBRARIES(demo/demo dbic++ dl ${UUID_LIBRARIES} ${PCRE_LIBRARIES})
+TARGET_LINK_LIBRARIES(demo/demo dbic++ ${UUID_LIBRARIES} ${PCRE_LIBRARIES})
+ADD_EXECUTABLE(demoapp src/examples/demo.cc)
+TARGET_LINK_LIBRARIES(demoapp dbic++ ${UUID_LIBRARIES} ${PCRE_LIBRARIES})
ADD_EXECUTABLE(demo/async src/examples/async.cc)
-ADD_EXECUTABLE(demo/async src/examples/async.cc)
-TARGET_LINK_LIBRARIES(demo/async dbic++ dl ${UUID_LIBRARIES} ${PCRE_LIBRARIES})
+TARGET_LINK_LIBRARIES(demo/async dbic++ ${UUID_LIBRARIES} ${PCRE_LIBRARIES})
+ADD_EXECUTABLE(demoapp-async src/examples/async.cc)
+TARGET_LINK_LIBRARIES(demoapp-async dbic++ ${UUID_LIBRARIES} ${PCRE_LIBRARIES})
-ADD_DEFINITIONS(-Wall -Wno-sign-compare -rdynamic -fopenmp -fPIC -O3 -Wno-non-virtual-dtor)
+ADD_DEFINITIONS(-Wall -Wno-sign-compare -rdynamic -fopenmp -fPIC -Wno-non-virtual-dtor)
+ADD_DEFINITIONS(-Wall -Wno-sign-compare -rdynamic -fPIC -Wno-non-virtual-dtor)
ADD_DEFINITIONS(${UUID_DEFINITIONS} ${PCRE_DEFINITIONS})
# Use -DCMAKE_INSTALL_PREFIX:PATH=<path> to override /usr/local

View File

@ -1,17 +0,0 @@
$OpenBSD: patch-build,v 1.1 2012/04/06 19:25:23 jeremy Exp $
--- build.orig Wed Jan 12 18:27:58 2011
+++ build Tue Jan 18 15:46:51 2011
@@ -88,12 +88,10 @@ _uninstall() {
}
_install() {
- _uninstall
cmake -DCMAKE_PG_VERSION=$PG_VERSION \
-DCMAKE_MYSQL_VERSION=$MYSQL_VERSION \
-DCMAKE_SQLITE3_VERSION=$SQLITE3_VERSION \
- -DCMAKE_INSTALL_PREFIX:PATH=/usr
- make
+ -DCMAKE_INSTALL_PREFIX:PATH=${LOCALBASE}
make install
}