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

Support CMake. #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
19 changes: 19 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
cmake_minimum_required(VERSION 3.10)
project(SheenBidi)


include_directories(${CMAKE_CURRENT_SOURCE_DIR}/Headers)
file(GLOB SRC_FILES Source/*.c)

option(BUILD_SHARED_LIBS "Build shared library" OFF)

if(BUILD_SHARED_LIBS)
set(BUILDSHARE SHARED)
else()
set(BUILDSHARE )
endif()

add_library(sheenbidi ${BUILDSHARE} ${SRC_FILES})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is highly unusual for CMake. Whether libraries are built as shared is controlled by the built-in BUILD_SHARED_LIBS CMake option. There is no need for and there shouldn't be such an option.


add_subdirectory(Tools/Parser)
add_subdirectory(Tools/Tester)
16 changes: 16 additions & 0 deletions Tools/Parser/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
cmake_minimum_required(VERSION 3.10)
project(SheenBidi)


include_directories(${CMAKE_CURRENT_SOURCE_DIR}/Headers)
file(GLOB SRC_FILES *.cpp)

option(BUILD_SHARED_LIBS "Build shared library" ON)

if(BUILD_SHARED_LIBS)
set(BUILDSHARE SHARED)
else()
set(BUILDSHARE )
endif()

add_library(parser ${BUILDSHARE} ${SRC_FILES})
19 changes: 19 additions & 0 deletions Tools/Tester/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
cmake_minimum_required(VERSION 3.10)
project(SheenBidi)


include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../ ${CMAKE_CURRENT_SOURCE_DIR}/../../)

file(GLOB SRC_FILES *.cpp)
file(GLOB UTIL_FILES Utilities/*.cpp)

option(BUILD_SHARED_LIBS "Build shared library" ON)

if(BUILD_SHARED_LIBS)
set(BUILDSHARE SHARED)
else()
set(BUILDSHARE )
endif()

add_executable(tester ${SRC_FILES} ${UTIL_FILES})
target_link_libraries(tester parser sheenbidi)