aboutsummaryrefslogtreecommitdiff
path: root/ports/ptex/fix-build.patch
blob: 6d6484d606a3b3fa7909e8f9f0f16b187636904e (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
diff --git a/CMakeLists.txt b/CMakeLists.txt
index dd327d0..5043452 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -6,15 +6,6 @@ include(CTest)
 include(FindZLIB)
 include(FindThreads)
 
-enable_testing()
-
-# Detect the build type from the $FLAVOR environment variable
-if ("$ENV{FLAVOR}" MATCHES "debug")
-    set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "type of build" FORCE)
-else ()
-    set(CMAKE_BUILD_TYPE "Release" CACHE STRING "type of build" FORCE)
-endif ()
-
 if (NOT WIN32)
     set(CMAKE_CXX_FLAGS "-std=c++98 -Wall -Wextra -pedantic")
 endif ()
@@ -40,6 +31,6 @@ include_directories(src/ptex)
 include_directories(${ZLIB_INCLUDE_DIR})
 
 add_subdirectory(src/ptex)
-add_subdirectory(src/utils)
-add_subdirectory(src/tests)
-add_subdirectory(src/doc)
+#add_subdirectory(src/utils)
+#add_subdirectory(src/tests)
+#add_subdirectory(src/doc)
diff --git a/src/ptex/CMakeLists.txt b/src/ptex/CMakeLists.txt
index c926d98..ac2c71d 100644
--- a/src/ptex/CMakeLists.txt
+++ b/src/ptex/CMakeLists.txt
@@ -1,6 +1,8 @@
-if (WIN32)
-    add_definitions(/DPTEX_EXPORTS)
-endif (WIN32)
+if (BUILD_SHARED_LIBS)
+    add_definitions(-DPTEX_EXPORTS)
+else ()
+    add_definitions(-DPTEX_STATIC)  
+endif ()
 
 set(SRCS
     PtexCache.cpp
@@ -14,15 +16,11 @@ set(SRCS
     PtexUtils.cpp
     PtexWriter.cpp)
 
-add_library(Ptex_static STATIC ${SRCS})
-set_target_properties(Ptex_static PROPERTIES OUTPUT_NAME Ptex)
+add_library(Ptex ${SRCS})
 
-add_library(Ptex_dynamic SHARED ${SRCS})
-set_target_properties(Ptex_dynamic PROPERTIES OUTPUT_NAME Ptex)
+target_link_libraries(Ptex ${CMAKE_THREAD_LIBS_INIT} ${ZLIB_LIBRARIES})
 
-target_link_libraries(Ptex_dynamic ${CMAKE_THREAD_LIBS_INIT} ${ZLIB_LIBRARIES})
-
-install(TARGETS Ptex_static Ptex_dynamic DESTINATION ${CMAKE_INSTALL_LIBDIR})
+install(TARGETS Ptex RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
 
 install(FILES
         PtexHalf.h