Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for win dll builds. #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)

CMAKE_MINIMUM_REQUIRED(VERSION 3.0)
option(BUILD_SHARED_LIBS "Build using shared libraries" OFF)
PROJECT(Quartet)

SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -DNDEBUG -Wall -funroll-loops")
Expand All @@ -17,14 +17,21 @@ SET(SRC_FILES src/predicates.cpp
src/make_signed_distance.cpp
src/make_tet_mesh.cpp)

ADD_LIBRARY(quartet ${SRC_FILES})
ADD_LIBRARY(quartet_obj OBJECT ${SRC_FILES})
ADD_LIBRARY(quartet $<TARGET_OBJECTS:quartet_obj>)
if(UNIX)
TARGET_COMPILE_OPTIONS(quartet PRIVATE -fPIC)
TARGET_LINK_LIBRARIES(quartet PRIVATE m)
endif(UNIX)

ADD_EXECUTABLE(quartet_bin src/main.cpp)
TARGET_LINK_LIBRARIES(quartet_bin PRIVATE quartet)
if(WIN32 AND BUILD_SHARED_LIBS)
ADD_LIBRARY(quartet_static STATIC $<TARGET_OBJECTS:quartet_obj>)
TARGET_LINK_LIBRARIES(quartet_bin PRIVATE quartet_static)
else()
TARGET_LINK_LIBRARIES(quartet_bin PRIVATE quartet)
endif()

SET_TARGET_PROPERTIES(quartet_bin PROPERTIES OUTPUT_NAME quartet)

INSTALL(TARGETS quartet quartet_bin
Expand Down